You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bedevere shouldn't add "awaiting review" label on draft PRs #554
I noticed that when opening draft PRs on the cpython repo, Bedevere still goes ahead and adds the "awaiting review" label.
I don't want to spam with review requests for PRs that are not ready for review (hence "draft"), so I'd like to suggest modifying the state machine to acknowledge the draft state (e.g. don't add any labels until the PR is published).
Reacted by Jelle Zijlstra, Mariatta and Alex Waygood
Since the webhook event sends the draft status as True or False, we can use that to determine whether or not we should apply the label when the PR is opened.
if event.data["draft"] is False:
# apply label
We should also add apply the label when the PR was changed from draft to ready to review. So we may need to add the decorator @router.register("pull_request", action="edited").
Activity
itamaro commentedon May 1, 2023
I'm happy to try to make this change myself (maybe with some guidance as I never touched this codebase before :) )
Mariatta commentedon May 1, 2023
I think the main change is on here:
https://github.com/python/bedevere/blob/main/bedevere/stage.py#L104
Here, we're handling the "pull_request.opened" webhook event, and apply either the
awaiting revieworawaiting core reviewlabel.Since the webhook event sends the
draftstatus as True or False, we can use that to determine whether or not we should apply the label when the PR is opened.We should also add apply the label when the PR was changed from
drafttoready to review. So we may need to add the decorator@router.register("pull_request", action="edited").Mariatta commentedon May 1, 2023
And I guess we should also handle the situation when the PR was changed from "ready to review" back to the "draft" state.
pythongh-554: Handle Draft PRs
pythongh-554: Handle Draft PRs
pythongh-554: Handle Draft PRs (python#555)