Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

custom merge-check

Irina Zagarina February 5, 2022

Hi Guys) 

We need a merge-check which checks revision of target branch. Here are more details:

If pull request has been created for a branch with one revision and this revision was updated after merging another pull-request - we should get revisions mismatch for first pull-request, since the state of target branch before merging another pull-request and after merging is different.


In order to bypass this merge check - it will be enough to restart build for pull-request

Maybe you know some plugin?

Thanks in advance :)

1 answer

1 accepted

0 votes
Answer accepted
Ulrich Kuhnhardt _IzymesCo_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
February 6, 2022

Hi Irina, 

I understand that after a pull request's target branch revision changed (it has been rescoped) you would like to block it from merging?

Can you clarify what 'build for pull request' means for your use case?

It's possible to build and test for the _source_ revision of the PR or the the _target_ revision.

You can also automatically sync the current source branch with the latest target branch after it was updated and trigger a build for the updated (rescoped) source branch.

Irina Zagarina February 8, 2022

Hi Ulrich)

Thanks for your reply.

As for the first question - you are absolutely right. 

As for the solution, seems I did not get it. Can you give more details?

Also we do not need the automation. Maybe some warning and notification will be fine.

That is why we are looking for some plugin.

Thanks for looking into this.

Ulrich Kuhnhardt _IzymesCo_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
February 10, 2022

I suggest the following approach to accomodate your use case:

1. Enable repository merge-check and require a minimum of one reviewer approval

2. Add a suitable post-receive hook to your repository from the MP (click the 'Add hook' button in your repository settings >> hooks >> Add Hook) (#1). The hook should un-approve reviewers on all open pull requests  to the protected branch.

3. Enable the hook for your protected branches like 'develop' or 'release'. Now, if a PR is merged to the protected branch all open PRs will be un-approved and because of (1) they can't be merged.

We have developed Workzone - an all-round tool that helps teams to configure their PR workflow. Here is a screenshot of the available hooks.

wzhooks.png

It'll do the job, and much more, if you need more control how your pull requests are handled.

Let me know if I can be of any further assistance. 

Best, Ulrich

Irina Zagarina February 14, 2022

Hello Ulrich)

Thanks for the detailed reply.

We have installed an app to test. Have a good one!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events