bug_id
bug_severity
bug_status
+ bug_type
cclist_accessible
component_id
creation_ts
bug_file_loc => \&_check_bug_file_loc,
bug_severity => \&_check_select_field,
bug_status => \&_check_bug_status,
+ bug_type => \&_check_select_field,
cc => \&_check_cc,
comment => \&_check_comment,
component => \&_check_component,
bug_file_loc
bug_severity
bug_status
+ bug_type
cclist_accessible
component_id
deadline
severity => 'bug_severity',
status => 'bug_status',
summary => 'short_desc',
+ type => 'bug_type',
url => 'bug_file_loc',
whiteboard => 'status_whiteboard',
};
sub ES_PROPERTIES {
return {
_bz_field('priority'), _bz_field('bug_severity'), _bz_field('bug_status'),
- _bz_field('resolution'),
+ _bz_field('resolution'), _bz_field('bug_type'),
status_whiteboard =>
{type => 'string', analyzer => 'whiteboard_shingle_tokens'},
delta_ts => {type => 'string', index => 'not_analyzed'},
my @fields = (
'keywords', 'short_desc', 'product', 'component',
'cf_crash_signature', 'alias', 'status_whiteboard', 'bug_status',
- 'resolution', 'priority', 'assigned_to'
+ 'resolution', 'priority', 'assigned_to', 'bug_type'
);
my $fields = join(', ', ("?") x @fields);
reporter => $self->reporter->login,
delta_ts => $self->delta_ts,
bug_severity => $self->bug_severity,
+ bug_type => $self->bug_type,
};
}
# C<component> - B<Required> The name of the component this bug is being
# filed against.
#
+# C<bug_type> - B<Required> The initial type for the bug.
# C<bug_severity> - B<Required> The severity for the bug, a string.
# C<creation_ts> - B<Required> A SQL timestamp for when the bug was created.
# C<short_desc> - B<Required> A summary for the bug.
$dbh->bz_start_transaction();
# These fields have default values which we can use if they are undefined.
+ $params->{bug_type} = Bugzilla->params->{default_bug_type}
+ unless defined $params->{bug_type};
$params->{bug_severity} = Bugzilla->params->{defaultseverity}
unless defined $params->{bug_severity};
$params->{priority} = Bugzilla->params->{defaultpriority}
reporter_accessible cclist_accessible
classification_id classification
product component version rep_platform op_sys
- bug_status resolution dup_id see_also
+ bug_type bug_status resolution dup_id see_also
bug_file_loc status_whiteboard keywords
priority bug_severity target_milestone
dependson blocked regressed_by regresses
}
}
}
+
+sub set_type {
+ # The bug_type table column is nullable, but make sure to use the default type
+ # in case it's not set
+ $_[0]->set('bug_type', $_[1] || Bugzilla->params->{'default_bug_type'});
+}
+
sub set_status_whiteboard { $_[0]->set('status_whiteboard', $_[1]); }
sub set_summary { $_[0]->set('short_desc', $_[1]); }
sub set_target_milestone { $_[0]->set('target_milestone', $_[1]); }
sub bug_id { return $_[0]->{bug_id} }
sub bug_severity { return $_[0]->{bug_severity} }
sub bug_status { return $_[0]->{bug_status} }
+sub bug_type { return $_[0]->{bug_type} }
sub cclist_accessible { return $_[0]->{cclist_accessible} }
sub component_id { return $_[0]->{component_id} }
sub creation_ts { return $_[0]->{creation_ts} }
id
name
product_id
+ default_bug_type
initialowner
initialqacontact
description
use constant UPDATE_COLUMNS => qw(
name
+ default_bug_type
initialowner
initialqacontact
description
use constant VALIDATORS => {
create_series => \&Bugzilla::Object::check_boolean,
product => \&_check_product,
+ default_bug_type => \&_check_default_bug_type,
initialowner => \&_check_initialowner,
initialqacontact => \&_check_initialqacontact,
description => \&_check_description,
return $description;
}
+sub _check_default_bug_type {
+ my ($invocant, $type) = @_;
+ return $type if Bugzilla::Config::Common::check_bug_type($type) eq '';
+ # Ignore silently just in case
+ return undef;
+}
+
sub _check_initialowner {
my ($invocant, $owner) = @_;
}
}
-sub set_name { $_[0]->set('name', $_[1]); }
-sub set_description { $_[0]->set('description', $_[1]); }
-sub set_is_active { $_[0]->set('isactive', $_[1]); }
+sub set_name { $_[0]->set('name', $_[1]); }
+sub set_description { $_[0]->set('description', $_[1]); }
+sub set_is_active { $_[0]->set('isactive', $_[1]); }
+sub set_default_bug_type { $_[0]->set('default_bug_type', $_[1]); }
sub set_default_assignee {
my ($self, $owner) = @_;
return $self->{'bugs_ids'};
}
+sub default_bug_type {
+ return $_[0]->{'default_bug_type'} ||= Bugzilla->params->{'default_bug_type'};
+}
+
sub default_assignee {
my $self = shift;
return $self->{'default_assignee'}
my $name = $component->name;
my $description = $component->description;
my $product_id = $component->product_id;
+ my $default_bug_type = $component->default_bug_type;
my $default_assignee = $component->default_assignee;
my $default_qa_contact = $component->default_qa_contact;
my $initial_cc = $component->initial_cc;
my $component =
Bugzilla::Component->create({ name => $name,
product => $product,
+ default_bug_type => $default_bug_type,
initialowner => $user_login1,
initialqacontact => $user_login2,
triage_owner => $user_login3,
$component->set_name($new_name);
$component->set_description($new_description);
+ $component->set_default_bug_type($new_type);
$component->set_default_assignee($new_login_name);
$component->set_default_qa_contact($new_login_name);
$component->set_cc_list(\@new_login_names);
Returns: A reference to an array of bug IDs.
+=item C<default_bug_type()>
+
+ Description: Returns the default type for bugs filed under this component.
+ Returns the installation's global default bug type if the
+ component's specific type is not set.
+
+ Params: none.
+
+ Returns: A string.
+
=item C<default_assignee()>
Description: Returns a user object that represents the default assignee for
Returns: Nothing.
+=item C<set_default_bug_type($new_type)>
+
+ Description: Changes the default bug type of the component.
+
+ Params: $new_type - one of legal bug types or undef.
+
+ Returns: Nothing.
+
=item C<set_default_assignee($new_assignee)>
Description: Changes the default assignee of the component.
product - a Bugzilla::Product object to which
the Component is being added.
description - description of the new component (string).
+ default_bug_type - the default type for bugs filed under this
+ component (string).
initialowner - login name of the default assignee (string).
The following keys are optional:
initiaqacontact - login name of the default QA contact (string),
sub get_param_list {
my $class = shift;
+ my @legal_types = @{get_legal_field_values('bug_type')};
my @legal_priorities = @{get_legal_field_values('priority')};
my @legal_severities = @{get_legal_field_values('bug_severity')};
my @legal_platforms = @{get_legal_field_values('rep_platform')};
{name => 'use_see_also', type => 'b', default => 1},
+ {
+ name => 'default_bug_type',
+ type => 's',
+ choices => \@legal_types,
+ default => 'defect',
+ checker => \&check_bug_type
+ },
+
{
name => 'defaultpriority',
type => 's',
use base qw(Exporter);
@Bugzilla::Config::Common::EXPORT = qw(
check_multi check_numeric check_regexp check_url check_group
- check_priority check_severity check_platform
+ check_bug_type check_priority check_severity check_platform
check_opsys check_shadowdb check_urlbase check_webdotbase
check_user_verify_class
check_mail_delivery_method check_notification check_utf8
return "";
}
+sub check_bug_type {
+ my ($value) = (@_);
+ my $legal_types = get_legal_field_values('bug_type');
+ if (!grep($_ eq $value, @$legal_types)) {
+ return "Must be a legal type value: one of "
+ . join(", ", @$legal_types);
+ }
+ return "";
+}
+
sub check_priority {
my ($value) = (@_);
my $legal_priorities = get_legal_field_values('priority');
# The default list of columns for buglist.cgi
use constant DEFAULT_COLUMN_LIST => (
- "product", "component", "assigned_to", "bug_status",
- "resolution", "short_desc", "changeddate"
+ "bug_type", "short_desc", "product", "component", "assigned_to",
+ "bug_status", "resolution", "changeddate"
);
# Used by query.cgi and buglist.cgi as the named-query name
# Bugzilla with enums. After that, they are either controlled through
# the Bugzilla UI or through the DB.
use constant ENUM_DEFAULTS => {
+ bug_type => ['defect', 'enhancement', 'task'],
bug_severity =>
- ['blocker', 'critical', 'major', 'normal', 'minor', 'trivial', 'enhancement'],
+ ['blocker', 'critical', 'major', 'normal', 'minor', 'trivial'],
priority => ["Highest", "High", "Normal", "Low", "Lowest", "---"],
op_sys => ["All", "Windows", "Mac OS", "Linux", "Other"],
rep_platform => ["All", "PC", "Macintosh", "Other"],
is_multiplicable => 1
},
fielddefs => {mailhead => 1, obsolete => 1},
+ bug_type => {isactive => 1},
bug_status => {isactive => 1},
resolution => {isactive => 1},
bug_severity => {isactive => 1},
with 'Bugzilla::Elastic::Role::Search';
my @SUPPORTED_FIELDS = qw(
- bug_id product component short_desc
+ bug_id bug_type product component short_desc
priority status_whiteboard bug_status resolution
keywords alias assigned_to reporter delta_ts
longdesc cf_crash_signature classification bug_severity
$IS_SUPPORTED_FIELD{relevance} = 1;
my @NORMAL_FIELDS = qw(
+ bug_type
priority
bug_severity
bug_status
type => FIELD_TYPE_SINGLE_SELECT,
buglist => 1
},
+ {
+ name => 'bug_type',
+ desc => 'Type',
+ in_new_bugmail => 1,
+ type => FIELD_TYPE_SINGLE_SELECT,
+ buglist => 1
+ },
{
name => 'bug_severity',
desc => 'Severity',
};
use constant DEFAULT_MAP => {
+ bug_type => 'default_bug_type',
op_sys => 'defaultopsys',
rep_platform => 'defaultplatform',
priority => 'defaultpriority',
# Custom mappings for some fields.
use constant MAPPINGS => {
- # Status, Resolution, Platform, OS, Priority, Severity
+ # Type, Status, Resolution, Platform, OS, Priority, Severity
+ "type" => "bug_type",
"status" => "bug_status",
"platform" => "rep_platform",
"os" => "op_sys",
# "reporter_accessible" and "reporter" both match "rep".
delete @full_map{
qw(rep_platform bug_status bug_file_loc bug_group
- bug_severity bug_status
+ bug_severity bug_status bug_type
status_whiteboard
cclist_accessible reporter_accessible)
};
{
default => sub {$Component}
},
+ bug_type => Str,
+ {default => 'defect'},
bug_severity => Str,
{default => 'normal'},
groups => ArrayRef [Str],
'resolution' => EVT_OPENED_CLOSED,
'keywords' => EVT_KEYWORD,
'cc' => EVT_CC,
+ 'bug_type' => EVT_PROJ_MANAGEMENT,
'bug_severity' => EVT_PROJ_MANAGEMENT,
'priority' => EVT_PROJ_MANAGEMENT,
'bug_status' => EVT_PROJ_MANAGEMENT,
# We skip certain fields because their set_ methods actually use
# the external names instead of the internal names.
$params = Bugzilla::Bug::map_fields($params,
- {summary => 1, platform => 1, severity => 1, url => 1});
+ {summary => 1, platform => 1, severity => 1, type => 1, url => 1});
my $ids = delete $params->{ids};
defined $ids || ThrowCodeError('param_required', {param => 'ids'});
status => $self->type('string', $bug->bug_status),
summary => $self->type('string', $bug->short_desc),
target_milestone => $self->type('string', $bug->target_milestone),
+ type => $self->type('string', $bug->bug_type),
url => $self->type('string', $bug->bug_file_loc),
version => $self->type('string', $bug->version),
whiteboard => $self->type('string', $bug->status_whiteboard),
As with C<triage_owner>, this is an B<extra> field returned only by specifying
C<triage_owner> or C<_extra> in C<include_fields>.
+=item C<type>
+
+C<string> The type of the bug.
+
=item C<update_token>
C<string> The token that you would have to pass to the F<process_bug.cgi>
in Bugzilla B<4.4>.
=item The C<attachments>, C<comments>, C<duplicates>, C<history>,
-C<regressed_by>, C<regressions> and C<triage_owner> fields were added in
-Bugzilla B<6.0>.
+C<regressed_by>, C<regressions>, C<triage_owner> and C<type> fields were added
+in Bugzilla B<6.0>.
=back
C<string> The login name of the Triage Owner of a bug's component.
+=item C<type>
+
+C<string> The Type field on a bug.
+
=item C<url>
C<string> The "URL" field of a bug.
=item C<severity> (string) B<Defaulted> - How severe the bug is.
+=item C<type> (string) B<Defaulted> - The basic category of the bug.
+
=item C<alias> (string) - A brief alias for the bug that can be used
instead of a bug number when accessing this bug. Must be unique in
all of this Bugzilla.
C<string> The bug's Target Milestone.
+=item C<type>
+
+C<string> The Type field on the bug.
+
=item C<url>
C<string> The "URL" field of a bug.
Depending on the speed of your computer and your Internet connection, this entire process
will take from a few minutes to much longer.
-If this fails, please file a bug `using this link <https://bugzilla.mozilla.org/enter_bug.cgi?assigned_to=nobody%40mozilla.org&bug_file_loc=http%3A%2F%2F&bug_ignored=0&bug_severity=normal&bug_status=NEW&cf_fx_iteration=---&cf_fx_points=---&component=Developer%20Box&contenttypemethod=autodetect&contenttypeselection=text%2Fplain&defined_groups=1&flag_type-254=X&flag_type-4=X&flag_type-607=X&flag_type-791=X&flag_type-800=X&flag_type-803=X&form_name=enter_bug&maketemplate=Remember%20values%20as%20bookmarkable%20template&op_sys=Unspecified&priority=--&product=bugzilla.mozilla.org&rep_platform=Unspecified&target_milestone=---&version=Production>`__.
+If this fails, please file a bug `using this link <https://bugzilla.mozilla.org/enter_bug.cgi?assigned_to=nobody%40mozilla.org&bug_file_loc=http%3A%2F%2F&bug_ignored=0&bug_type=defect&bug_severity=normal&bug_status=NEW&cf_fx_iteration=---&cf_fx_points=---&component=Developer%20Box&contenttypemethod=autodetect&contenttypeselection=text%2Fplain&defined_groups=1&flag_type-254=X&flag_type-4=X&flag_type-607=X&flag_type-791=X&flag_type-800=X&flag_type-803=X&form_name=enter_bug&maketemplate=Remember%20values%20as%20bookmarkable%20template&op_sys=Unspecified&priority=--&product=bugzilla.mozilla.org&rep_platform=Unspecified&target_milestone=---&version=Production>`__.
Otherwise, you should have a working BMO developer machine!
# Generate the list of columns that will be selected in the SQL query.
-# The bug ID is always selected because bug IDs are always displayed.
-# Severity, priority, resolution and status are required for buglist
+# The bug ID is always selected because bug IDs are always displayed. Type,
+# severity, priority, status, resolution and product are required for buglist
# CSS classes.
my @selectcolumns
- = ("bug_id", "bug_severity", "priority", "bug_status", "resolution",
- "product");
+ = ("bug_id", "bug_type", "bug_severity", "priority", "bug_status",
+ "resolution", "product");
# remaining and actual_time are required for percentage_complete calculation:
if (grep { $_ eq "percentage_complete" } @displaycolumns) {
'short_desc', 'opendate', 'changeddate', 'reporter',
'reporter_realname', 'priority', 'bug_severity', 'assigned_to',
'assigned_to_realname', 'bug_status', 'product', 'component',
- 'resolution'
+ 'resolution', 'bug_type'
);
push(@required_atom_columns, 'target_milestone')
if Bugzilla->params->{'usetargetmilestone'};
Bugzilla->switch_to_shadow_db();
$vars->{'products'} = $user->get_enterable_products;
+ $vars->{'types'} = get_legal_field_values('bug_type');
$vars->{'platforms'} = get_legal_field_values('rep_platform');
$vars->{'op_sys'} = get_legal_field_values('op_sys');
$vars->{'priorities'} = get_legal_field_values('priority');
<!ELEMENT bug (bug_id, (alias?, creation_ts, short_desc, delta_ts, reporter_accessible,
cclist_accessible, classification_id, classification, product, component,
version, rep_platform, op_sys, bug_status, resolution?, dup_id?, see_also*,
- bug_file_loc?, status_whiteboard?, keywords*, priority, bug_severity,
+ bug_file_loc?, status_whiteboard?, keywords*, bug_type, priority, bug_severity,
target_milestone?, dependson*, blocked*, regressed_by*, regresses*, everconfirmed,
reporter, assigned_to, cc*, (estimated_time, remaining_time, actual_time, deadline?)?,
qa_contact?, votes?, token?, group*, flag*, long_desc*, attachment*)?)>
>
<!ELEMENT bug_id (#PCDATA)>
<!ELEMENT alias (#PCDATA)>
+<!ELEMENT bug_type (#PCDATA)>
<!ELEMENT reporter_accessible (#PCDATA)>
<!ELEMENT cclist_accessible (#PCDATA)>
<!ELEMENT exporter (#PCDATA)>
$answer{'webdotbase'} = '/usr/bin/dot';
$answer{'auth_delegation'} = 1;
$answer{'insidergroup'} = 'admin';
+$answer{'default_bug_type'} = 'defect';
$answer{'defaultpriority'} = '--';
$answer{'defaultseverity'} = 'normal';
$answer{'skin'} = 'Mozilla';
# Pass a bunch of Bugzilla configuration to the templates.
my $vars = {};
+$vars->{'type'} = get_legal_field_values('bug_type');
$vars->{'priority'} = get_legal_field_values('priority');
$vars->{'severity'} = get_legal_field_values('bug_severity');
$vars->{'platform'} = get_legal_field_values('rep_platform');
prevents addition of new relationships, but existing ones will continue to
appear.
+default_bug_type
+ This is the type that newly entered bugs are set to.
+
defaultpriority
This is the priority that newly entered bugs are set to.
],
"resolution": "INVALID",
"id": 35,
+ "type": "defect",
"qa_contact": "",
"triage_owner": "",
"version": "1.0",
target_milestone string The milestone that this bug is supposed to be
fixed by, or for closed bugs, the milestone that
it was fixed for.
+type string The type of the bug.
update_token string The token that you would have to pass to the
``process_bug.cgi`` page in order to update this
bug. This changes every time the bug is updated.
QA Contact set, if the field is disabled).
triage_owner string The login name of the Triage Owner of a bug's
component.
+type string The Type field on a bug.
url string The "URL" field of a bug.
version string The Version field of a bug.
whiteboard string Search the "Status Whiteboard" field on bugs for a
the developer, compared to the developer's other
bugs.
severity string (defaulted) How severe the bug is.
+type string (defaulted) The basic category of the bug.
alias array One or more brief aliases for the bug that can be
used instead of a bug number when accessing this bug.
Must be unique in all of this Bugzilla.
you should also specify a ``resolution``.
summary string The Summary field of the bug.
target_milestone string The bug's Target Milestone.
+type string The Type field on the bug.
url string The "URL" field of a bug.
version string The bug's Version field.
whiteboard string The Status Whiteboard field of a bug.
"defaultplatform" : "",
"defaultpriority" : "--",
"defaultseverity" : "normal",
+ "default_bug_type" : "defect",
"duplicate_or_move_bug_status" : "RESOLVED",
"emailregexp" : "^[\\w\\.\\+\\-=']+@[\\w\\.\\-]+\\.[\\w\\-]+$",
"emailsuffix" : "",
* defaultplatform
* defaultpriority
* defaultseverity
+* default_bug_type
* duplicate_or_move_bug_status
* emailregexpdesc
* emailsuffix
my $triage_owner = trim($cgi->param('triage_owner') || '');
my @initial_cc = $cgi->param('initialcc');
my $isactive = $cgi->param('isactive');
+ my $default_bug_type = $cgi->param('default_bug_type');
my $component = Bugzilla::Component->create({
name => $comp_name,
initialqacontact => $default_qa_contact,
initial_cc => \@initial_cc,
triage_owner_id => $triage_owner,
+ default_bug_type => $default_bug_type,
# XXX We should not be creating series for products that we
# didn't create series for.
});
my $comp_old_name = trim($cgi->param('componentold') || '');
+ my $default_bug_type = trim($cgi->param('default_bug_type') || '');
my $default_assignee = trim($cgi->param('initialowner') || '');
my $default_qa_contact = trim($cgi->param('initialqacontact') || '');
my $description = trim($cgi->param('description') || '');
$component->set_name($comp_name);
$component->set_description($description);
+ $component->set_default_bug_type($default_bug_type);
$component->set_default_assignee($default_assignee);
$component->set_default_qa_contact($default_qa_contact);
$component->set_triage_owner($triage_owner);
$vars->{'product'} = $product;
+$vars->{'bug_type'} = get_legal_field_values('bug_type');
$vars->{'priority'} = get_legal_field_values('priority');
$vars->{'bug_severity'} = get_legal_field_values('bug_severity');
$vars->{'rep_platform'} = get_legal_field_values('rep_platform');
# BMO: allow form value component to override the cloned bug component
$default{'component_'} = formvalue('component') || $cloned_bug->component;
+ $default{'bug_type'} = $cloned_bug->bug_type;
$default{'priority'} = $cloned_bug->priority;
$default{'bug_severity'} = $cloned_bug->bug_severity;
$default{'rep_platform'} = $cloned_bug->rep_platform;
else {
$default{'component_'} = formvalue('component');
+ $default{'bug_type'}
+ = formvalue('bug_type', Bugzilla->params->{'default_bug_type'});
$default{'priority'}
= formvalue('priority', Bugzilla->params->{'defaultpriority'});
$default{'bug_severity'}
# fields that have a custom sortkey. (So they are correctly sorted
# when using js)
- my @sortkey_fields = qw(bug_status resolution bug_severity priority
+ my @sortkey_fields = qw(bug_status resolution bug_type bug_severity priority
rep_platform op_sys);
my %columns_sortkey;
short_desc => "Custom field '$name' added to bugzilla.mozilla.org",
product => 'Data & BI Services Team',
component => 'Database Operations',
+ bug_type => 'task',
bug_severity => 'normal',
op_sys => 'All',
rep_platform => 'All',
product => 'mozilla.org',
component => 'Security Assurance: Incident',
status_whiteboard => '[infrasec:incident]',
+ bug_type => 'task',
bug_severity => 'critical',
cc => ['jstevensen@mozilla.com'],
groups => ['infrasec'],
short_desc => 'Disable/Regenerate SSH Key',
product => $bug->product,
component => $bug->component,
+ bug_type => 'task',
bug_severity => 'critical',
cc => $bug->cc,
groups => [map { $_->{name} } @{$bug->groups}],
short_desc => '[SHIELD] Study Validation Review for ' . $params->{hypothesis},
product => 'Shield',
component => 'Shield Study',
+ bug_type => 'task',
bug_severity => 'normal',
op_sys => 'All',
rep_platform => 'All',
short_desc => '[SHIELD] Shipping Status for ' . $params->{hypothesis},
product => 'Shield',
component => 'Shield Study',
+ bug_type => 'task',
bug_severity => 'normal',
op_sys => 'All',
rep_platform => 'All',
short_desc => '[SHIELD] Data Review for ' . $params->{hypothesis},
product => 'Shield',
component => 'Shield Study',
+ bug_type => 'task',
bug_severity => 'normal',
op_sys => 'All',
rep_platform => 'All',
short_desc => '[SHIELD] Legal Review for ' . $params->{hypothesis},
product => 'Legal',
component => 'Firefox',
+ bug_type => 'task',
bug_severity => 'normal',
op_sys => 'All',
rep_platform => 'All',
<input type="hidden" name="rep_platform" value="All">
<input type="hidden" name="op_sys" value="Other">
<input type="hidden" name="version" value="unspecified">
+ <input type="hidden" name="bug_type" value="task">
<input type="hidden" name="bug_severity" id="bug_severity" value="normal">
<input type="hidden" name="token" value="[% token FILTER html %]">
<input type="hidden" name="assigned_to" value="jgriffin@mozilla.com">
<input type="hidden" name="rep_platform" value="unspecified">
<input type="hidden" name="op_sys" value="unspecified">
<input type="hidden" name="version" value="unspecified">
+ <input type="hidden" name="bug_type" value="task">
<input type="hidden" name="bug_severity" id="bug_severity" value="normal">
<input type="hidden" name="priority" id="priority" value="--">
<input type="hidden" name="target_milestone" id="target_milestone" value="---">
<input type="hidden" name="rep_platform" value="All">
<input type="hidden" name="op_sys" value="Other">
<input type="hidden" name="version" value="unspecified">
+ <input type="hidden" name="bug_type" value="task">
<input type="hidden" name="bug_severity" id="bug_severity" value="normal">
<input type="hidden" name="token" value="[% token FILTER html %]">
<input type="hidden" name="component" value="General">
<input type="hidden" name="rep_platform" value="All">
<input type="hidden" name="op_sys" value="Other">
+ <input type="hidden" name="bug_type" value="task">
<input type="hidden" name="priority" value="--">
<input type="hidden" name="version" value="unspecified">
<input type="hidden" name="bug_severity" id="bug_severity" value="normal">
<input type="hidden" name="rep_platform" value="All">
<input type="hidden" name="op_sys" value="Other">
<input type="hidden" name="version" value="unspecified">
+ <input type="hidden" name="bug_type" value="task">
<input type="hidden" name="bug_severity" id="bug_severity" value="normal">
<input type="hidden" name="cc" id="cc" value="">
<input type="hidden" name="status_whiteboard" id="status_whiteboard" value="">
<input type="hidden" name="rep_platform" value="All">
<input type="hidden" name="op_sys" value="Other">
<input type="hidden" name="version" value="unspecified">
+ <input type="hidden" name="bug_type" value="task">
<input type="hidden" name="priority" value="--">
<input type="hidden" name="bug_severity" value="normal">
<input type="hidden" name="format" value="crm">
<input type="hidden" name="component" value="General">
<input type="hidden" name="rep_platform" value="All">
<input type="hidden" name="op_sys" value="All">
+<input type="hidden" name="bug_type" value="task">
<input type="hidden" name="priority" value="--">
<input type="hidden" name="version" value="unspecified">
<input type="hidden" name="comment" id="comment" value="">
<input type="hidden" name="product" value="Finance">
<input type="hidden" name="rep_platform" value="All">
<input type="hidden" name="op_sys" value="Other">
+<input type="hidden" name="bug_type" value="task">
<input type="hidden" name="priority" value="--">
<input type="hidden" name="version" value="unspecified">
<input type="hidden" name="bug_severity" id="bug_severity" value="normal">
<input type="hidden" name="component" value="Budget Requests">
<input type="hidden" name="rep_platform" value="All">
<input type="hidden" name="op_sys" value="Other">
+ <input type="hidden" name="bug_type" value="task">
<input type="hidden" name="priority" value="--">
<input type="hidden" name="version" value="unspecified">
<input type="hidden" name="bug_severity" id="bug_severity" value="normal">
<input type="hidden" name="rep_platform" value="All">
<input type="hidden" name="op_sys" value="Other">
<input type="hidden" name="version" value="unspecified">
+ <input type="hidden" name="bug_type" value="task">
<input type="hidden" name="priority" value="--">
<input type="hidden" name="bug_severity" value="normal">
<input type="hidden" name="format" value="intern">
<input type="hidden" name="rep_platform" value="All">
<input type="hidden" name="op_sys" value="Other">
<input type="hidden" name="version" value="unspecified">
+ <input type="hidden" name="bug_type" value="task">
<input type="hidden" name="bug_severity" id="bug_severity" value="normal">
<input type="hidden" name="token" value="[% token FILTER html %]">
<input type="hidden" id="product" name="product" value="Infrastructure & Operations">
<input type="hidden" name="rep_platform" value="All">
<input type="hidden" name="op_sys" value="Other">
+ <input type="hidden" name="bug_type" value="task">
<input type="hidden" name="priority" value="--">
<input type="hidden" name="version" value="other">
<input type="hidden" name="token" value="[% token FILTER html %]">
<option value="normal">IT should get to it within the next week</option>
<option value="minor" selected="selected">No rush, but hopefully IT can get to it soon</option>
<option value="trivial">Whenever IT can get around to it</option>
- <option value="enhancement">This is just an idea, filing it so we don't forget</option>
</select>
</td>
<td>
<input type="hidden" name="rep_platform" value="All">
<input type="hidden" name="op_sys" value="Other">
<input type="hidden" name="version" value="unspecified">
+ <input type="hidden" name="bug_type" value="task">
<input type="hidden" name="priority" value="--">
<input type="hidden" name="bug_severity" value="normal">
<input type="hidden" name="format" value="legal">
}
var whiteboard = Dom.get('status_whiteboard');
whiteboard.value = "[specification][type:" + request_type.toLowerCase() + "]";
- if (request_type == 'feature') {
- Dom.get('bug_severity').value = 'enhancement';
- }
+ document.querySelector('[name="bug_type"]').value = request_type == 'bug' ? 'defect' : 'enhancement';
return true;
},
_getRadioValueByClass: function(class_name) {
<input type="hidden" name="rep_platform" value="All">
<input type="hidden" name="op_sys" value="Other">
<input type="hidden" name="version" value="unspecified">
- <input type="hidden" name="bug_severity" id="bug_severity" value="normal">
+ <input type="hidden" name="bug_type" value="task">
+ <input type="hidden" name="bug_severity" value="normal">
<input type="hidden" name="token" value="[% token FILTER html %]">
<input type="hidden" name="status_whiteboard" id="status_whiteboard" value="">
<input type="hidden" name="version" value="unspecified">
<input type="hidden" name="bug_status" value="UNCONFIRMED">
<input type="hidden" name="rep_platform" value="Other">
+ <input type="hidden" name="bug_type" value="defect">
<input type="hidden" name="bug_severity" value="normal">
<input type="hidden" name="status_whiteboard" value="[mobile-compat-form]">
<input type="hidden" name="user_agent" value="[% cgi.user_agent() FILTER html %]">
<input type="hidden" id="product" name="product" value="mozilla.org">
<input type="hidden" id="rep_platform" name="rep_platform" value="All">
<input type="hidden" id="op_sys" name="op_sys" value="Other">
+ <input type="hidden" id="bug_type" name="bug_type" value="task">
<input type="hidden" id="priority" name="priority" value="--">
<input type="hidden" id="version" name="version" value="other">
<input type="hidden" id="short_desc" name="short_desc" value="">
<input type="hidden" name="rep_platform" value="All">
<input type="hidden" name="op_sys" value="Other">
<input type="hidden" name="version" value="unspecified">
+<input type="hidden" name="bug_type" value="task">
<input type="hidden" name="bug_severity" value="normal">
<input type="hidden" name="group" value="pr-private">
<input type="hidden" name="assigned_to" id="assigned_to" value="nobody@mozilla.org">
<input type="hidden" name="rep_platform" value="All">
<input type="hidden" name="op_sys" value="Other">
<input type="hidden" name="version" value="unspecified">
+ <input type="hidden" name="bug_type" value="task">
<input type="hidden" name="priority" value="--">
<input type="hidden" name="bug_severity" value="normal">
<input type="hidden" name="format" value="name-clearance">
<input type="hidden" name="rep_platform" value="All">
<input type="hidden" name="op_sys" value="Other">
<input type="hidden" name="version" value="unspecified">
+ <input type="hidden" name="bug_type" value="task">
<input type="hidden" name="priority" value="--">
<input type="hidden" name="bug_severity" value="normal">
<input type="hidden" name="format" value="nda">
<input type="hidden" name="op_sys" value="All">
<input type="hidden" name="priority" value="--">
<input type="hidden" name="version" value="other">
+ <input type="hidden" name="bug_type" value="task">
<input type="hidden" name="bug_severity" value="normal">
<input type="hidden" name="groups" value="mozilla-employee-confidential">
<input type="hidden" name="groups" value="infra">
<input type="hidden" name="rep_platform" value="All">
<input type="hidden" name="op_sys" value="Other">
<input type="hidden" name="version" value="unspecified">
+ <input type="hidden" name="bug_type" value="task">
<input type="hidden" name="priority" value="--">
<input type="hidden" name="bug_severity" value="normal">
<input type="hidden" name="format" value="recruiting">
<input type="hidden" name="rep_platform" value="All">
<input type="hidden" name="op_sys" value="Other">
<input type="hidden" name="version" value="Trunk">
+ <input type="hidden" name="bug_type" value="task">
<input type="hidden" name="bug_severity" id="bug_severity" value="normal">
<input type="hidden" name="priority" value="--">
<input type="hidden" name="short_desc" id="short_desc" value="">
<input type="hidden" name="component" value="Swag Requests">
<input type="hidden" name="rep_platform" value="All">
<input type="hidden" name="op_sys" value="Other">
+ <input type="hidden" name="bug_type" value="task">
<input type="hidden" name="priority" value="--">
<input type="hidden" name="version" value="unspecified">
<input type="hidden" name="bug_severity" id="bug_severity" value="normal">
<input type="hidden" name="product" value="Marketing">
<input type="hidden" name="component" value="Trademark Permissions">
- <input type="hidden" name="bug_severity" value="enhancement">
+ <input type="hidden" name="bug_type" value="task">
+ <input type="hidden" name="bug_severity" value="normal">
<input type="hidden" name="rep_platform" value="All">
<input type="hidden" name="priority" value="P3">
<input type="hidden" name="op_sys" value="Other">
<input type="hidden" name="rep_platform" value="All">
<input type="hidden" name="op_sys" value="Other">
<input type="hidden" name="version" value="unspecified">
+ <input type="hidden" name="bug_type" value="task">
<input type="hidden" name="bug_severity" id="bug_severity" value="normal">
<input type="hidden" name="token" value="[% token FILTER html %]">
<input type="hidden" name="rep_platform" value="All">
<input type="hidden" name="op_sys" value="All">
<input type="hidden" name="version" value="unspecified">
+ <input type="hidden" name="bug_type" value="task">
<input type="hidden" name="bug_severity" id="bug_severity" value="normal">
<input type="hidden" name="priority" id="priority" value="--">
<input type="hidden" name="target_milestone" id="target_milestone" value="---">
[% USE Bugzilla %]
[% IF Bugzilla.request_cache.bmo_fields_page %]
[%
+ vars.help_html.bug_type =
+ "This field describes the type of ${terms.abug}.
+ <table>
+ <tr>
+ <th>defect</th>
+ <td>regression, crash, hang, security vulnerability and any other general issue</td>
+ </tr>
+ <tr>
+ <th>enhancement</th>
+ <td>new feature, improvement in UI, performance, etc. and any other request for enhancement</td>
+ </tr>
+ <tr>
+ <th>task</th>
+ <td>refactoring, removal, replacement, enabling or disabling of functionality and any other task</td>
+ </tr>
+ </table>"
+
vars.help_html.priority =
"This field describes the importance and order in which $terms.abug
should be fixed compared to other ${terms.bugs}. This field is utilized
<td>cosmetic problem like misspelled words or misaligned
text</td>
</tr>
- <tr>
- <th>enhancement</th>
- <td>Request for enhancement</td>
</table>"
vars.help_html.rep_platform =
the <a href="[% basepath FILTER none %]page.cgi?id=triage_request.html">triage request form</a>.
</p>
-[% editbugs = basepath _ "enter_bug.cgi?assigned_to=nobody%40mozilla.org&bug_file_loc=http%3A%2F%2F&bug_ignored=0&bug_severity=normal&bug_status=NEW&cf_fx_iteration=---&cf_fx_points=---&component=Editbugs%20Requests&contenttypemethod=autodetect&contenttypeselection=text%2Fplain&defined_groups=1&flag_type-4=X&flag_type-607=X&flag_type-791=X&flag_type-800=X&flag_type-803=X&flag_type-916=X&form_name=enter_bug&maketemplate=Remember%20values%20as%20bookmarkable%20template&op_sys=Unspecified&priority=--&product=bugzilla.mozilla.org&rep_platform=Unspecified&target_milestone=---&version=Production" %]
+[% editbugs = basepath _ "enter_bug.cgi?assigned_to=nobody%40mozilla.org&bug_file_loc=http%3A%2F%2F&bug_ignored=0&bug_type=task&bug_severity=normal&bug_status=NEW&cf_fx_iteration=---&cf_fx_points=---&component=Editbugs%20Requests&contenttypemethod=autodetect&contenttypeselection=text%2Fplain&defined_groups=1&flag_type-4=X&flag_type-607=X&flag_type-791=X&flag_type-800=X&flag_type-803=X&flag_type-916=X&form_name=enter_bug&maketemplate=Remember%20values%20as%20bookmarkable%20template&op_sys=Unspecified&priority=--&product=bugzilla.mozilla.org&rep_platform=Unspecified&target_milestone=---&version=Production" %]
<p>
If you want <kbd>editbugs</kbd>, open a
return {
products => _name($user->get_enterable_products),
keywords => _name([Bugzilla::Keyword->get_all()]),
+ default_bug_types => get_legal_field_values('bug_type'),
};
}
my $product
= Bugzilla::Product->check({name => $params->{product_name}, cache => 1});
$product = Bugzilla->user->can_enter_product($product, 1);
- my @components = map { {name => $_->name, description => $_->description,} }
- @{$product->components};
+ my @components = map { {
+ name => $_->name,
+ description => $_->description,
+ default_bug_type => $_->default_bug_type,
+ } } @{$product->components};
return {components => \@components, versions => _name($product->versions),};
}
$options{bug_severity} = _name('bug_severity', $bug->bug_severity);
$options{rep_platform} = _name('rep_platform', $bug->rep_platform);
$options{op_sys} = _name('op_sys', $bug->op_sys);
+ $options{bug_type} = _name('bug_type', $bug->bug_type);
# custom select fields
my @custom_fields = grep {
no_label = 1
hide_on_edit = 1
%]
+ [% IF bug.bug_type %]
+ <span class="bug-type-label iconic-text" data-type="[% bug.bug_type FILTER html %]">
+ <span class="icon" aria-hidden="true"></span>
+ [%~ bug.bug_type FILTER html ~%]
+ </span>
+ [% END %]
<b class="bz_status_[% bug.bug_status FILTER html %]">
[% bug.bug_status FILTER html %]
[%+ bug.resolution FILTER html IF bug.resolution %]
</div>
[% END %]
+ [%# type %]
+ [% WRAPPER bug_modal/field.html.tmpl
+ field = bug_fields.bug_type
+ field_type = constants.FIELD_TYPE_SINGLE_SELECT
+ hide_on_view = 1 # Because it's displayed on the header
+ help = "https://wiki.mozilla.org/BMO/UserGuide/BugFields#bug_type"
+ %]
+ [% bug.bug_type FILTER html %]
+ [% END %]
+
[%# importance %]
[% WRAPPER bug_modal/field.html.tmpl
label = "Importance"
#field-status_summary {
border-top: 1px dotted silver;
- padding-top: 4px;
+ padding-top: 6px;
+ padding-bottom: 4px;
}
#status-assignee, #status-assignee .vcard, #status-needinfo, #status-needinfo .vcard {
display: inline;
}
+#field-status_summary .bug-type-label {
+ margin-right: 8px;
+}
+
#status-assignee, #status-needinfo {
margin-left: 8px;
}
var initial = {}
var comp_desc = {}
+var comp_default_bug_type = {}
var product_name = '';
var component_load = function(product) {
callback(data.components)
});
- for (var i in data.components)
- comp_desc[data.components[i]["name"]] = data.components[i]["description"];
+ for (const comp of data.components) {
+ comp_desc[comp.name] = comp.description;
+ comp_default_bug_type[comp.name] = comp.default_bug_type;
+ }
selectize = $("#version")[0].selectize;
selectize.clear();
callback(initial.products);
}
});
+
+ $("#bug_type").selectize({
+ valueField: 'value',
+ labelField: 'label',
+ placeholder: 'Type',
+ searchField: 'value',
+ options: initial.default_bug_types.map(type => ({ label: type, value: type })),
+ preload: true,
+ create: false,
+ });
},
function() {
alert("Network issues. Please refresh the page and try again");
});
component_sel.on("change", function () {
- var selectize = $("#component")[0].selectize;
- $('#comp_desc').text(comp_desc[selectize.getValue()]);
+ const name = $("#component")[0].selectize.getValue();
+ $('#comp_desc').text(comp_desc[name]);
+ $("#bug_type")[0].selectize.setValue(comp_default_bug_type[name]);
});
$('.create-btn')
# Pass a bunch of Bugzilla configuration to the templates.
my $vars = {};
+ $vars->{'type'} = get_legal_field_values('bug_type');
$vars->{'priority'} = get_legal_field_values('priority');
$vars->{'severity'} = get_legal_field_values('bug_severity');
$vars->{'platform'} = get_legal_field_values('rep_platform');
'rep_platform' => 'platform',
'bug_severity' => 'severity',
'bug_status' => 'status',
+ 'bug_type' => 'type',
'short_desc' => 'summary',
'short_short_desc' => 'summary',
'bug_file_loc' => 'url',
);
use constant DEFAULT_VALUE_MAP => {
+ type_id => 'default_bug_type',
op_sys => 'defaultopsys',
rep_platform => 'defaultplatform',
priority => 'defaultpriority',
<form method="post" action="[% basepath FILTER none %]post_bug.cgi" enctype="multipart/form-data" onsubmit="return bugForm.validate()">
<input type="hidden" name="token" value="[% token FILTER html %]">
+<input type="hidden" name="bug_type" value="defect">
<input type="hidden" name="product" id="product" value="">
<input type="hidden" name="component" id="component" value="">
<input type="hidden" name="bug_severity" value="normal">
. $params->{other_party},
product => 'Enterprise Information Security',
component => 'Rapid Risk Analysis',
+ bug_type => 'task',
bug_severity => 'normal',
groups => ['mozilla-employee-confidential'],
op_sys => 'All',
. $params->{other_party},
product => 'Finance',
component => 'Purchase Request Form',
+ bug_type => 'task',
bug_severity => 'normal',
priority => '--',
groups => ['finance'],
</p>
<form method="post" action="[% basepath FILTER none %]post_bug.cgi" id="mozProjectForm" enctype="multipart/form-data">
+ <input type="hidden" id="bug_type" name="bug_type" value="task">
<input type="hidden" id="product" name="product" value="Legal">
<input type="hidden" id="component" name="component" value="General">
<input type="hidden" id="rep_platform" name="rep_platform" value="All">
status => $self->_status($status),
summary => _string($bug->short_desc),
target_milestone => $self->_milestone($milestone),
+ type => _string($bug->bug_type),
url => _string($bug->bug_file_loc),
version => $self->_version($version),
whiteboard => _string($bug->status_whiteboard),
<h1>Community IT Discourse Request</h1>
<form method="post" action="[% basepath FILTER none %]post_bug.cgi" id="tmRequestForm" name="f">
+ <input type="hidden" name="bug_type" value="task">
<input type="hidden" name="product" value="Infrastructure & Operations">
<input type="hidden" name="component" value="Community IT: Discourse">
<input type="hidden" name="bug_severity" value="normal">
</p>
<form method="post" action="[% basepath FILTER none %]post_bug.cgi" id="tmRequestForm">
+ <input type="hidden" name="bug_type" value="task">
<input type="hidden" name="product" value="Mozilla Reps">
<input type="hidden" name="component" value="Mentorship">
<input type="hidden" name="bug_severity" value="normal">
<input type="hidden" name="format" value="remo-budget">
<input type="hidden" name="created-format" value="remo-budget">
+ <input type="hidden" name="bug_type" value="task">
<input type="hidden" name="product" value="Mozilla Reps">
<input type="hidden" name="component" value="Budget Requests">
<input type="hidden" name="rep_platform" value="All">
onSubmit="return validateAndSubmit();">
<input type="hidden" name="format" value="remo-swag">
+ <input type="hidden" name="bug_type" value="task">
<input type="hidden" name="product" value="Mozilla Reps">
<input type="hidden" name="component" value="Swag Requests">
<input type="hidden" name="rep_platform" value="All">
push(@query, "target_milestone");
}
- # For priority, severity, opsys and platform we check that the one being
+ # For type, priority, severity, opsys and platform we check that the one being
# imported is valid. If it is not we use the defaults set in the parameters.
+ if (defined($bug_fields{'bug_type'})
+ && check_field('bug_type', scalar $bug_fields{'bug_type'}, undef, ERR_LEVEL))
+ {
+ push(@values, $bug_fields{'bug_type'});
+ }
+ else {
+ push(@values, $params->{'default_bug_type'});
+ $err .= "Unknown type ";
+ $err .= (defined $bug_fields{'bug_type'}) ? $bug_fields{'bug_type'} : "unknown";
+ $err .= ". Setting to default type \"" . $params->{'default_bug_type'} . "\".\n";
+ }
+ push(@query, "bug_type");
+
if (
defined($bug_fields{'bug_severity'})
&& check_field(
short_desc => scalar($cgi->param('short_desc')),
product => scalar($cgi->param('product')),
component => scalar($cgi->param('component')),
+ bug_type => scalar($cgi->param('bug_type')),
bug_severity => 'normal',
groups => \@groups,
op_sys => 'Unspecified',
bug_file_loc
bug_severity
bug_status
+ bug_type
dependson
keywords
short_desc
# Component, target_milestone, and version are in here just in case
# the 'product' field wasn't defined in the CGI. It doesn't hurt to set
# them twice.
-my @set_fields = qw(op_sys rep_platform priority bug_severity
+my @set_fields = qw(op_sys rep_platform priority bug_severity bug_type
component target_milestone version
bug_file_loc status_whiteboard short_desc
deadline remaining_time estimated_time
push(@set_fields, 'assigned_to') if !$cgi->param('set_default_assignee');
push(@set_fields, 'qa_contact') if !$cgi->param('set_default_qa_contact');
my %field_translation = (
+ bug_type => 'type',
bug_severity => 'severity',
rep_platform => 'platform',
short_desc => 'summary',
Bugzilla->set_user($admin_user);
my %field_values = (
+ 'bug_type' => 'defect',
'priority' => 'Highest',
'bug_status' => 'CONFIRMED',
'version' => 'unspecified',
go_to_bug($sel, $bug1_id);
# Severity change (bugmail to normal user but not admin)
+$sel->select_ok("bug_type", "label=defect");
+$sel->selected_label_is("bug_type", "defect");
$sel->select_ok("bug_severity", "label=blocker");
$sel->selected_label_is("bug_severity", "blocker");
$sel->click_ok("commit");
go_to_bug($sel, $bug1_id);
# Severity change (bugmail to normal user but not admin)
+$sel->select_ok("bug_type", "label=defect");
+$sel->selected_label_is("bug_type", "defect");
$sel->select_ok("bug_severity", "label=trivial");
$sel->selected_label_is("bug_severity", "trivial");
$sel->click_ok("commit");
go_to_bug($sel, $bug1_id);
# Severity change (bugmail to both admin and normal user)
+$sel->select_ok("bug_type", "label=defect");
+$sel->selected_label_is("bug_type", "defect");
$sel->select_ok("bug_severity", "label=normal");
$sel->selected_label_is("bug_severity", "normal");
$sel->click_ok("commit");
log_in($sel, $config, 'QA_Selenium_TEST');
file_bug_in_product($sel, 'TestProduct');
+$sel->select_ok("bug_type", "label=defect");
$sel->select_ok("bug_severity", "label=critical");
$sel->type_ok("short_desc", "Test bug editing");
$sel->type_ok("comment", "ploc");
$sel->select_ok("rep_platform", "label=Other");
$sel->select_ok("op_sys", "label=Other");
$sel->select_ok("priority", "label=Highest");
+$sel->select_ok("bug_type", "label=defect");
$sel->select_ok("bug_severity", "label=blocker");
$sel->type_ok("bug_file_loc", "foo.cgi?action=bar");
$sel->type_ok("status_whiteboard", "[Selenium was here]");
check_page_load($sel, WAIT_TIME,
qq{http://HOSTNAME:8000/show_bug.cgi?id=$bug1_id});
$sel->title_like(qr/^$bug1_id /);
+$sel->select_ok("bug_type", "label=defect");
$sel->select_ok("bug_severity", "label=normal");
$sel->select_ok("priority", "label=High");
$sel->select_ok("rep_platform", "label=All");
log_in($sel, $config, 'admin');
go_to_bug($sel, $bug1_id);
+$sel->select_ok("bug_type", "label=defect");
$sel->select_ok("bug_severity", "label=blocker");
$sel->select_ok("priority", "label=Highest");
$sel->type_ok("status_whiteboard", "[Selenium was here][admin too]");
"I have no privs, I can only comment (and remove people from the CC list)");
ok(!$sel->is_element_present('//select[@name="product"]'),
"Product field not editable");
+ok(!$sel->is_element_present('//select[@name="bug_type"]'),
+ "Type field not editable");
ok(!$sel->is_element_present('//select[@name="bug_severity"]'),
"Severity field not editable");
ok(!$sel->is_element_present('//select[@name="priority"]'),
log_in($sel, $config, 'QA_Selenium_TEST');
file_bug_in_product($sel, 'TestProduct');
+$sel->select_ok("bug_type", "label=defect");
$sel->select_ok("bug_severity", "label=blocker");
$sel->type_ok("short_desc", "New bug from me");
use QA::Util;
my ($config, @clients) = get_rpc_clients();
-plan tests => ($config->{test_extensions} ? 1374 : 1356);
+plan tests => ($config->{test_extensions} ? 1416 : 1398);
use constant INVALID_FIELD_NAME => 'invalid_field';
use constant INVALID_FIELD_ID => -1;
}
use constant STANDARD_SELECT_FIELDS =>
- qw(bug_severity bug_status op_sys priority rep_platform resolution);
+ qw(bug_type bug_severity bug_status op_sys priority rep_platform resolution);
use constant ALL_SELECT_FIELDS =>
(STANDARD_SELECT_FIELDS, qw(cf_qa_status cf_single_select));
use strict;
use warnings;
use lib qw(lib ../../lib ../../local/lib/perl5);
-use Test::More tests => 269;
+use Test::More tests => 275;
use QA::Util;
my ($config, @clients) = get_rpc_clients();
use constant INVALID_PRODUCT_ID => -1;
use constant INVALID_FIELD_NAME => 'invalid_field';
use constant GLOBAL_FIELDS =>
- qw(bug_severity bug_status op_sys priority rep_platform resolution
+ qw(bug_type bug_severity bug_status op_sys priority rep_platform resolution
cf_qa_status cf_single_select);
use constant PRODUCT_FIELDS => qw(version target_milestone component);
}
@chfields = (sort(@chfields));
$vars->{'chfield'} = \@chfields;
+$vars->{'bug_type'} = Bugzilla::Field->new({name => 'bug_type'})->legal_values;
$vars->{'bug_status'}
= Bugzilla::Field->new({name => 'bug_status'})->legal_values;
$vars->{'rep_platform'}
attachments.ispatch,
bugs.bug_status,
bugs.priority,
- bugs.bug_severity " .
+ bugs.bug_severity,
+ bugs.bug_type " .
# Use the flags and flagtypes tables for information about the flags,
# the bugs and attachments tables for target info, the profiles tables
'bug_status' => $data->[17],
'priority' => $data->[18],
'bug_severity' => $data->[19],
+ 'bug_type' => $data->[20],
};
push(@requests, $request);
}
["flaginclusions", "component_id", "type_id"]
);
+CrossCheck("bug_type", "value", ["bugs", "bug_type", "bug_id"]);
+
# Check the former enum types -mkanat@bugzilla.org
CrossCheck("bug_status", "value", ["bugs", "bug_status", "bug_id"]);
$answer{'webdotbase'} = '/usr/bin/dot';
$answer{'auth_delegation'} = 1;
$answer{'insidergroup'} = 'admin';
+$answer{'default_bug_type'} = 'defect';
$answer{'defaultpriority'} = '--';
$answer{'defaultseverity'} = 'normal';
$answer{'maxattachmentsize'} = 4095;
confirmuniqueusermatch => 0,
maxusermatches => '100',
debug_group => 'editbugs',
+ default_bug_type => 'defect',
defaultpriority => '--', # FIXME: add priority
defaultquery => 'resolution=---&emailassigned_to1=1&emailassigned_to2=1'
. '&emailreporter2=1&emailqa_contact2=1&emailtype1=exact'
Bugzilla::Bug->create({
product => 'Firefox',
component => 'General',
+ bug_type => 'defect',
priority => '--',
bug_status => 'NEW',
version => 'unspecified',
],
bugs => [
qw(
- bug_id assigned_to bug_file_loc bug_severity bug_status
+ bug_id assigned_to bug_file_loc bug_severity bug_status bug_type
creation_ts delta_ts short_desc op_sys priority product_id
rep_platform reporter version component_id resolution
target_milestone qa_contact status_whiteboard everconfirmed
/* Style bug rows according to severity. */
.bz_blocker { color: red; font-weight: bold; }
.bz_critical { color: red; }
-.bz_enhancement { color: #666; background-color: white; }
/* Align columns in the "change multiple bugs" form to the right. */
table#form tr th { text-align: right; }
-table.bz_buglist td, table.bz_buglist th {
-}
-
/* we use a first-child class and not the pseudo-class because IE
* doesn't support it :-( */
tr.bz_secure td.first-child, a.bz_secure {
background-color: inherit;
}
+th, td {
+ padding: 6px 4px;
+}
+
th.first-child, td.first-child, a.bz_secure {
padding-left: 20px;
}
tr.bz_secure_mode_manual td.first-child {
}
+td.bz_bug_type_column {
+ padding: 4px;
+ width: 1em;
+ text-align: center;
+}
+
td.bz_estimated_time_column,
td.bz_remaining_time_column,
td.bz_actual_time_column,
.markdown-body hr {
border-bottom-color: #eee;
}
+
+/* Bug types */
+
+:root {
+ --bug-type-color-defect: #D62935;
+ --bug-type-color-enhancement: #2BC028;
+ --bug-type-color-task: #2886C9;
+}
+
+.bug-type-label .icon {
+ font-family: 'Material Icons';
+ line-height: 100%;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.bug-type-label[data-type="defect"] .icon::before {
+ content: '\E85F';
+ color: var(--bug-type-color-defect);
+}
+
+.bug-type-label[data-type="enhancement"] .icon::before {
+ content: '\E862';
+ color: var(--bug-type-color-enhancement);
+}
+
+.bug-type-label[data-type="task"] .icon::before {
+ content: '\E85D';
+ color: var(--bug-type-color-task);
+}
+
+.bug-type-label.iconic .icon {
+ font-size: 18px;
+ vertical-align: middle;
+}
+
+.bug-type-label.iconic-text {
+ border-radius: .2em;
+ padding: .2em .4em .2em .2em;
+ color: #FFF;
+ background-color: #666;
+ line-height: 16px;
+ font-weight: 600;
+}
+
+.bug-type-label.iconic-text[data-type="defect"] {
+ background-color: var(--bug-type-color-defect);
+}
+
+.bug-type-label.iconic-text[data-type="enhancement"] {
+ background-color: var(--bug-type-color-enhancement);
+}
+
+.bug-type-label.iconic-text[data-type="task"] {
+ background-color: var(--bug-type-color-task);
+}
+
+.bug-type-label.iconic-text .icon {
+ margin-right: .2em;
+ font-size: 16px;
+ vertical-align: bottom;
+}
+
+.bug-type-label.iconic-text .icon::before {
+ color: #FFF !important;
+ vertical-align: bottom;
+}
product => 'Firefox',
component => 'General',
,
+ bug_type => 'defect',
bug_severity => 'normal',
groups => [],
op_sys => 'Unspecified',
product => 'Firefox',
component => 'General',
,
+ bug_type => 'defect',
bug_severity => 'normal',
groups => [],
op_sys => 'Unspecified',
%]
</td>
</tr>
+<tr>
+ <th class="field_label"><label for="default_bug_type">Default [% terms.Bug %] Type:</label></th>
+ <td>
+ [% INCLUDE default_select
+ field_name = 'default_bug_type'
+ field_value = comp.default_bug_type
+ field_values = bug_fields.bug_type.legal_values
+ %]
+ </td>
+</tr>
<tr>
<th class="field_label"><label for="initialowner">Default Assignee:</label></th>
<td>
</tr>
[% Hook.process('rows') %]
+
+[% BLOCK default_select %]
+ <select name="[% field_name FILTER html %]">
+ [% FOREACH v IN field_values %]
+ <option value="[% v.value FILTER html %]" [% " selected" IF field_value == v.value %]>
+ [% v.value FILTER html %]
+ </option>
+ [% END %]
+ </select>
+[% END %]
heading => "Description"
allow_html_content => 1
},
+ {
+ name => "default_bug_type"
+ heading => "Default $terms.Bug Type"
+ },
{
name => "initialowner"
heading => "Default Assignee"
"$terms.Bugzilla will then use the operating system that the browser " _
"reports to be running on as the default.",
+ default_bug_type => "This is the type that newly entered $terms.bugs are set to.",
+
collapsed_comment_tags => "A comma separated list of tags which, when applied " _
"to comments, will cause them to be collapsed by default",
}
[% FOREACH item = param.choices %]
<option value="[% item FILTER html %]"
[% " selected=\"selected\"" IF item == Param(param.name) %]>
- [% IF param.name == "defaultseverity" %]
+ [% IF param.name == "default_bug_type" %]
+ [% display_value("bug_type", item) FILTER html %]
+ [% ELSIF param.name == "defaultseverity" %]
[% display_value("bug_severity", item) FILTER html %]
[% ELSIF param.name == "defaultplatform" %]
[% display_value("rep_platform", item) FILTER html %]
Trivial: A cosmetic problem, such as a misspelled word or
misaligned text.
</option>
- <option name="enhancement" value="enhancement">
- Enhancement: Request for new feature or enhancement.
- </option>
</select>
<p>
Say how serious the problem is, or if your [% terms.bug %] is a
var initialowners = new Array([% product.components.size %]);
var last_initialowner;
+var default_bug_types = new Array([% product.components.size %]);
var initialccs = new Array([% product.components.size %]);
var components = new Array([% product.components.size %]);
var comp_desc = new Array([% product.components.size %]);
components[[% count %]] = "[% c.name FILTER js %]";
comp_desc[[% count %]] = "[% c.description FILTER html_light FILTER js %]";
initialowners[[% count %]] = "[% c.default_assignee.login FILTER js %]";
+ default_bug_types[[% count %]] = "[% c.default_bug_type FILTER js %]";
[% flag_list = [] %]
[% FOREACH f = c.flag_types.bug %]
[% flag_list.push(f.id) %]
last_initialowner = owner;
}
+ form.bug_type.value = default_bug_types[index];
document.getElementById('initial_cc').innerHTML = initialccs[index];
document.getElementById('comp_desc').innerHTML = comp_desc[index];
<tr>
[% INCLUDE "bug/field-label.html.tmpl"
- field = bug_fields.version editable = 1 rowspan = 3
+ field = bug_fields.version editable = 1 rowspan = 4
%]
- <td rowspan="3">
+ <td rowspan="4">
<select name="version" id="version" size="5">
[%- FOREACH v = version %]
[% NEXT IF NOT v.is_active %]
</select>
</td>
+ [% INCLUDE bug/field.html.tmpl
+ bug = default, field = bug_fields.bug_type, editable = 1,
+ value = default.bug_type %]
+ </tr>
+
+ <tr>
[% INCLUDE bug/field.html.tmpl
bug = default, field = bug_fields.bug_severity, editable = 1,
value = default.bug_severity %]
[%###############################################################%]
[%# Importance (priority and severity) #%]
[%###############################################################%]
+ <tr>
+ <th class="field_label">
+ <label for="type" accesskey="t">
+ <a href="https://wiki.mozilla.org/BMO/UserGuide/BugFields#bug_type"><u>T</u>ype</a></label>
+ </th>
+ <td>
+ [% INCLUDE bug/field.html.tmpl
+ bug = bug, field = bug_fields.bug_type,
+ no_tds = 1, value = bug.bug_type
+ editable = bug.check_can_change_field('bug_type', 0, 1) %]
+ </td>
+ </tr>
+
<tr>
<th class="field_label">
<label for="priority" accesskey="i">
_ " of ${terms.Bugzilla}.",
bug_severity =>
- "How severe the $terms.bug is, or whether it's an enhancement.",
+ "How severe the $terms.bug is.",
bug_status =>
"$terms.Abug may be in any of a number of states.",
+bug_type =>
+ "The basic category of the ${terms.bug}."
+
cc =>
"Users who may not have a direct role to play on this $terms.bug, but who
are interested in its progress.",
edit_only = 1
editable = 1
%]
+
+ [% INCLUDE bug_modal/field.html.tmpl
+ field = bug_fields.bug_type
+ field_type = constants.FIELD_TYPE_SINGLE_SELECT
+ help = "https://wiki.mozilla.org/BMO/UserGuide/BugFields#bug_type"
+ edit_only = 1
+ editable = 1
+ %]
[% END %]
[% WRAPPER bug_modal/module.html.tmpl title = "Tracking" %]
[%# keywords %]
[% PROCESS rightcell %]
</tr>
+ [% PROCESS row cell = "bug_type" %]
+
<tr>
<th>[% field_descs.bug_severity FILTER html %]:</th>
<td class="bz_[% bug.bug_severity FILTER css_class_quote -%]">
[% IF attach_id %]
X-Bugzilla-Attach-ID: [% attach_id %]
[% END %]
+X-Bugzilla-Bug-Type: [% bug.bug_type %]
X-Bugzilla-Product: [% bug.product %]
X-Bugzilla-Component: [% bug.component %]
X-Bugzilla-Version: [% bug.version %]
"bug_id" => "$terms->{Bug} ID",
"bug_severity" => "Severity",
"bug_status" => "Status",
+ "bug_type" => "Type",
"changeddate" => "Changed",
"cc" => "CC",
"classification" => "Classification",
[% IF changes.description.defined %]
<li>Description updated to '[% comp.description FILTER html_light %]'</li>
[% END %]
+ [% IF changes.default_bug_type.defined %]
+ <li>Default [% terms.bug %] type updated to '[% comp.default_bug_type FILTER html %]'</li>
+ [% END %]
[% IF changes.initialowner.defined %]
<li>Default assignee updated to '[% comp.default_assignee.login FILTER html %]'</li>
[% END %]
<tr>
<th><label for="bug_status">Status:</label></th>
- <td colspan="3">[% PROCESS status_section %]</td>
+ <td>[% PROCESS status_section %]</td>
+
+ <th>
+ <label for="bug_type">
+ <a href="https://wiki.mozilla.org/BMO/UserGuide/BugFields#bug_type">Type</a>:
+ </label>
+ </th>
+ <td>
+ [% PROCESS selectmenu menuname = "bug_type"
+ menuitems = types %]
+ </td>
</tr>
[% IF user.is_timetracker %]
<tr>
</tr><tr class="bz_feed_resolution">
<td>[% columns.resolution.title FILTER html %] </td>
<td>[% display_value("resolution", bug.resolution) FILTER html %]</td>
+ </tr><tr class="bz_feed_type">
+ <td>[% columns.bug_type.title FILTER html %]</td>
+ <td>[% display_value("bug_type", bug.bug_type) FILTER html %]</td>
</tr><tr class="bz_feed_priority">
<td>[% columns.priority.title FILTER html %]</td>
<td>[% display_value("priority", bug.priority) FILTER html %]</td>
[%# Setting maxlength => 0 means no limit. We set it for performance reasons. %]
[% abbrev =
{
+ "bug_type" => { maxlength => 0 } ,
"bug_severity" => { maxlength => 3 , title => "Sev" } ,
"priority" => { maxlength => 7 , title => "Pri" } ,
"rep_platform" => { maxlength => 3 , title => "Plt" } ,
[% count = loop.count() %]
<tr id="b[% bug.bug_id %]" class="bz_bugitem
+ bz_[% bug.bug_type FILTER css_class_quote -%]
bz_[% bug.bug_severity FILTER css_class_quote -%]
bz_[% bug.priority FILTER css_class_quote -%]
bz_[% bug.bug_status FILTER css_class_quote -%]
[% END %]
[% IF col_abbrev.format_value %]
[%- bug.$column FILTER format(col_abbrev.format_value) FILTER html -%]
+ [% ELSIF column == 'bug_type' %]
+ <span class="bug-type-label iconic" title="[% bug.bug_type FILTER html %]"
+ aria-label="[% bug.bug_type FILTER html %]" data-type="[% bug.bug_type FILTER html %]">
+ <span class="icon" aria-hidden="true"></span>
+ </span>
[% ELSIF column == 'actual_time' ||
column == 'remaining_time' ||
column == 'estimated_time' %]
bug_file_loc?,
status_whiteboard?,
keywords*,
+ bug_type,
priority,
bug_severity,
target_milestone?,
>
<!ELEMENT bug_id (#PCDATA)>
<!ELEMENT alias (#PCDATA)>
+<!ELEMENT bug_type (#PCDATA)>
<!ELEMENT reporter_accessible (#PCDATA)>
<!ELEMENT cclist_accessible (#PCDATA)>
<!ELEMENT exporter (#PCDATA)>
{ name => "delta",
description => "Change in last<br>$changedsince day(s)" },
{ name => "component", description => field_descs.component },
+ { name => "bug_type", description => field_descs.bug_type },
{ name => "bug_severity", description => field_descs.bug_severity },
{ name => "op_sys", description => field_descs.op_sys },
{ name => "target_milestone", description => field_descs.target_milestone },
<td class="count">[% item.count FILTER html %]</td>
<td class="delta">[% item.delta FILTER html %]</td>
<td class="component">[% bug.component FILTER html %]</td>
+ <td class="bug_type">
+ [%- display_value('bug_type', bug.bug_type) FILTER html %]
+ </td>
<td class="bug_severity">
[%- display_value('bug_severity', bug.bug_severity) FILTER html %]
</td>
<tr class="bz_bugitem bz_[% request.bug_severity FILTER css_class_quote -%]
bz_[% request.priority FILTER css_class_quote -%]
+ bz_[% request.bug_type FILTER css_class_quote -%]
bz_[% request.bug_status FILTER css_class_quote %]">
[% FOREACH column = display_columns %]
[% NEXT IF column == group_field || excluded_columns.contains(column) %]
[% BLOCK display_bug %]
<a href="[% basepath FILTER none %]show_bug.cgi?id=[% request.bug_id %]"
[%- ' class="bz_secure"' IF request.restricted %]>
- [% request.bug_id %] ([% request.priority FILTER html %]/[% request.bug_severity FILTER html %]): [%+ request.bug_summary FILTER html %]</a>
+ [% request.bug_id %] ([% request.bug_type FILTER html %]/[% request.priority FILTER html %]/[% request.bug_severity FILTER html %]): [%+ request.bug_summary FILTER html %]</a>
[% END %]
[% BLOCK display_attachment %]
[% IF user.is_timetracker %] [%+ field_descs.deadline FILTER html %], [%+ END %]
[% terms.Bug %] Numbers, [%+ field_descs.version FILTER html %],
[% IF Param('usetargetmilestone') %] [%+ field_descs.target_milestone FILTER html %], [%+ END %]
- [% field_descs.bug_severity FILTER html %], [%+ field_descs.priority FILTER html %], [%+ field_descs.rep_platform FILTER html %],
+ [%+ field_descs.bug_type FILTER html %], [% field_descs.bug_severity FILTER html %],
+ [%+ field_descs.priority FILTER html %], [%+ field_descs.rep_platform FILTER html %],
[%+ field_descs.op_sys FILTER html %]
</span>
</div>
[% Hook.process('after_freetext_fields') %]
- [%# *** Status Resolution Severity Priority Hardware OS *** %]
+ [%# *** Status Resolution Type Severity Priority Hardware OS *** %]
<div>
[% Hook.process('before_selects_bottom') %]
[% fake_version_field = { name => bug_fields.version.name,
value => default.target_milestone
%]
[% END %]
+ [% INCLUDE "search/field.html.tmpl"
+ field => bug_fields.bug_type
+ accesskey=> "t"
+ value => default.bug_type
+ %]
[% INCLUDE "search/field.html.tmpl"
field => bug_fields.bug_severity
accesskey=> "v"
<table width="100%">
<tr>
<th align="left">ID</th>
+ <th align="left">Type</th>
<th align="left">Sev</th>
<th align="left">Pri</th>
<th align="left">Plt</th>
<tr>
<td align="left"><a href="[%+ urlbase FILTER html %]show_bug.cgi?id=
[%- bug.bug_id %]">[% bug.bug_id %]</a></td>
+ <td align="left">[% display_value("bug_type", bug.bug_type) FILTER html %]</td>
<td align="left">[% display_value("bug_severity", bug.bug_severity) FILTER html %]</td>
<td align="left">[% display_value("priority", bug.priority) FILTER html %]</td>
<td align="left">[% display_value("rep_platform", bug.rep_platform) FILTER html %]</td>
[% FOREACH bug=query.bugs %]
[% terms.Bug +%] [%+ bug.bug_id %]:
[%+ urlbase %]show_bug.cgi?id=[% bug.bug_id +%]
+ Type: [%+ display_value("bug_type", bug.bug_type) -%]
Priority: [%+ display_value("priority", bug.priority) -%]
Severity: [%+ display_value("bug_severity", bug.bug_severity) -%]
Platform: [%+ display_value("rep_platform", bug.rep_platform) %]
$answer{'webdotbase'} = '/usr/bin/dot';
$answer{'auth_delegation'} = 1;
$answer{'insidergroup'} = 'admin';
+$answer{'default_bug_type'} = 'defect';
$answer{'defaultpriority'} = '--';
$answer{'defaultseverity'} = 'normal';
$answer{'skin'} = 'Mozilla';
# Execute the saved query
my @searchfields = qw(
bug_id
+ bug_type
bug_severity
priority
rep_platform
assigned_to => {contains => [2, 3, 4, 5]},
bug_id => {contains => [2, 3, 4, 5]},
bug_group => {contains => [1, 2, 3, 4]},
+ bug_type => {contains => [2, 3, 4, 5]},
bug_severity => {contains => [2, 3, 4, 5]},
bug_status => {contains => [2, 3, 4, 5]},
component => {contains => [2, 3, 4, 5]},