Page MenuHomePhabricator

Jenkins: Set up job in gate-and-submit to avoid submitting "DRAFT" or "WIP" commits
Closed, DeclinedPublic


The job will vote -1. But only in gate-and-submit, when working on it the tests should pass (or have this one be non-voting).

Version: wmf-deployment
Severity: enhancement



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:40 AM
bzimport set Reference to bz46860.
bzimport added a subscriber: Unknown Object (MLST).

I would prefer we do not rely on the commit summary having WIP or DRAFT in it, though we might warn about it.

OpenStack has a patch for Gerrit (might have been upstreamed), that let you flag a change has being a work in progress (see original feature request ).

From Gerrit 2.5 release-notes, the drafts do not send patchset-created events so they should not trigger any job. When they are published we have a new draft-published event which is essentially the same as patchset-created.

I guess voting CodeReview +2 on a draft will thus send no event at all and the change will obviously never enter any pipeline.

Looking at the dashboard of VisualEditor extension that makes a lot of sense :),dashboards/default

$ git-review -l|egrep '(WIP|MERGE)'
70560 master [WIP] Language Inspector Prototype
71641 master [DON'T MERGE] Remove 'mw-editsection-bracket' hack
71285 master [WIP] Do not allow to resize thumb image to be bigger than original file
70346 master [DON'T MERGE] Rich Copy and Paste from External Source
69796 master [DON'T MERGE] Rich paste from external sources
71661 master [WIP] Implement newFromDocumentInsertion, take 2
70981 master [WIP] Math Node UI
68615 master [WIP] Source code editing
70171 master [WIP] Math Node Matcher
69281 master [WIP] Link surface fix for RTL

  • Bug 53405 has been marked as a duplicate of this bug. ***

Revisiting after a while: Zuul does not have support to prevent merge based on a the content of the commit message.

A possibility is to use Code-Review: -2 which will effectively prevent Gerrit from submitting the patch.

Another way would be to add a new label in Gerrit that would be used to flag a change has being in progress which would trigger the gate-and-submit when voted +1. Something like:


+1 Approved
 0 Pending review
-1 Work in progress

Timo thoughts? Or should we just abandon this idea?

(In reply to Antoine "hashar" Musso (WMF) from comment #4)

Revisiting after a while: Zuul does not have support to prevent merge based
on a the content of the commit message.

Really? The Jenkins jobs have a full git checkout, so presumably you could write a jenkins job for gate-and-submit that runs:

git log --oneline | head -1 | fgrep -q WIP

The actual test would be a little more complicated, since you'd want to be sure you were looking at the right side of a merge commit, but either HEAD^1 or HEAD^2 would name the actual patch you're committing in that case.

hashar lowered the priority of this task from Medium to Lowest.Nov 24 2014, 9:55 AM
hashar set Security to None.

There is a patch proposed upstream:

That might let us prevent a change from entering gate-and-submit.

T135245 propose to add a new label in Gerrit Workflow to let users vote -1 and prevent it from being merged.

After all those years, it is not going to happen. Guess it is better handled directly in Gerrit eg via T135245. Gerrit is replacing the draft system with private changes which would suit the WIP convention.