Page MenuHomePhabricator

Jenkins is sometimes not picking up +2 votes, some patches don't get merged
Closed, ResolvedPublic

Description

Jenkins seems to not notice +2 votes sometimes, or doesn't act on them. Here are some patches for which this happened (most are merged by now, after retrying a few times):

If I recall correctly, all of them had a merged base patch, so they were not originally based on master. But none of them had merge conflicts. Several went in after I rebased on master and then gave another +2, but I'm not sure this always worked.

Event Timeline

hashar claimed this task.
hashar subscribed.

I looked at https://gerrit.wikimedia.org/r/c/mediawiki/core/+/608927 , patchset 5 got a CR+2 removed and applied again which in the Zuul scheduler looks like:

2020-07-08 15:08:15,997 DEBUG zuul.Scheduler: Adding trigger event: <TriggerEvent comment-added mediawiki/core master 608927,5 Verified:0, Code-Review:2>

The event is handled by gate-and-submit which is a zuul.DependentPipelineManager:

2020-07-08 15:08:16,000 DEBUG zuul.DependentPipelineManager:
  Event <TriggerEvent comment-added mediawiki/core master 608927,5 Verified:0, Code-Review:2>
    for change <Change 0x7fd606f6c510 608927,5>
    matched <EventFilter types: comment-added branches: (?!^(refs/meta/config|wmf/\d\.\d{2}\.\d-wmf\.\d{1,2}|fundraising/REL|REL)) ignore_deletes: True event_approvals: code-review:2 emails: ^(?!l10n-bot@translatewiki\.net).*$>
   in pipeline <DependentPipelineManager gate-and-submit>
2020-07-08 15:08:16,000 INFO zuul.Scheduler: Adding mediawiki/core, <Change 0x7fd606f6c510 608927,5> to <Pipeline gate-and-submit>

The pipeline then checks whether the change can actually be added in the queue:

2020-07-08 15:08:16,001 DEBUG zuul.DependentPipelineManager: Considering adding change <Change 0x7fd606f6c510 608927,5>
2020-07-08 15:08:16,001 DEBUG zuul.DependentPipelineManager: Checking for changes needed by <Change 0x7fd606f6c510 608927,5>:
2020-07-08 15:08:16,002 DEBUG zuul.DependentPipelineManager:   Change <Change 0x7fd606f6c510 608927,5> needs change <Change 0x7fd64866f610 579253,9>:
2020-07-08 15:08:16,002 DEBUG zuul.DependentPipelineManager:   Change <Change 0x7fd64866f610 579253,9> is needed but can not be merged
2020-07-08 15:08:16,002 DEBUG zuul.DependentPipelineManager: Failed to enqueue changes ahead of <Change 0x7fd606f6c510 608927,5>

And in this case the pipeline refuses the change because: Change 579253,9 is needed but can not be merged. The change is needed because it is the parent change in Gerrit.

When adding the event, Zuul queries metadata from Gerrit (that happened before the logs above):

2020-07-08 15:08:15,556 INFO zuul.source.Gerrit: Updating <Change 0x7fd606f6c510 608927,5>
2020-07-08 15:08:15,790 DEBUG zuul.source.Gerrit: Updating <Change 0x7fd606f6c510 608927,5>: Getting git-dependent change 579253,9
2020-07-08 15:08:15,790 DEBUG zuul.source.Gerrit: Updating <Change 0x7fd606f6c510 608927,5>: Running query message:Id03ab3e52e486f19699b7119974efad637c06887 to find changes needed-by

So from Gerrit, Zuul knows that 608927,5 has a parent change 579253,9. The information comes from the git topology and is reported by Gerrit (git-dependent).

https://gerrit.wikimedia.org/r/c/mediawiki/core/+/579253 was closed/merged the day before but at patchset 11.

Looks like Zuul got confused and could not detect the needed change was not at the latest patchset, which might be due to some outdated cache. Anyway it was an obsolete patchset and https://gerrit.wikimedia.org/r/c/mediawiki/core/+/608927 needed a rebase.

The issue got solved by rebasing the chain of changes.