Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1583849 - WIP Phabricator revisions not moved out of Draft state #1447

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Bug 1583849 - WIP Phabricator revisions not moved out of Draft state #1447

wants to merge 1 commit into from

Conversation

dklawren
Copy link
Collaborator

@dklawren dklawren commented Oct 1, 2019

No description provided.

INFO("Moving from draft to needs-review");
# Removing draft status
if ($is_new && $revision->status eq 'draft') {
INFO("Removing draft status");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the revision is currently draft+changes-planned, this will change it to request-review, which isn't what we want.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok after more investigation I still feel like this change is the right way to go.

  1. When a revision is created the status is 'draft'.
  2. When moz-phab creates a WIP revision, the status is set to 'changes-planned'.
  3. When a revision is created with 'changes-planned' without ever being in the 'request-review' state, it an additional property on the revision, separate from the revision status, called '{"draft.broadcast":false}'. This means that no email notifications will be send as long as that is false.
  4. This is why the 'Draft' label is still displayed on a revision that has a status of 'changes-planned' for D1355 for example.
  5. The way to get set the 'draft.broadcast' value to true, is to request review on the revision (set status to 'request-review').
  6. Normally moz-phab will do this automatically with --wip is not provided.
  7. The BMO change on this PR will therefore only update the status if the current status is 'draft'. If moz-phab sets the status to 'changes-planned' using --wip, BMO feed daemon will just leave it as is and it will be up to the user or moz-phab to transistion it to 'request-review' status.

Copy link
Collaborator

@globau globau Oct 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem with this change is it doesn't address the bug in question.

As we've changed the meaning of Draft from Phabricator's default of work-in-progress to not-yet-processed-by-bugzilla we need to ensure the draft badge is never displayed once phabbugz has processed a revision.

Changing the revision's status to request-review it isn't a reflection of the user's intent that a WIP revision should be in a changes-planned state. I understand that right now that's the only way to clear the draft.broadcast property, but it's bound to be more confusing than leaving the draft badge visible.

I suspect the right thing to do is to remove the code inDifferentialRevisionViewController.php which displays the draft badge/tag when shouldBroadcast is false.

As the draft.broadcast property impacts a revision's visibility in the feed, if we don't set it to true then a revision won't be updated as the bug changes (eg. if a bug is made secure).

We might have to add a way to directly set draft.broadcast to true without setting the status to request-review.

@dklawren dklawren requested a review from globau October 1, 2019 21:55
INFO("Moving from draft to needs-review");
# Removing draft status
if ($is_new && $revision->status eq 'draft') {
INFO("Removing draft status");
Copy link
Collaborator

@globau globau Oct 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem with this change is it doesn't address the bug in question.

As we've changed the meaning of Draft from Phabricator's default of work-in-progress to not-yet-processed-by-bugzilla we need to ensure the draft badge is never displayed once phabbugz has processed a revision.

Changing the revision's status to request-review it isn't a reflection of the user's intent that a WIP revision should be in a changes-planned state. I understand that right now that's the only way to clear the draft.broadcast property, but it's bound to be more confusing than leaving the draft badge visible.

I suspect the right thing to do is to remove the code inDifferentialRevisionViewController.php which displays the draft badge/tag when shouldBroadcast is false.

As the draft.broadcast property impacts a revision's visibility in the feed, if we don't set it to true then a revision won't be updated as the bug changes (eg. if a bug is made secure).

We might have to add a way to directly set draft.broadcast to true without setting the status to request-review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants