Page MenuHomePhabricator

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

Description fails consantly on zuul-merger. Turns out it attempts to merge an unrelated change from wikidata/query/gui 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
    name: Jonas Kress (WMDE)
    username: jk
  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
    name: L10n-bot
    username: l10n-bot
  commitMessage: Localisation updates from
                 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

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:

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: 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 . 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

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

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

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

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.