Page MenuHomePhabricator

scap backport: KeyError: '/srv/mediawiki-staging/php-1.40.0-wmf.12'
Open, Needs TriagePublic

Description

scap backports triggers KeyError: '/srv/mediawiki-staging/php-1.40.0-wmf.12' when wmf.12 is not yet deployed to any Wikimedia wiki. Transcript:

[urbanecm@deploy1002 ~]$ scap backport 856551 861475
21:32:51 Checking whether changes are in a branch and version deployed to production...
21:32:51 Checking for relation chains and Depends-Ons...
21:32:51 Change '856551' validated for backport
21:32:51 Change '861475', project 'extensions/DiscussionTools', branches '['wmf/1.40.0-wmf.12']' not found in any deployed wikiversion. Deployed wikiversions: ['1.40.0-wmf.10']
Continue with Backport? (y/n): y
[...]
Fetching submodule extensions/DiscussionTools
From https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
   76199b74..5a524d0f  master            -> origin/master
   ea54a8fa..6efb038a  wmf/1.40.0-wmf.12 -> origin/wmf/1.40.0-wmf.12
21:33:10 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 137, in _do_backport
    self._confirm_commits_to_sync(change_details)
  File "/var/lib/scap/scap/lib/python3.7/site-packages/scap/plugins/backport.py", line 593, in _confirm_commits_to_sync
    repo_commits = self._collect_commit_fingerprints(change_details)
  File "/var/lib/scap/scap/lib/python3.7/site-packages/scap/plugins/backport.py", line 573, in _collect_commit_fingerprints
    repo_commits[repo_location].add(commit)
KeyError: '/srv/mediawiki-staging/php-1.40.0-wmf.12'
21:33:10 backport failed: <KeyError> '/srv/mediawiki-staging/php-1.40.0-wmf.12'
[urbanecm@deploy1002 ~]$

scap should sync even if no wiki has wmf.12 (yet), assuming the code's at deployment host. If the code's not at deployment host, it should just merge and abort (similar to beta-only filechanges).