Hi,
I want to reset the PR approvals when the sourceBranch is updated. Thought of doing it using the webhook "Source branch updated" event.
I noticed that clicking on the button "Rebase" in a pull request will trigger the same event as updating the source branch. We do not want to reset the approvals when the PR is rebased, but want to reset the approvals only when new commits are added to source branch. Is there a way to differentiate between these 2 events ?
I have tried using script runner but since the events are same, I couldn't differentiate between them.
All ideas are welcomed. Thanks in advance.
Hi Sheshachandra,
I understand that you are syncing the pull request source branch with the target branch, while a PR is in progress and approvals have already been submitted.
... And you are correct, since rebasing is not an effective code change, why are approvals revoked?
From the Git point of view it is much easier to detect branch sync via _merge_, where you _merge_ the target branch into the source branch.
Workzone (one of our apps) allows you to keep PR approvals on sync _merge_ (not rebase). You can configure this repo or project wide in Workzonen properties (#3).
I agree, keeping approvals after branch sync is a massive time-saver for your teams, that's why we added this option.
Let me know if you need any help setting this up. There's also a demo instance with Workzone so you can have a look around and try it out.
In conclusion, there is an option to keep approvals after branch sync if you use _merge_ sync (instead of rebase) and give Workzone a go.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.