Last modified: 2014-08-15 10:20:26 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 T62781, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 60781 - [upstream] Gerrit patchset-created event has been changed
[upstream] Gerrit patchset-created event has been changed
Status: RESOLVED FIXED
Product: Wikimedia
Classification: Unclassified
Git/Gerrit (Other open bugs)
wmf-deployment
All All
: High normal (vote)
: ---
Assigned To: christian
: upstream
Depends on:
Blocks: 60769
  Show dependency treegraph
 
Reported: 2014-02-03 20:20 UTC by Antoine "hashar" Musso (WMF)
Modified: 2014-08-15 10:20 UTC (History)
7 users (show)

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


Attachments

Description Antoine "hashar" Musso (WMF) 2014-02-03 20:20:18 UTC
When a patch is rebased via the Gerrit graphical interface, it sends an event of type patchset-created to stream-events listener. The event has an uploader field which used to be the person doing the action, since Gerrit 2.8.1 the uploader field points to the patch author.

An example is change https://gerrit.wikimedia.org/r/#/c/109891/ . The change has been authored and is owned by untrusted user Tinaj1234, hence tests are not run.  I have rebased patchset 3 to trigger the tests did not get triggered.

Looking at Zuul debug log for Gerrit events, the change structure is roughly:

change:
  owner:
    name: Tinaj1234
    project: mediawiki/core
  patchset:
    author:
      name: Tinaj1234
    uploader:
      name: Tinaj1234
  type: patchset-created
  uploader:
    name: Tinaj1234

The uploader field should have pointed to myself, aka hashar.  That was the behavior before our switch to Gerrit 2.8.1.


For each type of event we had a field representing the authenticated person doing the action.  The corresponding map is:

  'patchset-created': 'uploader',
  'draft-published': 'uploader',  # Gerrit 2.5/2.6
  'change-abandoned': 'abandoner',
  'change-restored': 'restorer',
  'change-merged': 'submitter',
  'merge-failed': 'submitter',  # Gerrit 2.5/2.6
  'comment-added': 'author',
  'ref-updated': 'submitter',
  'reviewer-added': 'reviewer',  # Gerrit 2.5/2.6


Aka for the event type 'patchset-created', the account that have done the action is mentioned in the 'uploader' field.
Comment 1 Antoine "hashar" Musso (WMF) 2014-02-20 15:40:28 UTC
Upstream bug: https://code.google.com/p/gerrit/issues/detail?id=2493
Comment 2 christian 2014-02-21 12:00:23 UTC
I have not verified myself, but does this actually break things for
Jenkins/Zuul, or is it just a “nuissance”?
Comment 3 christian 2014-02-22 21:09:31 UTC
Since I'd forget otherwise:

  fd23ab518fbd5a3a8c02badd8583ade36cb30edb
  Refactor Rebase to use PatchSetInserter

is the first affected commit.
Comment 4 Gerrit Notification Bot 2014-02-24 22:58:09 UTC
Change 115316 had a related patch set uploaded by QChris:
Set uploader to current user in "patchset-created" event upon rebasing

https://gerrit.wikimedia.org/r/115316
Comment 5 Antoine "hashar" Musso (WMF) 2014-02-25 10:38:38 UTC
Upstream bug http://code.google.com/p/gerrit/issues/detail?id=2493  has been fixed by Christian (thus assigning bug to him since he did all the job).

Upstream commit is https://gerrit-review.googlesource.com/#/c/54850/ 

Should be included in Gerrit 2.8.2.

Backport of change in our Gerrit copy is proposed at https://gerrit.wikimedia.org/r/115316   I guess whenever it get deployed the issue will be solved :-]
Comment 6 Gerrit Notification Bot 2014-03-18 21:21:44 UTC
Change 115316 merged by QChris:
Set uploader to current user in "patchset-created" event upon rebasing

https://gerrit.wikimedia.org/r/115316
Comment 7 christian 2014-03-18 21:31:46 UTC
It seems new gerrit has been deployed on 2014-03-10 23:30.
Does Zuul get the correct JSON objects now?
Comment 8 Bartosz Dziewoński 2014-03-19 11:40:34 UTC
Yes. (Or at least grrrit-wm does.) Thank you!
Comment 9 Antoine "hashar" Musso (WMF) 2014-03-19 12:42:08 UTC
works in Zuul as well.
Comment 10 Bartosz Dziewoński 2014-04-03 19:20:01 UTC
This is still a problem when one uses the "Cherry Pick" button to cherry-pick a commit to the same branch (to remove dependencies):

[21:14]	<grrrit-wm> (PS5) Prtksxna: Use tooltip role for Popups [extensions/Popups] - https://gerrit.wikimedia.org/r/120344 

(I submitted that patchset using the method above, not Prtksxna.)
Comment 11 Gerrit Notification Bot 2014-04-10 12:53:08 UTC
Change 125181 had a related patch set uploaded by QChris:
Set uploader to current user in "patchset-created" event upon cherry-picking

https://gerrit.wikimedia.org/r/125181
Comment 12 Antoine "hashar" Musso (WMF) 2014-04-10 15:40:01 UTC
Thanks Chris that was quick. I am wondering whether the other events are suffering the same issue (i.e. abandoned patchset).
Comment 13 christian 2014-04-10 21:10:14 UTC
(In reply to Antoine "hashar" Musso from comment #12)
> I am wondering whether the other events are
> suffering the same issue (i.e. abandoned patchset).

I think we should be fine.

For the patchset-created event, I know three ways to trigger it
through the UI:
* Rebasing a change (fixed)
* Cherry-picking a change (fixed)
* Editing commit message (worked already)

(If you know further ways, please let me know)


The draft-published event also has an uploader field. And it is not
set to the current user when publishing a draft. But that is arguably
ok, as the one who publishes a patch set is not necessarily the
uploader of the patch set. Documentation is a bit scarce on that end,
so it's hard to read off intentions from the gerrit devs. But as it's
ok for draft-published, I did not change it there.


All other events come without an uploader field, if grep did not fool
me.
Comment 14 christian 2014-04-10 21:11:25 UTC
I've been told that we probably will not deploy this fix right away, but
wait for gerrit 2.8.4 (which is just around the corner, and will include our
fix).
Comment 15 Gerrit Notification Bot 2014-04-23 23:20:04 UTC
Change 125181 merged by Chad:
Set uploader to current user in "patchset-created" event upon cherry-picking

https://gerrit.wikimedia.org/r/125181
Comment 16 christian 2014-08-15 10:20:26 UTC
Fix has been deployed on 2014-07-08.

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


Navigation
Links