summaryrefslogtreecommitdiffstats
path: root/extensions/MozProjectReview
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2013-04-02 17:19:52 +0200
committerDave Lawrence <dlawrence@mozilla.com>2013-04-02 17:19:52 +0200
commitc37b69ebb079654acc1d9ff68c8720ca97687352 (patch)
treefb60901c224cb609af0f6a2ba87c2e0d12952b03 /extensions/MozProjectReview
parentd776baaab8ead70425e5a7fd9b52676756c5823e (diff)
downloadbugzilla-c37b69ebb079654acc1d9ff68c8720ca97687352.tar.gz
bugzilla-c37b69ebb079654acc1d9ff68c8720ca97687352.tar.xz
Bug 856936 - Update Mozilla Project Review form to use the sec-review? flag instead of the sec-review-needed keyword
Diffstat (limited to 'extensions/MozProjectReview')
-rw-r--r--extensions/MozProjectReview/Extension.pm25
1 files changed, 21 insertions, 4 deletions
diff --git a/extensions/MozProjectReview/Extension.pm b/extensions/MozProjectReview/Extension.pm
index a7c632f46..31836700f 100644
--- a/extensions/MozProjectReview/Extension.pm
+++ b/extensions/MozProjectReview/Extension.pm
@@ -14,6 +14,7 @@ use Bugzilla::User;
use Bugzilla::Group;
use Bugzilla::Error;
use Bugzilla::Constants;
+use Bugzilla::FlagType;
our $VERSION = '0.01';
@@ -101,15 +102,30 @@ sub post_bug_after_creation {
component => 'Security Assurance: Review Request',
bug_severity => 'normal',
groups => [ 'mozilla-corporation-confidential' ],
- keywords => 'sec-review-needed',
op_sys => 'All',
rep_platform => 'All',
version => 'other',
blocked => $bug->bug_id,
};
- _file_child_bug({ parent_bug => $bug, template_vars => $vars,
- template_suffix => 'sec-review', bug_data => $bug_data,
- dep_comment => \@dep_bug_comment, dep_errors => \@dep_bug_errors });
+ my $new_bug = _file_child_bug({ parent_bug => $bug, template_vars => $vars,
+ template_suffix => 'sec-review', bug_data => $bug_data,
+ dep_comment => \@dep_bug_comment, dep_errors => \@dep_bug_errors });
+ # For sec-review bugs, we need to set the sec-review?
+ # flag as well so we do that now.
+ if ($new_bug) {
+ my $flagtypes = Bugzilla::FlagType::match({ product_id => $new_bug->product_obj->id,
+ component_id => $new_bug->component_obj->id,
+ name => 'sec-review' });
+ if (scalar @$flagtypes) {
+ my $sec_review_flag = $flagtypes->[0];
+ my $new_flags = [{
+ type_id => $sec_review_flag->id,
+ status => '?'
+ }];
+ $new_bug->set_flags([], $new_flags);
+ $new_bug->update();
+ }
+ }
}
if ($do_legal) {
@@ -283,6 +299,7 @@ sub _file_child_bug {
else {
push(@$dep_comment, "Bug " . $new_bug->id . " - " . $new_bug->short_desc);
}
+ return $new_bug;
}
__PACKAGE__->NAME;