Page MenuHomePhabricator

Zuul get confused when querying a change that yields two entries
Closed, ResolvedPublic

Description

https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/MediaWikiFarm/+/433653/ fails consantly on zuul-merger. Turns out it attempts to merge an unrelated change from wikidata/query/gui https://gerrit.wikimedia.org/r/#/c/wikidata/query/gui/+/431713/ which indeed fails to merge.

The reason is zuul does a gerrit query 433653 to obtain informations for MediaWikiFarm parent change but it yields two entries:

change I02d72045ca288ff518d59cc9675a9e587784722f
  project: wikidata/query/gui
  branch: master
  topic: queryTags
  id: I02d72045ca288ff518d59cc9675a9e587784722f
  number: 431713
  subject: Update to new JQCloud version
  owner:
    name: Jonas Kress (WMDE)
    email: jonas.kress@wikimedia.de
    username: jk
  url: https://gerrit.wikimedia.org/r/431713
  commitMessage: Update to new JQCloud version
                 
                 Change-Id: I02d72045ca288ff518d59cc9675a9e587784722f
  createdOn: 2018-05-08 08:42:54 UTC
  lastUpdated: 2018-06-01 17:06:40 UTC
  open: true
  status: NEW
change Iedd0f3217c185382eb0ca35c59a4cd2f65de43c8
  project: mediawiki/extensions/MediaWikiFarm
  branch: master
  topic: L10n
  id: Iedd0f3217c185382eb0ca35c59a4cd2f65de43c8
  number: 433653
  subject: Localisation updates from https://translatewiki.net.
  owner:
    name: L10n-bot
    email: l10n-bot@translatewiki.net
    username: l10n-bot
  url: https://gerrit.wikimedia.org/r/433653
  commitMessage: Localisation updates from https://translatewiki.net.
                 
                 Change-Id: Iedd0f3217c185382eb0ca35c59a4cd2f65de43c8
  createdOn: 2018-05-17 20:19:46 UTC
  lastUpdated: 2018-05-17 20:20:37 UTC
  open: false
  status: MERGED

Event Timeline

hashar created this task.Jul 6 2018, 1:12 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 6 2018, 1:12 PM
hashar added a comment.Jul 6 2018, 1:17 PM

Zuul does:

gerrit query --all-approvals --comments --commit-message --current-patch-set --dependencies --files --patch-sets --submit-records 433653

That matches the first patchset of the unrelated repository which has commit sha1 433653c0bb99fd520a2a161ac4e704da9bcff8bf

hashar updated the task description. (Show Details)Jul 6 2018, 1:21 PM

Change 475904 had a related patch set uploaded (by Hashar; owner: Hashar):
[integration/zuul@patch-queue/debian/jessie-wikimedia] gerrit: query solely for change not anything

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

It took me a while to come back to this task, I apologize. The patch above should fix it, I have to test it a bit before deploying to production.

hashar added a subscriber: Seb35.Nov 26 2018, 10:52 PM

+ @Seb35 for information since the bug has hit MediaWikiFarm.

hashar claimed this task.Nov 26 2018, 10:53 PM
hashar moved this task from Backlog to Bugs on the Zuul board.Nov 26 2018, 10:54 PM

Upstream Zuul still have the issue:

zuul/driver/gerrit/gerritconnection.py
class GerritConnection(BaseConnection):

    def query(self, query):
        args = '--all-approvals --comments --commit-message'
        args += ' --current-patch-set --dependencies --files'
        args += ' --patch-sets --submit-records'
        cmd = 'gerrit query --format json %s %s' % (
            args, query)

    def _updateChange(self, change, history=None):
        data = self.query(change.number)
        change._data = data

    def isMerged(self, change, head=None):
        data = self.query(change.number)
        change._data = data

Patch sent upstream: https://review.openstack.org/620328 gerrit: use change: when querying changes

hashar moved this task from Backlog to In-progress on the Release-Engineering-Team (Kanban) board.
hashar moved this task from Backlog to Patch proposed upstream on the Upstream board.
hashar removed a project: Gerrit.

It is not a Gerrit issue but a bug in Zuul.

I have missed the opportunity to polish up the tests for the upstream change. I have not ported it for our Zuul version either :(

hashar triaged this task as High priority.Mar 19 2019, 8:39 PM
hashar added a subscriber: Paladox.Mar 25 2019, 9:18 PM

This task is from summer 2018 and I have missed it a few time. Eventually went back to it last week but got distracted.

I really want to get our Zuul upgraded with the few pending patches we have. From there, I can then visit @Paladox work to migrate the deployment to use scap3 and wheels (instead of dh_virtualenv).

Meanwhile, I tweaked my version of the patch that I had send to upstream https://review.openstack.org/#/c/620328/ . It passed tests and got approved.

Change 475904 had a related patch set uploaded (by Hashar; owner: Hashar):
[integration/zuul@patch-queue/debian/jessie-wikimedia] gerrit: query solely for change not anything

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

Change 475904 merged by Hashar:
[integration/zuul@patch-queue/debian/jessie-wikimedia] WMF: backport gerrit: use change: when querying changes

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

Change 501325 had a related patch set uploaded (by Hashar; owner: Hashar):
[integration/zuul@debian/jessie-wikimedia] 2.5.1-wmf6: bugfix and Gerrit 2.16 support

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

Change 501325 merged by jenkins-bot:
[integration/zuul@debian/jessie-wikimedia] 2.5.1-wmf6: bugfix and Gerrit 2.16 support

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

hashar closed this task as Resolved.Apr 8 2019, 12:26 PM

I have upgraded Zuul to 2.5.1-wmf6 (T208426). It now queries changes with change:%s instead of just %s and thus we would no more have a collision of the request change number with some random patchset from a different repo/change.

I did a recheck on the two changes given in examples and they managed to merge.

https://gerrit.wikimedia.org/r/#/c/wikidata/query/gui/+/431713/
https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/MediaWikiFarm/+/433653/