From dc56fab86e63cc2b68fb47ee5610a1279791f19c Mon Sep 17 00:00:00 2001 From: dklawren Date: Thu, 4 Jan 2018 20:50:09 -0500 Subject: Bug 1428156 - BMO will mark a revision as public if it sees a new one created without a bug id associated with it --- extensions/PhabBugz/lib/Feed.pm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'extensions/PhabBugz') 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; } -- cgit v1.2.3-24-g4f1b