pull-request merge check - do not remove approvals if branch is updated with no changes in pull-requ

Rajeev Naik August 26, 2019

Hi Team,

Whenever we sync our feature branch, then the existing pull request to development branch will not have the changes because that is already present in dev branches. But if there were approvals and then we sync, it will remove the approvals. We do not want it to remove if there are no code changes in pull-request. Please let me know if we can achieve this. 

2 comments

Jimmy Seddon
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 27, 2019

Hi @Rajeev Naik,

Just so I have a clear understanding of what you are asking, if you have a feature branch let's call it "Feature A", you do some work on that branch and when you are ready you create a pull request targeting the development branch.  Because your reviewers weren't fast enough, there are changes that you need to sync into your feature branch from the development branch before you can merge your pull request.  When you sync these changes, the approvals on the pull request are being removed automatically?  Is this correct?

Can you also let me know if you are using the Cloud or Server version of BitBucket and if you are on server what version of Server you are running.

We are running Server version 6.4.0 and from what I have seen the only time approvals are removed is if you have this setting checked:

PullRequestSettings.JPG

And when you performed the sync from the development branch there were conflicts that required a new commit to be created to resolve the conflicts.

I hope that helps!

-Jimmy

Rajeev Naik August 27, 2019

Hi, @Jimmy Seddon Thank you for your comment.

I was expecting this checkbox to be conditional. i.e. unapprove automatically only if the new change is visible in pull-request.

Example, say am working on 'Feature A' branch (created from master) and have commit and pull-request to development branch is open and got reviews. Another person worked on another branch 'Feature B' and made some code changes, then moved to the development branch and then moved to the master branch. Now I will try to sync my branch with master. In this case, I will get 'Feature B' changes into my branch. Since it is also in the development branch, there won't be any new code changes in pull-request to review (not considering the conflict scenario). So, we don't want it to remove approvals.

We are using cloud service.

Julius Davies _bit-booster_com_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 27, 2019

I don't think there's anything for Bitbucket Cloud to handle this problem - at least not yet. If you were on Bitbucket Server (on-prem Bitbucket) I would tell you to look into two plugins (one free, one paid):

1.  Auto Unapprove for Bitbucket Server (free) - changelog for version 2.2.0 shows how it switched its logic to implement dropping approvals as per the logic you're requested here (e.g., sync merges should not cause approvals to drop).

2.  PR-Booster for Bitbucket Server (paid) - set the "Automatically Withdraw Approvals" setting to "Yes - For Significant Pushes".

 

Full disclosure:  my company maintains the paid "PR-Booster for Bitbucket Server" plugin.

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events