-
Notifications
You must be signed in to change notification settings - Fork 17
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
Any way to block automerge if there is "Needs work" from one of the reviewers? #56
Comments
Almost finished PR with "Block merge if PR needs work" option, will open soon. |
The easiest path is to track when a required reviewer flags a PR as needing work. Bitbucket doesn't make it easy or clean to have per-item persistence, so I'm somewhat hesitant to start introducing that unless it's absolutely necessary. Does the clearing of the "Needs work" value happen in the current version of Bitbucket? It's possible this is behavior they fixed later on. |
We can simply lookup
We're definitely seeing this on |
Are you referring to this? https://developer.atlassian.com/static/javadoc/stash.old-perms-pre-feb4/1.3.0/api/reference/com/atlassian/stash/pull/PullRequestService.html#getActivities(int, long, com.atlassian.stash.util.PageRequest) I haven't used that particular API method before, does it expose the full history of approvals for each participant? |
Yes, I'm referring to this API, I haven't used it yet, but looks like we should be able to get as much entries as we need. Moreover we can optimize it: knowing list of reviewers we can stop looking through PR Activity if we found that latest statuses of the reviewers are not blocking it from merge. For example if PR has 3 reviewers and first page of |
If it has the data, then I think this is approach to take. Did you want to take a crack at this? |
I can, but I will have time for it only in 1-2 weeks. I can review your PR if you'll take this :D |
Sure, I'll try to take a look at this tomorrow. |
Great! Thank you for doing this and for plugin in general, really helps us 👍 |
Sorry for the delay, the holidays kinda wrecked my free time for a while. I tried to test this out on 4.5.2 and I'm not actually seeing the behavior you're describing. Here's what I did:
No prior approvals were removed and the PR stayed open. I confirmed that the automerge did work when the PR was fully approved. Is there another plugin or setting that's causing this issue for you? |
Imagine we have 6 developers in the team and 4 reviewers are required to merge (auto or manually) the PR.
If one of the reviewers sets "Needs work" on a PR, automerge still happens if 4 reviewers will approve it and CI will pass.
Is there any way to prevent auto merge if there is at least one "Needs work" on a PR? Thanks!
The text was updated successfully, but these errors were encountered: