Page MenuHomePhabricator

Change Gerrit default submit strategy to 'Rebase if Necessary' and allowing content merge
Closed, ResolvedPublic

Description

When a change is submitted, Gerrit has several strategies to get the patches in the repos known has submit strategies. Gerrit defaults to merge if necessary and allowing Gerrit to merge content.

That was changed in March 2018 to use the fast forward only strategy and disallowing merge content: https://gerrit.wikimedia.org/g/All-Projects/+/b1b342074bf7bf93f9b0faace81038455529e54e%5E!/#F0 I think it is a poor default and it should be changed to Rebase if necessary and allowing content merge.

prior work

operations/puppet used Fast forward only which caused SRE to race on rebasing their change T224033 and were moved to Rebase if necessary. I previously did it for the whole of integration namespace and I am looking back.

Under the mediawiki namespace that is set to Merge if necessary and allow content merges.

search/ and wikimedia/discovery/ were changed to it as well (T255509)

TODO

We should probably audit the current configurations for all repositories.

Docs
submit.action
submit.mergeContent

Event Timeline

Change #1133140 had a related patch set uploaded (by Hashar; author: Hashar):

[All-Projects@refs/meta/config] Set submit strategy to rebase if necessary with contentmerge

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

Change #1134018 had a related patch set uploaded (by Hashar; author: Hashar):

[integration/gerrit-admin@master] Tool to inspect projects submit strategies

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

I wrote a script that fectch the projects configuration and report the submit strategy and content merge status:

$ ./submit-strategies -p wikipedia
| Project                           | Strategy                  | Inheritable        | Allow merge              |
|-----------------------------------|---------------------------|--------------------|--------------------------|
| wikipedia                         | Merge If Necessary        | Fast Forward Only  | True                     |
| wikipedia/gadgets                 | Same (Merge If Necessary) | Merge If Necessary | True (same as inherited) |
| wikipedia/gadgets/Checkers        | Same (Merge If Necessary) | Merge If Necessary | True (same as inherited) |
| wikipedia/wikiwidgets             | Same (Merge If Necessary) | Merge If Necessary | True (same as inherited) |
| wikipedia/wikiwidgets/Automata    | Same (Merge If Necessary) | Merge If Necessary | True (same as inherited) |
| wikipedia/wikiwidgets/Formicarium | Merge If Necessary        | Fast Forward Only  | True                     |
| wikipedia/wikiwidgets/Vivarium    | Merge If Necessary        | Fast Forward Only  | True                     |
| wikipedia/wikiwidgets/WikiWidgets | Same (Merge If Necessary) | Merge If Necessary | True (same as inherited) |

That would make it easier to make changes.

Change #1134018 merged by jenkins-bot:

[integration/gerrit-admin@master] Tool to inspect projects submit strategies

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

Mentioned in SAL (#wikimedia-releng) [2025-06-30T13:31:58Z] <hashar> gerrit: change performance/* submit strategy to "Rebase if Necessary" and "Allow content merge" | T390719

Mentioned in SAL (#wikimedia-releng) [2025-06-30T13:37:45Z] <hashar> gerrit: change mediawiki/libs/* submit strategy to "Rebase if Necessary" and "Allow content merge" | T390719

Mentioned in SAL (#wikimedia-releng) [2025-06-30T13:57:08Z] <hashar> gerrit: change labs/* submit strategy to "Rebase if Necessary" and "Allow content merge" | T390719

Mentioned in SAL (#wikimedia-releng) [2025-06-30T16:37:55Z] <hashar> gerrit: change wikimedia/fundraising/* submit strategy to "Rebase if Necessary" and "Allow content merge" | T390719

Mentioned in SAL (#wikimedia-releng) [2025-07-04T13:24:15Z] <hashar> gerrit: changed All-Projects default submit strategy to Rebase if Necessary. Does not affect mediawiki/* or operations/* among others # T390719

Change #1133140 abandoned by Hashar:

[All-Projects@refs/meta/config] Set submit strategy to rebase if necessary with contentmerge

Reason:

I have made the change (30f68346884142412db1e6ee56b06b45dd768724) and I will eventually apply the same change to `mediawiki` and `operations` namespaces.

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

Mentioned in SAL (#wikimedia-releng) [2025-07-07T08:45:25Z] <hashar> gerrit: change mediawiki/* submit strategy to "Rebase if Necessary" and "Allow content merge" | T390719

Mentioned in SAL (#wikimedia-releng) [2025-07-07T08:45:30Z] <hashar> gerrit: change operations/* submit strategy to "Rebase if Necessary" and "Allow content merge" | T390719