diff options
author | dklawren <dklawren@users.noreply.github.com> | 2018-01-05 02:50:09 +0100 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2018-01-05 02:50:09 +0100 |
commit | dc56fab86e63cc2b68fb47ee5610a1279791f19c (patch) | |
tree | c8519d5f18eb32566cbaeab9eb8e82773ff313c3 /extensions/PhabBugz/lib | |
parent | c0cb3c9adc3d0666193510ee7c2201d4c56c4faf (diff) | |
download | bugzilla-dc56fab86e63cc2b68fb47ee5610a1279791f19c.tar.gz bugzilla-dc56fab86e63cc2b68fb47ee5610a1279791f19c.tar.xz |
Bug 1428156 - BMO will mark a revision as public if it sees a new one created without a bug id associated with it
Diffstat (limited to 'extensions/PhabBugz/lib')
-rw-r--r-- | extensions/PhabBugz/lib/Feed.pm | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/extensions/PhabBugz/lib/Feed.pm b/extensions/PhabBugz/lib/Feed.pm index 8ea343f96..8b6801e91 100644 --- a/extensions/PhabBugz/lib/Feed.pm +++ b/extensions/PhabBugz/lib/Feed.pm @@ -84,7 +84,7 @@ sub feed_query { $self->logger->debug("STORY PHID: $story_phid"); $self->logger->debug("AUTHOR PHID: $author_phid"); $self->logger->debug("OBJECT PHID: $object_phid"); - $self->logger->debug("STORY TEXT: $story_text"); + $self->logger->info("STORY TEXT: $story_text"); # Only interested in changes to revisions for now. if ($object_phid !~ /^PHID-DREV/) { @@ -107,7 +107,17 @@ sub feed_query { my $revision = Bugzilla::Extension::PhabBugz::Revision->new({ phids => [$object_phid] }); if (!$revision->bug_id) { - $self->logger->debug("SKIPPING: No bug associated with revision"); + if ($story_text =~ /\s+created\s+D\d+/) { + # If new revision and bug id was omitted, make revision public + $self->logger->debug("No bug associated with new revision. Marking public."); + $revision->set_policy('view', 'public'); + $revision->set_policy('edit', 'users'); + $revision->update(); + $self->logger->info("SUCCESS"); + } + else { + $self->logger->debug("SKIPPING: No bug associated with revision change"); + } $self->save_feed_last_id($story_id); next; } |