From: Kohei Yoshino Date: Wed, 27 Mar 2019 23:46:54 +0000 (-0400) Subject: Bug 1522341 - Implement new field for indicating if a bug is a task, enhancement... X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=00f0d3a3ad1a4a1e10ad723c6aee5dcdbe76179a;p=thirdparty%2Fbugzilla.git Bug 1522341 - Implement new field for indicating if a bug is a task, enhancement, or defect --- diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index fca291770..4e6bfa8fb 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -85,6 +85,7 @@ sub DB_COLUMNS { bug_id bug_severity bug_status + bug_type cclist_accessible component_id creation_ts @@ -121,6 +122,7 @@ sub VALIDATORS { 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, @@ -219,6 +221,7 @@ sub UPDATE_COLUMNS { bug_file_loc bug_severity bug_status + bug_type cclist_accessible component_id deadline @@ -282,6 +285,7 @@ use constant FIELD_MAP => { severity => 'bug_severity', status => 'bug_status', summary => 'short_desc', + type => 'bug_type', url => 'bug_file_loc', whiteboard => 'status_whiteboard', }; @@ -384,7 +388,7 @@ sub _bz_field { 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'}, @@ -401,7 +405,7 @@ sub ES_SELECT_UPDATED_SQL { 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); @@ -478,6 +482,7 @@ sub es_document { reporter => $self->reporter->login, delta_ts => $self->delta_ts, bug_severity => $self->bug_severity, + bug_type => $self->bug_type, }; } @@ -854,6 +859,7 @@ sub possible_duplicates { # C - B The name of the component this bug is being # filed against. # +# C - B The initial type for the bug. # C - B The severity for the bug, a string. # C - B A SQL timestamp for when the bug was created. # C - B A summary for the bug. @@ -894,6 +900,8 @@ sub create { $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} @@ -2625,7 +2633,7 @@ sub fields { 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 @@ -3253,6 +3261,13 @@ sub set_bug_status { } } } + +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]); } @@ -3649,6 +3664,7 @@ sub bug_file_loc { return $_[0]->{bug_file_loc} } 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} } diff --git a/Bugzilla/Component.pm b/Bugzilla/Component.pm index d117c83ad..2869e8eda 100644 --- a/Bugzilla/Component.pm +++ b/Bugzilla/Component.pm @@ -36,6 +36,7 @@ use constant DB_COLUMNS => qw( id name product_id + default_bug_type initialowner initialqacontact description @@ -45,6 +46,7 @@ use constant DB_COLUMNS => qw( use constant UPDATE_COLUMNS => qw( name + default_bug_type initialowner initialqacontact description @@ -57,6 +59,7 @@ use constant REQUIRED_FIELD_MAP => {product_id => 'product',}; 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, @@ -200,6 +203,13 @@ sub _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) = @_; @@ -306,9 +316,10 @@ sub _create_series { } } -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) = @_; @@ -373,6 +384,10 @@ sub bug_ids { 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'} @@ -508,6 +523,7 @@ Bugzilla::Component - Bugzilla product component class. 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; @@ -521,6 +537,7 @@ Bugzilla::Component - Bugzilla product component class. 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, @@ -528,6 +545,7 @@ Bugzilla::Component - Bugzilla product component class. $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); @@ -575,6 +593,16 @@ Component.pm represents a Product Component object. Returns: A reference to an array of bug IDs. +=item C + + 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 Description: Returns a user object that represents the default assignee for @@ -656,6 +684,14 @@ Component.pm represents a Product Component object. Returns: Nothing. +=item C + + Description: Changes the default bug type of the component. + + Params: $new_type - one of legal bug types or undef. + + Returns: Nothing. + =item C Description: Changes the default assignee of the component. @@ -724,6 +760,8 @@ Component.pm represents a Product Component object. 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), diff --git a/Bugzilla/Config/BugFields.pm b/Bugzilla/Config/BugFields.pm index 9c08065e8..dee0717ce 100644 --- a/Bugzilla/Config/BugFields.pm +++ b/Bugzilla/Config/BugFields.pm @@ -19,6 +19,7 @@ our $sortkey = 600; 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')}; @@ -39,6 +40,14 @@ sub get_param_list { {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', diff --git a/Bugzilla/Config/Common.pm b/Bugzilla/Config/Common.pm index b3d0cb5f8..deeb8cdeb 100644 --- a/Bugzilla/Config/Common.pm +++ b/Bugzilla/Config/Common.pm @@ -23,7 +23,7 @@ use Bugzilla::Status; 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 @@ -99,6 +99,16 @@ sub 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'); diff --git a/Bugzilla/Constants.pm b/Bugzilla/Constants.pm index 6e42bc1b0..ffa981741 100644 --- a/Bugzilla/Constants.pm +++ b/Bugzilla/Constants.pm @@ -292,8 +292,8 @@ use constant MAILTO_GROUP => 1; # 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 diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm index 4cba3af98..543549293 100644 --- a/Bugzilla/DB.pm +++ b/Bugzilla/DB.pm @@ -91,8 +91,9 @@ use constant ISOLATION_LEVEL => 'REPEATABLE READ'; # 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"], diff --git a/Bugzilla/DB/Schema/Mysql.pm b/Bugzilla/DB/Schema/Mysql.pm index 0b8ee59c3..2f7ba1b35 100644 --- a/Bugzilla/DB/Schema/Mysql.pm +++ b/Bugzilla/DB/Schema/Mysql.pm @@ -51,6 +51,7 @@ use constant BOOLEAN_MAP => { is_multiplicable => 1 }, fielddefs => {mailhead => 1, obsolete => 1}, + bug_type => {isactive => 1}, bug_status => {isactive => 1}, resolution => {isactive => 1}, bug_severity => {isactive => 1}, diff --git a/Bugzilla/Elastic/Search.pm b/Bugzilla/Elastic/Search.pm index a5831a36f..d00a58ee3 100644 --- a/Bugzilla/Elastic/Search.pm +++ b/Bugzilla/Elastic/Search.pm @@ -34,7 +34,7 @@ with 'Bugzilla::Elastic::Role::HasClient'; 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 @@ -45,6 +45,7 @@ my %IS_SUPPORTED_FIELD = map { $_ => 1 } @SUPPORTED_FIELDS; $IS_SUPPORTED_FIELD{relevance} = 1; my @NORMAL_FIELDS = qw( + bug_type priority bug_severity bug_status diff --git a/Bugzilla/Field.pm b/Bugzilla/Field.pm index 7a061b43b..6aa6c71ad 100644 --- a/Bugzilla/Field.pm +++ b/Bugzilla/Field.pm @@ -248,6 +248,13 @@ use constant DEFAULT_FIELDS => ( 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', diff --git a/Bugzilla/Field/Choice.pm b/Bugzilla/Field/Choice.pm index eab2c20f3..ff2dd0e35 100644 --- a/Bugzilla/Field/Choice.pm +++ b/Bugzilla/Field/Choice.pm @@ -60,6 +60,7 @@ use constant CLASS_MAP => { }; use constant DEFAULT_MAP => { + bug_type => 'default_bug_type', op_sys => 'defaultopsys', rep_platform => 'defaultplatform', priority => 'defaultpriority', diff --git a/Bugzilla/Search/Quicksearch.pm b/Bugzilla/Search/Quicksearch.pm index 02d1cf6e5..6351820c4 100644 --- a/Bugzilla/Search/Quicksearch.pm +++ b/Bugzilla/Search/Quicksearch.pm @@ -28,7 +28,8 @@ use base qw(Exporter); # 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", @@ -89,7 +90,7 @@ sub FIELD_MAP { # "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) }; diff --git a/Bugzilla/Test/Util.pm b/Bugzilla/Test/Util.pm index b668aedb3..e826d97e0 100644 --- a/Bugzilla/Test/Util.pm +++ b/Bugzilla/Test/Util.pm @@ -102,6 +102,8 @@ sub create_bug { { default => sub {$Component} }, + bug_type => Str, + {default => 'defect'}, bug_severity => Str, {default => 'normal'}, groups => ArrayRef [Str], diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm index ad929f1b4..eb458b2f5 100644 --- a/Bugzilla/User.pm +++ b/Bugzilla/User.pm @@ -2365,6 +2365,7 @@ our %names_to_events = ( '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, diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm index 65d5d78af..bbfbe6360 100644 --- a/Bugzilla/WebService/Bug.pm +++ b/Bugzilla/WebService/Bug.pm @@ -732,7 +732,7 @@ sub update { # 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'}); @@ -1408,6 +1408,7 @@ sub _bug_to_hash { 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), @@ -2953,6 +2954,10 @@ see the keys included in the user detail hash, see below. As with C, this is an B field returned only by specifying C or C<_extra> in C. +=item C + +C The type of the bug. + =item C C The token that you would have to pass to the F @@ -3128,8 +3133,8 @@ and all custom fields. in Bugzilla B<4.4>. =item The C, C, C, C, -C, C and C fields were added in -Bugzilla B<6.0>. +C, C, C and C fields were added +in Bugzilla B<6.0>. =back @@ -3479,6 +3484,10 @@ will have a QA Contact set, if the field is disabled). C The login name of the Triage Owner of a bug's component. +=item C + +C The Type field on a bug. + =item C C The "URL" field of a bug. @@ -3630,6 +3639,8 @@ in by the developer, compared to the developer's other bugs. =item C (string) B - How severe the bug is. +=item C (string) B - The basic category of the bug. + =item C (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. @@ -4637,6 +4648,10 @@ C The Summary field of the bug. C The bug's Target Milestone. +=item C + +C The Type field on the bug. + =item C C The "URL" field of a bug. diff --git a/README.rst b/README.rst index 2a3142ef8..07e4e260b 100644 --- a/README.rst +++ b/README.rst @@ -54,7 +54,7 @@ Vagrant might ask to install some missing plugins it detected, you should instal 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 `__. +If this fails, please file a bug `using this link `__. Otherwise, you should have a working BMO developer machine! diff --git a/buglist.cgi b/buglist.cgi index ca8967f20..17abd7aea 100755 --- a/buglist.cgi +++ b/buglist.cgi @@ -575,12 +575,12 @@ if (grep('relevance', @displaycolumns) && !$fulltext) { # 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) { @@ -623,7 +623,7 @@ if ($format->{'extension'} eq 'atom') { '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'}; @@ -1028,6 +1028,7 @@ if ($dotweak && scalar @bugs) { 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'); diff --git a/bugzilla.dtd b/bugzilla.dtd index 57fe3aadb..91678849d 100644 --- a/bugzilla.dtd +++ b/bugzilla.dtd @@ -8,7 +8,7 @@ @@ -17,6 +17,7 @@ > + diff --git a/conf/checksetup_answers.txt b/conf/checksetup_answers.txt index 402039ffc..19ecce06b 100644 --- a/conf/checksetup_answers.txt +++ b/conf/checksetup_answers.txt @@ -22,6 +22,7 @@ $answer{'usetargetmilestone'} = 1; $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'; diff --git a/config.cgi b/config.cgi index f4476a476..cf3036785 100755 --- a/config.cgi +++ b/config.cgi @@ -37,6 +37,7 @@ if (Bugzilla->params->{'requirelogin'} && !$user->id) { # 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'); diff --git a/docs/en/rst/administering/parameters.rst b/docs/en/rst/administering/parameters.rst index f5e875f69..93d63d395 100644 --- a/docs/en/rst/administering/parameters.rst +++ b/docs/en/rst/administering/parameters.rst @@ -257,6 +257,9 @@ use_see_also 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. diff --git a/docs/en/rst/api/core/v1/bug.rst b/docs/en/rst/api/core/v1/bug.rst index 7da9018cb..cead3697e 100644 --- a/docs/en/rst/api/core/v1/bug.rst +++ b/docs/en/rst/api/core/v1/bug.rst @@ -62,6 +62,7 @@ name type description ], "resolution": "INVALID", "id": 35, + "type": "defect", "qa_contact": "", "triage_owner": "", "version": "1.0", @@ -222,6 +223,7 @@ summary string The summary of this bug. 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. @@ -553,6 +555,7 @@ qa_contact string The login name of the bug's QA Contact. Note that 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 @@ -643,6 +646,7 @@ priority string (defaulted) What order the bug will be fixed in by 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. @@ -997,6 +1001,7 @@ status string The status you want to change the bug to. Note 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. diff --git a/docs/en/rst/api/core/v1/bugzilla.rst b/docs/en/rst/api/core/v1/bugzilla.rst index 571f274e1..d0453887d 100644 --- a/docs/en/rst/api/core/v1/bugzilla.rst +++ b/docs/en/rst/api/core/v1/bugzilla.rst @@ -193,6 +193,7 @@ Example response for authenticated user: "defaultplatform" : "", "defaultpriority" : "--", "defaultseverity" : "normal", + "default_bug_type" : "defect", "duplicate_or_move_bug_status" : "RESOLVED", "emailregexp" : "^[\\w\\.\\+\\-=']+@[\\w\\.\\-]+\\.[\\w\\-]+$", "emailsuffix" : "", @@ -232,6 +233,7 @@ A logged-in user can access the following parameters (listed alphabetically): * defaultplatform * defaultpriority * defaultseverity +* default_bug_type * duplicate_or_move_bug_status * emailregexpdesc * emailsuffix diff --git a/editcomponents.cgi b/editcomponents.cgi index 72fd7c679..23922e533 100755 --- a/editcomponents.cgi +++ b/editcomponents.cgi @@ -119,6 +119,7 @@ if ($action eq 'new') { 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, @@ -128,6 +129,7 @@ if ($action eq 'new') { 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. @@ -221,6 +223,7 @@ if ($action eq 'update') { }); 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') || ''); @@ -233,6 +236,7 @@ if ($action eq 'update') { $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); diff --git a/enter_bug.cgi b/enter_bug.cgi index aa07f679a..08eb68dfd 100755 --- a/enter_bug.cgi +++ b/enter_bug.cgi @@ -214,6 +214,7 @@ my %default; $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'); @@ -252,6 +253,7 @@ if ($cloned_bug_id) { # 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; @@ -310,6 +312,8 @@ if ($cloned_bug_id) { 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'} diff --git a/extensions/BMO/Extension.pm b/extensions/BMO/Extension.pm index 0d110ba49..9cc35f9ca 100644 --- a/extensions/BMO/Extension.pm +++ b/extensions/BMO/Extension.pm @@ -130,7 +130,7 @@ sub template_before_process { # 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; @@ -1598,6 +1598,7 @@ sub field_end_of_create { 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', @@ -1969,6 +1970,7 @@ sub _post_employee_incident_bug { product => 'mozilla.org', component => 'Security Assurance: Incident', status_whiteboard => '[infrasec:incident]', + bug_type => 'task', bug_severity => 'critical', cc => ['jstevensen@mozilla.com'], groups => ['infrasec'], @@ -1993,6 +1995,7 @@ sub _post_employee_incident_bug { 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}], @@ -2130,6 +2133,7 @@ sub _post_shield_studies { 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', @@ -2144,6 +2148,7 @@ sub _post_shield_studies { 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', @@ -2158,6 +2163,7 @@ sub _post_shield_studies { 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', @@ -2172,6 +2178,7 @@ sub _post_shield_studies { short_desc => '[SHIELD] Legal Review for ' . $params->{hypothesis}, product => 'Legal', component => 'Firefox', + bug_type => 'task', bug_severity => 'normal', op_sys => 'All', rep_platform => 'All', diff --git a/extensions/BMO/template/en/default/bug/create/create-automative.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-automative.html.tmpl index 73a4310cc..96e688c8f 100644 --- a/extensions/BMO/template/en/default/bug/create/create-automative.html.tmpl +++ b/extensions/BMO/template/en/default/bug/create/create-automative.html.tmpl @@ -100,6 +100,7 @@ function validateAndSubmit() { + diff --git a/extensions/BMO/template/en/default/bug/create/create-client-bounty.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-client-bounty.html.tmpl index 7af36a986..9b8d7e111 100644 --- a/extensions/BMO/template/en/default/bug/create/create-client-bounty.html.tmpl +++ b/extensions/BMO/template/en/default/bug/create/create-client-bounty.html.tmpl @@ -118,6 +118,7 @@ function validateAndSubmit() { + diff --git a/extensions/BMO/template/en/default/bug/create/create-comm-newsletter.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-comm-newsletter.html.tmpl index b980ff9fc..d050145ff 100644 --- a/extensions/BMO/template/en/default/bug/create/create-comm-newsletter.html.tmpl +++ b/extensions/BMO/template/en/default/bug/create/create-comm-newsletter.html.tmpl @@ -94,6 +94,7 @@ function toggleAreaOther() { + diff --git a/extensions/BMO/template/en/default/bug/create/create-costume.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-costume.html.tmpl index 73bdd27a4..41cd86508 100644 --- a/extensions/BMO/template/en/default/bug/create/create-costume.html.tmpl +++ b/extensions/BMO/template/en/default/bug/create/create-costume.html.tmpl @@ -157,6 +157,7 @@ YAHOO.util.Event.onDOMReady(function() { + diff --git a/extensions/BMO/template/en/default/bug/create/create-creative.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-creative.html.tmpl index faa335194..29620ff65 100644 --- a/extensions/BMO/template/en/default/bug/create/create-creative.html.tmpl +++ b/extensions/BMO/template/en/default/bug/create/create-creative.html.tmpl @@ -128,6 +128,7 @@ function toggleTypeOther(element) { + diff --git a/extensions/BMO/template/en/default/bug/create/create-crm.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-crm.html.tmpl index 64d76c8b1..2e9df9a52 100644 --- a/extensions/BMO/template/en/default/bug/create/create-crm.html.tmpl +++ b/extensions/BMO/template/en/default/bug/create/create-crm.html.tmpl @@ -97,6 +97,7 @@ $(document).ready(function() { + diff --git a/extensions/BMO/template/en/default/bug/create/create-data-compliance.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-data-compliance.html.tmpl index 177a5776e..30a792716 100644 --- a/extensions/BMO/template/en/default/bug/create/create-data-compliance.html.tmpl +++ b/extensions/BMO/template/en/default/bug/create/create-data-compliance.html.tmpl @@ -80,6 +80,7 @@ + diff --git a/extensions/BMO/template/en/default/bug/create/create-finance.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-finance.html.tmpl index 018726ee7..38c0ac74d 100644 --- a/extensions/BMO/template/en/default/bug/create/create-finance.html.tmpl +++ b/extensions/BMO/template/en/default/bug/create/create-finance.html.tmpl @@ -81,6 +81,7 @@ + diff --git a/extensions/BMO/template/en/default/bug/create/create-fsa-budget.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-fsa-budget.html.tmpl index 1a0673bec..1c4c3c0db 100644 --- a/extensions/BMO/template/en/default/bug/create/create-fsa-budget.html.tmpl +++ b/extensions/BMO/template/en/default/bug/create/create-fsa-budget.html.tmpl @@ -89,6 +89,7 @@ function validateAndSubmit() { + diff --git a/extensions/BMO/template/en/default/bug/create/create-intern.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-intern.html.tmpl index 7c7a01680..039148e8d 100644 --- a/extensions/BMO/template/en/default/bug/create/create-intern.html.tmpl +++ b/extensions/BMO/template/en/default/bug/create/create-intern.html.tmpl @@ -119,6 +119,7 @@ $(document).ready(function() { + diff --git a/extensions/BMO/template/en/default/bug/create/create-ipp.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-ipp.html.tmpl index b19363eb3..efeca2ce0 100644 --- a/extensions/BMO/template/en/default/bug/create/create-ipp.html.tmpl +++ b/extensions/BMO/template/en/default/bug/create/create-ipp.html.tmpl @@ -75,6 +75,7 @@ function validateAndSubmit() { + diff --git a/extensions/BMO/template/en/default/bug/create/create-itrequest.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-itrequest.html.tmpl index 8bd51c09d..b25059c80 100644 --- a/extensions/BMO/template/en/default/bug/create/create-itrequest.html.tmpl +++ b/extensions/BMO/template/en/default/bug/create/create-itrequest.html.tmpl @@ -96,6 +96,7 @@ + @@ -114,7 +115,6 @@ - diff --git a/extensions/BMO/template/en/default/bug/create/create-legal.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-legal.html.tmpl index 55deedc65..172914792 100644 --- a/extensions/BMO/template/en/default/bug/create/create-legal.html.tmpl +++ b/extensions/BMO/template/en/default/bug/create/create-legal.html.tmpl @@ -80,6 +80,7 @@ label.required:before { + diff --git a/extensions/BMO/template/en/default/bug/create/create-mdn.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-mdn.html.tmpl index b0e7641f4..aba8b3981 100644 --- a/extensions/BMO/template/en/default/bug/create/create-mdn.html.tmpl +++ b/extensions/BMO/template/en/default/bug/create/create-mdn.html.tmpl @@ -131,9 +131,7 @@ strong.required:before { } 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) { @@ -185,7 +183,8 @@ strong.required:before { - + + diff --git a/extensions/BMO/template/en/default/bug/create/create-mobile-compat.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-mobile-compat.html.tmpl index 37a7c3ab9..3de869dcf 100644 --- a/extensions/BMO/template/en/default/bug/create/create-mobile-compat.html.tmpl +++ b/extensions/BMO/template/en/default/bug/create/create-mobile-compat.html.tmpl @@ -88,6 +88,7 @@ function validateAndSubmit() { + diff --git a/extensions/BMO/template/en/default/bug/create/create-mozlist.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-mozlist.html.tmpl index f1b5326e2..25ce7482f 100644 --- a/extensions/BMO/template/en/default/bug/create/create-mozlist.html.tmpl +++ b/extensions/BMO/template/en/default/bug/create/create-mozlist.html.tmpl @@ -66,6 +66,7 @@ + diff --git a/extensions/BMO/template/en/default/bug/create/create-mozpr.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-mozpr.html.tmpl index a7eee012d..56f72dd23 100644 --- a/extensions/BMO/template/en/default/bug/create/create-mozpr.html.tmpl +++ b/extensions/BMO/template/en/default/bug/create/create-mozpr.html.tmpl @@ -295,6 +295,7 @@ function validate_form() { + diff --git a/extensions/BMO/template/en/default/bug/create/create-name-clearance.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-name-clearance.html.tmpl index 80e2909d5..818ff2e20 100644 --- a/extensions/BMO/template/en/default/bug/create/create-name-clearance.html.tmpl +++ b/extensions/BMO/template/en/default/bug/create/create-name-clearance.html.tmpl @@ -82,6 +82,7 @@ $(function() { + diff --git a/extensions/BMO/template/en/default/bug/create/create-nda.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-nda.html.tmpl index 01ded3101..d931de5ce 100644 --- a/extensions/BMO/template/en/default/bug/create/create-nda.html.tmpl +++ b/extensions/BMO/template/en/default/bug/create/create-nda.html.tmpl @@ -71,6 +71,7 @@ $(function() { + diff --git a/extensions/BMO/template/en/default/bug/create/create-recoverykey.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-recoverykey.html.tmpl index ec5c0783a..f6c99d633 100644 --- a/extensions/BMO/template/en/default/bug/create/create-recoverykey.html.tmpl +++ b/extensions/BMO/template/en/default/bug/create/create-recoverykey.html.tmpl @@ -40,6 +40,7 @@ + diff --git a/extensions/BMO/template/en/default/bug/create/create-recruiting.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-recruiting.html.tmpl index f2217b945..d7fb7cbf6 100644 --- a/extensions/BMO/template/en/default/bug/create/create-recruiting.html.tmpl +++ b/extensions/BMO/template/en/default/bug/create/create-recruiting.html.tmpl @@ -84,6 +84,7 @@ function jobDescToggle(what) { + diff --git a/extensions/BMO/template/en/default/bug/create/create-screen-share-whitelist.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-screen-share-whitelist.html.tmpl index a24365f99..59e04b062 100644 --- a/extensions/BMO/template/en/default/bug/create/create-screen-share-whitelist.html.tmpl +++ b/extensions/BMO/template/en/default/bug/create/create-screen-share-whitelist.html.tmpl @@ -100,6 +100,7 @@ function fieldValue(elem_id) { + diff --git a/extensions/BMO/template/en/default/bug/create/create-swag.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-swag.html.tmpl index 3f938304e..6adfffda6 100644 --- a/extensions/BMO/template/en/default/bug/create/create-swag.html.tmpl +++ b/extensions/BMO/template/en/default/bug/create/create-swag.html.tmpl @@ -540,6 +540,7 @@ function showGear() { + diff --git a/extensions/BMO/template/en/default/bug/create/create-trademark.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-trademark.html.tmpl index 051a394c7..c1835c113 100644 --- a/extensions/BMO/template/en/default/bug/create/create-trademark.html.tmpl +++ b/extensions/BMO/template/en/default/bug/create/create-trademark.html.tmpl @@ -42,7 +42,8 @@ - + + diff --git a/extensions/BMO/template/en/default/bug/create/create-user-engagement.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-user-engagement.html.tmpl index 7b051e74f..877c77bb2 100644 --- a/extensions/BMO/template/en/default/bug/create/create-user-engagement.html.tmpl +++ b/extensions/BMO/template/en/default/bug/create/create-user-engagement.html.tmpl @@ -94,6 +94,7 @@ function toggleGoalOther() { + diff --git a/extensions/BMO/template/en/default/bug/create/create-web-bounty.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-web-bounty.html.tmpl index 4229e156c..928f6c8e3 100644 --- a/extensions/BMO/template/en/default/bug/create/create-web-bounty.html.tmpl +++ b/extensions/BMO/template/en/default/bug/create/create-web-bounty.html.tmpl @@ -78,6 +78,7 @@ function validateAndSubmit() { + diff --git a/extensions/BMO/template/en/default/hook/bug/field-help-end.none.tmpl b/extensions/BMO/template/en/default/hook/bug/field-help-end.none.tmpl index f7a4ed950..4b0df82fe 100644 --- a/extensions/BMO/template/en/default/hook/bug/field-help-end.none.tmpl +++ b/extensions/BMO/template/en/default/hook/bug/field-help-end.none.tmpl @@ -21,6 +21,23 @@ [% USE Bugzilla %] [% IF Bugzilla.request_cache.bmo_fields_page %] [% + vars.help_html.bug_type = + "This field describes the type of ${terms.abug}. + + + + + + + + + + + + + +
defectregression, crash, hang, security vulnerability and any other general issue
enhancementnew feature, improvement in UI, performance, etc. and any other request for enhancement
taskrefactoring, removal, replacement, enabling or disabling of functionality and any other task
" + 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 @@ -56,9 +73,6 @@ cosmetic problem like misspelled words or misaligned text - - enhancement - Request for enhancement " vars.help_html.rep_platform = diff --git a/extensions/BMO/template/en/default/pages/get_permissions.html.tmpl b/extensions/BMO/template/en/default/pages/get_permissions.html.tmpl index e824eb17a..d707ef224 100644 --- a/extensions/BMO/template/en/default/pages/get_permissions.html.tmpl +++ b/extensions/BMO/template/en/default/pages/get_permissions.html.tmpl @@ -17,7 +17,7 @@ the triage request form.

-[% 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" %]

If you want editbugs, open a diff --git a/extensions/BugModal/lib/WebService.pm b/extensions/BugModal/lib/WebService.pm index a5571ec35..9e607c502 100644 --- a/extensions/BugModal/lib/WebService.pm +++ b/extensions/BugModal/lib/WebService.pm @@ -88,6 +88,7 @@ sub initial_field_values { return { products => _name($user->get_enterable_products), keywords => _name([Bugzilla::Keyword->get_all()]), + default_bug_types => get_legal_field_values('bug_type'), }; } @@ -102,8 +103,11 @@ sub product_info { 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),}; } @@ -131,6 +135,7 @@ sub edit { $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 { diff --git a/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl index 51473ac7c..0048e4f05 100644 --- a/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl +++ b/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl @@ -226,6 +226,12 @@ no_label = 1 hide_on_edit = 1 %] + [% IF bug.bug_type %] + + + [%~ bug.bug_type FILTER html ~%] + + [% END %] [% bug.bug_status FILTER html %] [%+ bug.resolution FILTER html IF bug.resolution %] @@ -459,6 +465,16 @@ [% 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" diff --git a/extensions/BugModal/web/bug_modal.css b/extensions/BugModal/web/bug_modal.css index ca1198c12..242b92fa0 100644 --- a/extensions/BugModal/web/bug_modal.css +++ b/extensions/BugModal/web/bug_modal.css @@ -255,13 +255,18 @@ input[type="number"] { #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; } diff --git a/extensions/BugModal/web/new_bug.js b/extensions/BugModal/web/new_bug.js index 13db96860..3f4ac0e91 100644 --- a/extensions/BugModal/web/new_bug.js +++ b/extensions/BugModal/web/new_bug.js @@ -1,5 +1,6 @@ var initial = {} var comp_desc = {} +var comp_default_bug_type = {} var product_name = ''; var component_load = function(product) { @@ -20,8 +21,10 @@ 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(); @@ -67,6 +70,16 @@ $(document).ready(function() { 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"); @@ -107,8 +120,9 @@ $(document).ready(function() { }); 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') diff --git a/extensions/BzAPI/lib/Resources/Bugzilla.pm b/extensions/BzAPI/lib/Resources/Bugzilla.pm index 23d423d5a..8d621cb25 100644 --- a/extensions/BzAPI/lib/Resources/Bugzilla.pm +++ b/extensions/BzAPI/lib/Resources/Bugzilla.pm @@ -60,6 +60,7 @@ sub get_configuration { # 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'); diff --git a/extensions/BzAPI/template/en/default/config.json.tmpl b/extensions/BzAPI/template/en/default/config.json.tmpl index a00245ddf..11474a7aa 100644 --- a/extensions/BzAPI/template/en/default/config.json.tmpl +++ b/extensions/BzAPI/template/en/default/config.json.tmpl @@ -16,6 +16,7 @@ OLD2NEW = { 'rep_platform' => 'platform', 'bug_severity' => 'severity', 'bug_status' => 'status', + 'bug_type' => 'type', 'short_desc' => 'summary', 'short_short_desc' => 'summary', 'bug_file_loc' => 'url', diff --git a/extensions/Ember/lib/WebService.pm b/extensions/Ember/lib/WebService.pm index d42e04297..1c1b35aea 100644 --- a/extensions/Ember/lib/WebService.pm +++ b/extensions/Ember/lib/WebService.pm @@ -79,6 +79,7 @@ use constant BUG_CHOICE_FIELDS => qw( ); use constant DEFAULT_VALUE_MAP => { + type_id => 'default_bug_type', op_sys => 'defaultopsys', rep_platform => 'defaultplatform', priority => 'defaultpriority', diff --git a/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl b/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl index 83d690e83..34e0da809 100644 --- a/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl +++ b/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl @@ -326,6 +326,7 @@ Product: ?:

+ diff --git a/extensions/MozProjectReview/Extension.pm b/extensions/MozProjectReview/Extension.pm index eb68b07b1..f651a6d99 100644 --- a/extensions/MozProjectReview/Extension.pm +++ b/extensions/MozProjectReview/Extension.pm @@ -69,6 +69,7 @@ sub post_bug_after_creation { . $params->{other_party}, product => 'Enterprise Information Security', component => 'Rapid Risk Analysis', + bug_type => 'task', bug_severity => 'normal', groups => ['mozilla-employee-confidential'], op_sys => 'All', @@ -88,6 +89,7 @@ sub post_bug_after_creation { . $params->{other_party}, product => 'Finance', component => 'Purchase Request Form', + bug_type => 'task', bug_severity => 'normal', priority => '--', groups => ['finance'], diff --git a/extensions/MozProjectReview/template/en/default/bug/create/create-moz-project-review.html.tmpl b/extensions/MozProjectReview/template/en/default/bug/create/create-moz-project-review.html.tmpl index d9e0e0c72..8d84e5ae0 100644 --- a/extensions/MozProjectReview/template/en/default/bug/create/create-moz-project-review.html.tmpl +++ b/extensions/MozProjectReview/template/en/default/bug/create/create-moz-project-review.html.tmpl @@ -48,6 +48,7 @@

+ diff --git a/extensions/Push/lib/Serialise.pm b/extensions/Push/lib/Serialise.pm index c878ff4d9..cbb218600 100644 --- a/extensions/Push/lib/Serialise.pm +++ b/extensions/Push/lib/Serialise.pm @@ -211,6 +211,7 @@ sub _bug { 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), diff --git a/extensions/REMO/template/en/default/bug/create/create-csa-discourse.html.tmpl b/extensions/REMO/template/en/default/bug/create/create-csa-discourse.html.tmpl index 1b5e6ef34..59edc11e0 100644 --- a/extensions/REMO/template/en/default/bug/create/create-csa-discourse.html.tmpl +++ b/extensions/REMO/template/en/default/bug/create/create-csa-discourse.html.tmpl @@ -23,6 +23,7 @@

Community IT Discourse Request

+ diff --git a/extensions/REMO/template/en/default/bug/create/create-mozreps.html.tmpl b/extensions/REMO/template/en/default/bug/create/create-mozreps.html.tmpl index 8c409e23f..1f4a13d8f 100644 --- a/extensions/REMO/template/en/default/bug/create/create-mozreps.html.tmpl +++ b/extensions/REMO/template/en/default/bug/create/create-mozreps.html.tmpl @@ -39,6 +39,7 @@

+ diff --git a/extensions/REMO/template/en/default/bug/create/create-remo-budget.html.tmpl b/extensions/REMO/template/en/default/bug/create/create-remo-budget.html.tmpl index e3edf2dd0..f1dfefab8 100644 --- a/extensions/REMO/template/en/default/bug/create/create-remo-budget.html.tmpl +++ b/extensions/REMO/template/en/default/bug/create/create-remo-budget.html.tmpl @@ -79,6 +79,7 @@ function validateAndSubmit() { + diff --git a/extensions/REMO/template/en/default/bug/create/create-remo-swag.html.tmpl b/extensions/REMO/template/en/default/bug/create/create-remo-swag.html.tmpl index 07c5b2052..ce18dc30a 100644 --- a/extensions/REMO/template/en/default/bug/create/create-remo-swag.html.tmpl +++ b/extensions/REMO/template/en/default/bug/create/create-remo-swag.html.tmpl @@ -71,6 +71,7 @@ function validateAndSubmit() { onSubmit="return validateAndSubmit();"> + diff --git a/importxml.pl b/importxml.pl index 2c5aebdf4..8e2b19a61 100755 --- a/importxml.pl +++ b/importxml.pl @@ -698,8 +698,21 @@ sub process_bug { 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( diff --git a/new_bug.cgi b/new_bug.cgi index 97f593fbb..edc53e949 100755 --- a/new_bug.cgi +++ b/new_bug.cgi @@ -58,6 +58,7 @@ if (lc($cgi->request_method) eq 'post') { 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', diff --git a/post_bug.cgi b/post_bug.cgi index cbcfc68e6..577e62d68 100755 --- a/post_bug.cgi +++ b/post_bug.cgi @@ -115,6 +115,7 @@ push( bug_file_loc bug_severity bug_status + bug_type dependson keywords short_desc diff --git a/process_bug.cgi b/process_bug.cgi index 4741dfc57..9ec444ffa 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -235,7 +235,7 @@ foreach my $bug (@bug_objects) { # 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 @@ -246,6 +246,7 @@ my @set_fields = qw(op_sys rep_platform priority bug_severity 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', diff --git a/qa/config/generate_test_data.pl b/qa/config/generate_test_data.pl index 1af6499a2..895a08386 100644 --- a/qa/config/generate_test_data.pl +++ b/qa/config/generate_test_data.pl @@ -349,6 +349,7 @@ my $admin_user = Bugzilla::User->check($config->{admin_user_login}); Bugzilla->set_user($admin_user); my %field_values = ( + 'bug_type' => 'defect', 'priority' => 'Highest', 'bug_status' => 'CONFIRMED', 'version' => 'unspecified', diff --git a/qa/t/archived/test_email_preferences.t b/qa/t/archived/test_email_preferences.t index 6d3cb6323..d99f2b7a6 100644 --- a/qa/t/archived/test_email_preferences.t +++ b/qa/t/archived/test_email_preferences.t @@ -273,6 +273,8 @@ is_deeply(\@email_sentto, \@email_both, "Admin and normal user got bugmail"); 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"); @@ -320,6 +322,8 @@ log_in($sel, $config, 'admin'); 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"); @@ -384,6 +388,8 @@ log_in($sel, $config, 'editbugs'); 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"); diff --git a/qa/t/test_bug_edit.t b/qa/t/test_bug_edit.t index fcd22cd1e..e2457057f 100644 --- a/qa/t/test_bug_edit.t +++ b/qa/t/test_bug_edit.t @@ -49,6 +49,7 @@ logout($sel); 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"); @@ -64,6 +65,7 @@ $sel->is_text_present_ok('has been added to the database', $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]"); @@ -104,6 +106,7 @@ $sel->click_ok("link=bug $bug1_id"); 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"); @@ -137,6 +140,7 @@ logout($sel); 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]"); @@ -261,6 +265,8 @@ $sel->type_ok("comment", "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"]'), @@ -371,6 +377,7 @@ logout($sel); 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"); diff --git a/qa/t/webservice_bug_fields.t b/qa/t/webservice_bug_fields.t index 244a92514..48373a885 100644 --- a/qa/t/webservice_bug_fields.t +++ b/qa/t/webservice_bug_fields.t @@ -14,7 +14,7 @@ use List::Util qw(first); 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; @@ -76,7 +76,7 @@ sub GLOBAL_GENERAL_FIELDS { } 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)); diff --git a/qa/t/webservice_bug_legal_values.t b/qa/t/webservice_bug_legal_values.t index 303868517..979db7068 100644 --- a/qa/t/webservice_bug_legal_values.t +++ b/qa/t/webservice_bug_legal_values.t @@ -12,14 +12,14 @@ 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); diff --git a/query.cgi b/query.cgi index f42e1ae9d..c15575a88 100755 --- a/query.cgi +++ b/query.cgi @@ -190,6 +190,7 @@ else { } @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'} diff --git a/request.cgi b/request.cgi index 23181bcfa..25244b157 100755 --- a/request.cgi +++ b/request.cgi @@ -109,7 +109,8 @@ sub queue { 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 @@ -305,6 +306,7 @@ sub queue { 'bug_status' => $data->[17], 'priority' => $data->[18], 'bug_severity' => $data->[19], + 'bug_type' => $data->[20], }; push(@requests, $request); } diff --git a/sanitycheck.cgi b/sanitycheck.cgi index cf95950b2..c46578a30 100755 --- a/sanitycheck.cgi +++ b/sanitycheck.cgi @@ -595,6 +595,8 @@ CrossCheck( ["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"]); diff --git a/scripts/c9-install b/scripts/c9-install index a446e2b82..89cec5716 100755 --- a/scripts/c9-install +++ b/scripts/c9-install @@ -55,6 +55,7 @@ $answer{'usetargetmilestone'} = 1; $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; diff --git a/scripts/generate_bmo_data.pl b/scripts/generate_bmo_data.pl index b3ea49847..7b5ff6108 100755 --- a/scripts/generate_bmo_data.pl +++ b/scripts/generate_bmo_data.pl @@ -483,6 +483,7 @@ my %set_params = ( 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' diff --git a/scripts/generate_conduit_data.pl b/scripts/generate_conduit_data.pl index 2685cb4f6..74805ae5e 100755 --- a/scripts/generate_conduit_data.pl +++ b/scripts/generate_conduit_data.pl @@ -139,6 +139,7 @@ Bugzilla->set_user(Bugzilla::User->check({name => 'conduit@mozilla.bugs'})); Bugzilla::Bug->create({ product => 'Firefox', component => 'General', + bug_type => 'defect', priority => '--', bug_status => 'NEW', version => 'unspecified', diff --git a/scripts/remove-non-public-data.pl b/scripts/remove-non-public-data.pl index e72c49d44..4b9d9cc86 100755 --- a/scripts/remove-non-public-data.pl +++ b/scripts/remove-non-public-data.pl @@ -48,7 +48,7 @@ my %whitelist = ( ], 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 diff --git a/skins/standard/buglist.css b/skins/standard/buglist.css index 2aee38e2b..735cca2d9 100644 --- a/skins/standard/buglist.css +++ b/skins/standard/buglist.css @@ -83,14 +83,10 @@ /* 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 { @@ -100,6 +96,10 @@ 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; } @@ -110,6 +110,12 @@ tr.bz_secure_mode_implied td.first-child { 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, diff --git a/skins/standard/global.css b/skins/standard/global.css index 7ba7d3aab..d58abbdb0 100644 --- a/skins/standard/global.css +++ b/skins/standard/global.css @@ -2821,3 +2821,70 @@ pre.comment-text { .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; +} diff --git a/t/bmo/comments.t b/t/bmo/comments.t index 7f20ccf84..992e17fbc 100644 --- a/t/bmo/comments.t +++ b/t/bmo/comments.t @@ -27,6 +27,7 @@ my $bug_1 = Bugzilla::Bug->create({ product => 'Firefox', component => 'General', , + bug_type => 'defect', bug_severity => 'normal', groups => [], op_sys => 'Unspecified', @@ -46,6 +47,7 @@ my $bug_2 = Bugzilla::Bug->create({ product => 'Firefox', component => 'General', , + bug_type => 'defect', bug_severity => 'normal', groups => [], op_sys => 'Unspecified', diff --git a/template/en/default/admin/components/edit-common.html.tmpl b/template/en/default/admin/components/edit-common.html.tmpl index ffb67bbf7..4d9f183b3 100644 --- a/template/en/default/admin/components/edit-common.html.tmpl +++ b/template/en/default/admin/components/edit-common.html.tmpl @@ -40,6 +40,16 @@ %] + + + + [% INCLUDE default_select + field_name = 'default_bug_type' + field_value = comp.default_bug_type + field_values = bug_fields.bug_type.legal_values + %] + + @@ -95,3 +105,13 @@ [% Hook.process('rows') %] + +[% BLOCK default_select %] + +[% END %] diff --git a/template/en/default/admin/components/list.html.tmpl b/template/en/default/admin/components/list.html.tmpl index 5001f6ed9..aca4c95a7 100644 --- a/template/en/default/admin/components/list.html.tmpl +++ b/template/en/default/admin/components/list.html.tmpl @@ -52,6 +52,10 @@ heading => "Description" allow_html_content => 1 }, + { + name => "default_bug_type" + heading => "Default $terms.Bug Type" + }, { name => "initialowner" heading => "Default Assignee" diff --git a/template/en/default/admin/params/bugfields.html.tmpl b/template/en/default/admin/params/bugfields.html.tmpl index ef5ec55e5..2052d48b3 100644 --- a/template/en/default/admin/params/bugfields.html.tmpl +++ b/template/en/default/admin/params/bugfields.html.tmpl @@ -64,6 +64,8 @@ "$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", } diff --git a/template/en/default/admin/params/common.html.tmpl b/template/en/default/admin/params/common.html.tmpl index e7b480c69..011bcda16 100644 --- a/template/en/default/admin/params/common.html.tmpl +++ b/template/en/default/admin/params/common.html.tmpl @@ -120,7 +120,9 @@ [% FOREACH item = param.choices %] -

Say how serious the problem is, or if your [% terms.bug %] is a diff --git a/template/en/default/bug/create/create.html.tmpl b/template/en/default/bug/create/create.html.tmpl index 3383954f1..cb92f137d 100644 --- a/template/en/default/bug/create/create.html.tmpl +++ b/template/en/default/bug/create/create.html.tmpl @@ -66,6 +66,7 @@ function initCrashSignatureField() { 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 %]); @@ -80,6 +81,7 @@ var flags = 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) %] @@ -129,6 +131,7 @@ function set_assign_to() { 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]; @@ -301,9 +304,9 @@ TUI_hide_default('expert_fields'); [% INCLUDE "bug/field-label.html.tmpl" - field = bug_fields.version editable = 1 rowspan = 3 + field = bug_fields.version editable = 1 rowspan = 4 %] - + + [% INCLUDE bug/field.html.tmpl + bug = default, field = bug_fields.bug_type, editable = 1, + value = default.bug_type %] + + + [% INCLUDE bug/field.html.tmpl bug = default, field = bug_fields.bug_severity, editable = 1, value = default.bug_severity %] diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl index 9e51d9fba..5f741f633 100644 --- a/template/en/default/bug/edit.html.tmpl +++ b/template/en/default/bug/edit.html.tmpl @@ -443,6 +443,19 @@ [%###############################################################%] [%# Importance (priority and severity) #%] [%###############################################################%] + + + + + + [% 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) %] + + +

  • Description updated to '[% comp.description FILTER html_light %]'
  • [% END %] + [% IF changes.default_bug_type.defined %] +
  • Default [% terms.bug %] type updated to '[% comp.default_bug_type FILTER html %]'
  • + [% END %] [% IF changes.initialowner.defined %]
  • Default assignee updated to '[% comp.default_assignee.login FILTER html %]'
  • [% END %] diff --git a/template/en/default/list/edit-multiple.html.tmpl b/template/en/default/list/edit-multiple.html.tmpl index 0637eb159..148e4ec7f 100644 --- a/template/en/default/list/edit-multiple.html.tmpl +++ b/template/en/default/list/edit-multiple.html.tmpl @@ -124,7 +124,17 @@ - [% PROCESS status_section %] + [% PROCESS status_section %] + + + + + + [% PROCESS selectmenu menuname = "bug_type" + menuitems = types %] + [% IF user.is_timetracker %] diff --git a/template/en/default/list/list.atom.tmpl b/template/en/default/list/list.atom.tmpl index 5568b7bff..b853d3ea0 100644 --- a/template/en/default/list/list.atom.tmpl +++ b/template/en/default/list/list.atom.tmpl @@ -75,6 +75,9 @@ [% columns.resolution.title FILTER html %] [% display_value("resolution", bug.resolution) FILTER html %] + + [% columns.bug_type.title FILTER html %] + [% display_value("bug_type", bug.bug_type) FILTER html %] [% columns.priority.title FILTER html %] [% display_value("priority", bug.priority) FILTER html %] diff --git a/template/en/default/list/table.html.tmpl b/template/en/default/list/table.html.tmpl index fd572f433..1d4e6f93c 100644 --- a/template/en/default/list/table.html.tmpl +++ b/template/en/default/list/table.html.tmpl @@ -45,6 +45,7 @@ [%# 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" } , @@ -183,6 +184,7 @@ [% count = loop.count() %] + + [% ELSIF column == 'actual_time' || column == 'remaining_time' || column == 'estimated_time' %] diff --git a/template/en/default/pages/bugzilla.dtd.tmpl b/template/en/default/pages/bugzilla.dtd.tmpl index f0da8d78e..e9619f788 100644 --- a/template/en/default/pages/bugzilla.dtd.tmpl +++ b/template/en/default/pages/bugzilla.dtd.tmpl @@ -56,6 +56,7 @@ bug_file_loc?, status_whiteboard?, keywords*, + bug_type, priority, bug_severity, target_milestone?, @@ -87,6 +88,7 @@ > + diff --git a/template/en/default/reports/duplicates-table.html.tmpl b/template/en/default/reports/duplicates-table.html.tmpl index 6ac325f03..e01f81358 100644 --- a/template/en/default/reports/duplicates-table.html.tmpl +++ b/template/en/default/reports/duplicates-table.html.tmpl @@ -46,6 +46,7 @@ { name => "delta", description => "Change in last
    $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 }, @@ -105,6 +106,9 @@ [% item.count FILTER html %] [% item.delta FILTER html %] [% bug.component FILTER html %] + + [%- display_value('bug_type', bug.bug_type) FILTER html %] + [%- display_value('bug_severity', bug.bug_severity) FILTER html %] diff --git a/template/en/default/request/queue.html.tmpl b/template/en/default/request/queue.html.tmpl index f8a2b11c4..cfb1c82b9 100644 --- a/template/en/default/request/queue.html.tmpl +++ b/template/en/default/request/queue.html.tmpl @@ -209,6 +209,7 @@ to some group are shown by default. [% FOREACH column = display_columns %] [% NEXT IF column == group_field || excluded_columns.contains(column) %] @@ -251,7 +252,7 @@ to some group are shown by default. [% BLOCK display_bug %] - [% request.bug_id %] ([% request.priority FILTER html %]/[% request.bug_severity FILTER html %]): [%+ request.bug_summary FILTER html %] + [% request.bug_id %] ([% request.bug_type FILTER html %]/[% request.priority FILTER html %]/[% request.bug_severity FILTER html %]): [%+ request.bug_summary FILTER html %] [% END %] [% BLOCK display_attachment %] diff --git a/template/en/default/search/form.html.tmpl b/template/en/default/search/form.html.tmpl index a9cf3ab89..54d297d50 100644 --- a/template/en/default/search/form.html.tmpl +++ b/template/en/default/search/form.html.tmpl @@ -200,7 +200,8 @@ TUI_hide_default('information_query'); [% 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 %] @@ -262,7 +263,7 @@ TUI_hide_default('information_query'); [% Hook.process('after_freetext_fields') %] - [%# *** Status Resolution Severity Priority Hardware OS *** %] + [%# *** Status Resolution Type Severity Priority Hardware OS *** %]
    [% Hook.process('before_selects_bottom') %] [% fake_version_field = { name => bug_fields.version.name, @@ -279,6 +280,11 @@ TUI_hide_default('information_query'); 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" diff --git a/template/en/default/whine/mail.html.tmpl b/template/en/default/whine/mail.html.tmpl index 7f9e608ed..093660b2f 100644 --- a/template/en/default/whine/mail.html.tmpl +++ b/template/en/default/whine/mail.html.tmpl @@ -61,6 +61,7 @@ + @@ -74,6 +75,7 @@ + diff --git a/template/en/default/whine/mail.txt.tmpl b/template/en/default/whine/mail.txt.tmpl index 13216d895..78af0b3d2 100644 --- a/template/en/default/whine/mail.txt.tmpl +++ b/template/en/default/whine/mail.txt.tmpl @@ -49,6 +49,7 @@ [% 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) %] diff --git a/vagrant_support/checksetup_answers.j2 b/vagrant_support/checksetup_answers.j2 index 57c84436c..a79df9b62 100644 --- a/vagrant_support/checksetup_answers.j2 +++ b/vagrant_support/checksetup_answers.j2 @@ -33,6 +33,7 @@ $answer{'usetargetmilestone'} = 1; $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'; diff --git a/whine.pl b/whine.pl index 1eeda08d7..0d65d7b4a 100755 --- a/whine.pl +++ b/whine.pl @@ -425,6 +425,7 @@ sub run_queries { # Execute the saved query my @searchfields = qw( bug_id + bug_type bug_severity priority rep_platform diff --git a/xt/lib/Bugzilla/Test/Search/Constants.pm b/xt/lib/Bugzilla/Test/Search/Constants.pm index 34953d697..2a7ee3205 100644 --- a/xt/lib/Bugzilla/Test/Search/Constants.pm +++ b/xt/lib/Bugzilla/Test/Search/Constants.pm @@ -487,6 +487,7 @@ use constant GREATERTHAN_OVERRIDE => ( 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]},
    IDType Sev Pri Plt
    [% bug.bug_id %][% display_value("bug_type", bug.bug_type) FILTER html %] [% display_value("bug_severity", bug.bug_severity) FILTER html %] [% display_value("priority", bug.priority) FILTER html %] [% display_value("rep_platform", bug.rep_platform) FILTER html %]