Page MenuHomePhabricator

scap backport fails with "Multiple changes found"
Closed, DuplicatePublicBUG REPORT

Description

tgr@deploy1002:/srv/mediawiki-staging$ scap backport 868052
22:50:36 Checking whether changes are in a branch and version deployed to production...
22:50:36 Checking for relation chains and Depends-Ons...
22:50:36 Status: 404
22:50:36 Multiple changes found for Id7223ee4953a3e066d6028a41072c7369ea1ce88

22:50:36 Unhandled error:
Traceback (most recent call last):
  File "/var/lib/scap/scap/lib/python3.7/site-packages/scap/cli.py", line 522, in run
    exit_status = app.main(app.extra_arguments)
  File "/var/lib/scap/scap/lib/python3.7/site-packages/scap/plugins/backport.py", line 110, in main
    self._do_backport(change_numbers, change_details)
  File "/var/lib/scap/scap/lib/python3.7/site-packages/scap/plugins/backport.py", line 129, in _do_backport
    self._validate_backports(change_details, change_numbers)
  File "/var/lib/scap/scap/lib/python3.7/site-packages/scap/plugins/backport.py", line 411, in _validate_backports
    self._validate_dependencies(detail, change_numbers)
  File "/var/lib/scap/scap/lib/python3.7/site-packages/scap/plugins/backport.py", line 429, in _validate_dependencies
    deps.update(self._get_depends_ons(project_branch_id, change_number))
  File "/var/lib/scap/scap/lib/python3.7/site-packages/scap/plugins/backport.py", line 468, in _get_depends_ons
    deps.update(self._get_depends_ons(dep_change_id, dep_change_number))
  File "/var/lib/scap/scap/lib/python3.7/site-packages/scap/plugins/backport.py", line 456, in _get_depends_ons
    depends_ons = self.gerrit.depends_ons(change_id).get()
  File "/var/lib/scap/scap/lib/python3.7/site-packages/scap/plugins/gerrit.py", line 175, in get
    return self.load(res)
  File "/var/lib/scap/scap/lib/python3.7/site-packages/scap/plugins/gerrit.py", line 193, in load
    "Request Failed: %s %s %s" % (res.url, res.status_code, res.text)
Exception: Request Failed: https://gerrit.wikimedia.org/r/changes/Id7223ee4953a3e066d6028a41072c7369ea1ce88/revisions/current/crd 404 Multiple changes found for Id7223ee4953a3e066d6028a41072c7369ea1ce88

22:50:36 backport failed: <Exception> Request Failed: https://gerrit.wikimedia.org/r/changes/Id7223ee4953a3e066d6028a41072c7369ea1ce88/revisions/current/crd 404 Multiple changes found for Id7223ee4953a3e066d6028a41072c7369ea1ce88

It's not that uncommon for a depndency of a backport to itself have a backport. The script should probably just check that the dependency exists and is merged on the same branch when that is the case. (It should not check the branch when there is only one changeset with that ID, though. It could be a config change etc. with a different branch structure.)