auto-merge settings issue in Stash Workzone

Bijoy Thomas March 28, 2016

Hi Team

The "Attempt immediate auto-merge" is disabled in Workzone global/Admin settings, but still auto merge is happening upon merge criteria's met.

Here is my requirement

I've a Stash User group as Reviewers in Workzone settings and enabled a merge condition that groupQuota >=1. It waits for at least one group member approval to do the merge. Here I want to disable the auto merge upon merge conditions met.

How we can disable auto merge in Workzone?

Thanks/Bijoy

3 answers

1 accepted

0 votes
Answer accepted
Ulrich Kuhnhardt [IzymesDev]
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.
April 1, 2016

Hi Bijoy,

you are right - currently the auto-merge user must have repository/branch write permissions when the auto-merge configuration is saved - and yes - you can revoke those permissions later.

Another work-around is to use branch patterns - auto-merge user permissions are not enforced during configuration when you use a branch pattern in your auto-merge configuration. So instead of choosing 'master' from the dropdown, use 'refs/heads/master' in the branch pattern style configuration. This way you avoid having to revoke the temporary permissions.

Created https://bitbucket.org/izymesdev/workzone/issues/172/auto-merge-configuration-without-auto

Bijoy Thomas April 4, 2016

Thanks Ulrich for this work-around, this is little more easy compared to add and delete dummy auto merge user.

Ulrich Kuhnhardt [IzymesDev]
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.
July 20, 2016

Resolved with Workzone version 4.3.2 - leave the auto-merge user field blank.

Bijoy Thomas October 17, 2017

Ulrich

I know it's an old post, still checking whether any possibility here.

The empty auto-merge field is working well when we set via UI. We've to set this for a group/bunch of repos via REST call and it's failing with '500 Internal Server Error' when we set auto-merge field empty in JSON object.

Wzautomerge{refName} = "refs/heads/release/1.0"
Wzautomerge{automergeUsers} = []

Am I miss anything here?

Bijoy Thomas October 17, 2017

Even I tried with 'refPattern' and getting the same '500 Internal Server Error'

Wzautomerge{refPattern} = "refs/heads/release/1.0"
Wzautomerge{automergeUsers} = []

Ulrich Kuhnhardt [IzymesDev]
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.
October 17, 2017

What does the json payload (string) exactly look like? 'Wzautomerge' won't be matched by the server as a data element.

Bijoy Thomas October 18, 2017

Sorry it's a PERL hash, which is a key value pair, the same payload we are using for a while and it'll work fine if we pass required values for automergeUsers field.

Ulrich Kuhnhardt [IzymesDev]
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.
October 18, 2017

Can you please create a Workzone support ticket and attach the relevant bitbucket log that contains the stack trace. We'll look into it.

Bijoy Thomas October 19, 2017

The log and trace difficult to get it, since it's managed by a centralized services team. I'll continue to manage with dummy user addition and deletion workaround as mentioned in the beginning of the thread.

One more interesting behavior I found, even-though the return code with message coming as '500 Internal Server Error' the value/condition is adding into the Merge tab page in the Workzone.

Thanks for looking into it.

0 votes
Bijoy Thomas March 29, 2016

Hi Ulrich

Thanks for the prompt and quick response.

Yes, that's what we want. Once conditions are met, we need to manually merge changes. We already disabled "Attempt immediate auto-merge", but still it's merging the changes once the condition is satisfied.

Are we missing any property settings? Or do we need to restart the Stash service to take this change?

As a workaround, currently we are adding a dummy auto-merge user with WRITE enabled at project/repo level for configuring the workzone and remove that user rights once workzone settings enabled, so that auto-merge won't happen upon conditions met.

Thanks in advance

Bijoy

 

 

0 votes
Ulrich Kuhnhardt [IzymesDev]
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.
March 29, 2016

Hi Bijoy,

I understand that you don't want to trigger an auto-merge upon approval. Do I understand correctly that you want to prevent the PR to be merged if the condition is not satisfied and to be merged manually only when the merge condition is satisfied? 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events