Page MenuHomePhabricator

In Gerrit set receive.rejectImplicitMerges = True in All-Projects
Closed, ResolvedPublic

Description

https://gerrit.wikimedia.org/r/#/c/416675/ was a commit from master sent for review to the the wmf branch. Since all ancestors were merged in master, Gerrit kindly assumes that is a merge attempt (of master to wmf) and that is not reflected in the GUI.

When the change got submitted, the master branch ended up being implicitly merged in the wmf branch.

https://wikitech.wikimedia.org/wiki/Incident_documentation/20180306-MasterMergedInWMFBranch


Gerrit 2.13 offers the option receive.rejectImplicitMerges to prevent that implict merge. From Gerrit 2.13 release notes:

''The ‘Reject Implicit Merges’ option can be enabled to prevent non-merge commits from implicitly bringing unwanted changes into a branch. This can happen for example when a commit is made based on one branch but is mistakenly pushed to another, for example based on refs/heads/master but pushed to refs/for/stable.''

At https://gerrit.wikimedia.org/r/#/admin/projects/All-Projects we should set receive.rejectImplicitMerges = TRUE.

Event Timeline

Can this be set in project.config though?

Looking at the name of it, it seems it is a gerrit.config variable.

That is to set receive.rejectImplicitMerges in Gerrit to prevent it from magically merging the master branch into a wmf branch. Typically happens one do a git push refs/publish/wmf from a local master branch.

I don't think there is any good use case for it.

Change 416704 had a related patch set uploaded (by Paladox; owner: Paladox):
[All-Projects@refs/meta/config] Set receive.rejectImplicitMerges to true in project.config

https://gerrit.wikimedia.org/r/416704

Change 416704 merged by Chad:
[All-Projects@refs/meta/config] Set receive.rejectImplicitMerges to true in project.config

https://gerrit.wikimedia.org/r/416704

hashar claimed this task.

mediawiki/core now has:

Reject implicit merges when changes are pushed for review: INHERIT (true)

https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/core