Last modified: 2013-03-20 13:36:19 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T47719, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 45719 - jenkins-bot takes the liberty of merging
jenkins-bot takes the liberty of merging
Status: RESOLVED WORKSFORME
Product: Wikimedia
Classification: Unclassified
Continuous integration (Other open bugs)
wmf-deployment
All All
: Normal major (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-05 00:19 UTC by Adam Wight
Modified: 2013-03-20 13:36 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Adam Wight 2013-03-05 00:19:51 UTC
See the comment history for https://gerrit.wikimedia.org/r/#/c/49187/

The last action I took was to comment and CR+2, then stepped away to actually verify.  When I returned to enter my verification and merge, the jenkins-bot had already Verified+2 and merged without my interaction.
Comment 1 Chad H. 2013-03-05 00:22:46 UTC
This is by design?

Moving to testing infrastructure, as it's not Git/Gerrit, but rather Jenkins/Zuul.
Comment 2 Antoine "hashar" Musso (WMF) 2013-03-05 00:28:47 UTC
Voting CR+2 is similar to approving the change to land in master. That triggers a job that run the tests and merge the change whenever they have been successful.

We can disable the automatic merge if you prefer. That would just run the unit tests and report the result.
Comment 3 Adam Wight 2013-03-05 00:53:46 UTC
Is there a config setting per project?  I wouldn't want to change the default for other repositories without a community discussion.  FWIW, I found Chad's original announcement of this feature here, http://www.gossamer-threads.com/lists/wiki/wikitech/321317 -- I guess the confusion is caused by not having a precise definition of "Verified+2"?

Anyway, IMO a bot should never merge, there should be explicit user action.
Comment 4 Krinkle 2013-03-05 05:36:31 UTC
(In reply to comment #3)
> Is there a config setting per project?  I wouldn't want to change the default
> for other repositories without a community discussion.  FWIW, I found Chad's
> original announcement of this feature here,
> http://www.gossamer-threads.com/lists/wiki/wikitech/321317 -- I guess the
> confusion is caused by not having a precise definition of "Verified+2"?
> 
> Anyway, IMO a bot should never merge, there should be explicit user action.

The explicit user action is "CR+2".

Don't be fooled by terminology ("review" and "merge"). The design is that things should be tested before merging. And since we can't hook (yet?) hook into the "Merge" button in Gerrit, we instead hook into the "CR+2" submission button, and let Jenkins merge it.

So basically it is this:

- User reviews
- User approves merge
- Bot tests code
- Bot lets merge happen or aborts it

Similar to how an extension can hook into an action in MediaWiki, and if the hook returns false it action is aborted, and if it returns true it is allowed.

However, due to the way Gerrit and Zuul work, you need to be aware of how these buttons work.

So while our intention is this:

* Users does CR -2, -1, 0, +1, +2
* User does Merge. Only merge if you intend to merge, otherwise leave comment with CR+2.
* If no CR+2, abort
* On Merge: Run tests, if fail, disallow merge, otherwise continue

The actual buttons to be used are like this:

* Users does CR -2, -1, 0, +1, +2
* User does CR+2. Only CR+2 if you intend to merge, otherwise leave comment with CR+1.
* On CR+2: Run tests, if fail, score V-2, otherwise merge

This is naturally confusing when not familiar with this fact. Which is +2 is only available to people who are expected to know this, and even of those people most people do not have access to the form for "Verified" score (just Code-Review score), and only have a "Publish score/comments" button, not a "Submit change" (merge) button.
Comment 5 Krinkle 2013-03-05 05:38:00 UTC
(In reply to comment #3)
> Is there a config setting per project?  I wouldn't want to change the default
> for other repositories without a community discussion.  FWIW, I found Chad's
> original announcement of this feature here,
> http://www.gossamer-threads.com/lists/wiki/wikitech/321317 -- I guess the
> confusion is caused by not having a precise definition of "Verified+2"?
> 
> Anyway, IMO a bot should never merge, there should be explicit user action.

The explicit user action is "CR+2".

Don't be fooled by terminology ("review" and "merge"). The design is that
things should be tested before merging. And since we can't (yet?) hook
into the "Merge" button in Gerrit, we instead hook into the "CR+2" submission
button, and let Jenkins merge it.

So basically it is this:

- User reviews
- User approves merge
- Bot tests code
- Bot lets merge happen or aborts it

Similar to how an extension can hook into an action in MediaWiki, and if the
hook returns false the action is aborted, and if it returns true it is allowed.

However, due to the way Gerrit and Zuul work, you need to be aware of how these
buttons work.

So while our intention is this:

* User does CR -2, -1, 0, +1, +2
* User does Merge. Only merge if you intend to merge, otherwise leave comment
with CR+2.
* If no CR+2, abort
* On Merge: Run tests, if fail, disallow merge, otherwise continue

The actual buttons to be used are like this:

* User does CR -2, -1, 0, +1, +2
* User does CR+2. Only CR+2 if you intend to merge, otherwise leave comment
with CR+1.
* On CR+2: Run tests, if fail, score V-2, otherwise merge

This is naturally confusing when not familiar with this fact. Which is +2 is
only available to people who are expected to know this, and even of those
people most people do not have access to the form for "Verified" score (just
Code-Review score), and only have a "Publish score/comments" button, not a
"Submit change" (merge) button.
Comment 6 Antoine "hashar" Musso (WMF) 2013-03-05 16:36:40 UTC
> Anyway, IMO a bot should never merge, there should be explicit user action.

Which is to vote CR+2. The bot is merely an helper that run tests for you and submit the change.

Just list the repositories for which you would prefer Jenkins to not merge and I will be more than happy to change the behavior.
Comment 7 Antoine "hashar" Musso (WMF) 2013-03-20 13:36:19 UTC
Closing bug as working for me, that is the expecting behavior.  It can be disabled on certain repositories by editing Zuul configuration, simply need to remove the gate-and-submit:  pipeline from the project.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links