diff options
author | dklawren <dklawren@users.noreply.github.com> | 2018-04-26 16:09:12 +0200 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2018-04-26 16:09:12 +0200 |
commit | 4ab9b74bbb2c1f35138de017aac100cc499cbd0d (patch) | |
tree | a0610f1d078a408f43f05593047b86f8528272a0 | |
parent | 92d0e0f268550627a05f75cede34d67e91a91a1b (diff) | |
download | bugzilla-4ab9b74bbb2c1f35138de017aac100cc499cbd0d.tar.gz bugzilla-4ab9b74bbb2c1f35138de017aac100cc499cbd0d.tar.xz |
Bug 1457031 - When a revision does not have an bug id, the bug is made public but we also need to remove secure-revision tag
-rw-r--r-- | extensions/PhabBugz/lib/Feed.pm | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/extensions/PhabBugz/lib/Feed.pm b/extensions/PhabBugz/lib/Feed.pm index 275d71976..4c7fe54a5 100644 --- a/extensions/PhabBugz/lib/Feed.pm +++ b/extensions/PhabBugz/lib/Feed.pm @@ -272,6 +272,13 @@ sub process_revision_change { # Load the revision from Phabricator my $revision = Bugzilla::Extension::PhabBugz::Revision->new_from_query({ phids => [ $revision_phid ] }); + + my $secure_revision = + Bugzilla::Extension::PhabBugz::Project->new_from_query( + { + name => 'secure-revision' + } + ); # NO BUG ID @@ -281,6 +288,7 @@ sub process_revision_change { INFO("No bug associated with new revision. Marking public."); $revision->set_policy('view', 'public'); $revision->set_policy('edit', 'users'); + $revision->remove_project($secure_revision->phid); $revision->update(); INFO("SUCCESS"); return; @@ -310,8 +318,7 @@ sub process_revision_change { INFO('Bug is public so setting view/edit public'); $revision->set_policy('view', 'public'); $revision->set_policy('edit', 'users'); - my $secure_project_phid = get_project_phid('secure-revision'); - $revision->remove_project($secure_project_phid); + $revision->remove_project($secure_revision->phid); } # else bug is private. else { @@ -355,8 +362,7 @@ sub process_revision_change { $revision->set_policy('edit', $new_policy->phid); } - my $secure_project_phid = get_project_phid('secure-revision'); - $revision->add_project($secure_project_phid); + $revision->add_project($secure_revision->phid); } # Subscriber list of the private revision should always match |