Page MenuHomePhabricator

unbound variable error when calling puppet-merge script with an explicit treeish
Closed, ResolvedPublic

Description

It also seems like it's probably invoking puppet-merge.py incorrectly in this case?

❌cdanis@puppetmaster1001.eqiad.wmnet ~ 🕛☕ sudo puppet-merge 8f00bac   
usage: puppet-merge.py [-h] [-y] [-q] [-d] (-p | -o) sha1
puppet-merge.py: error: unrecognized arguments: 
/usr/local/bin/puppet-merge: line 167: LABS_EXIT: unbound variable

Event Timeline

I took a quick look and it seems the issue is caused when FETCH_HEAD_OR_EMPTY is empty which causes puppet-merge.py to get called with two positional arguments i.e.:

/usr/local/bin/puppet-merge.py --ops 8f00bac541b3bcebcd3df383796aa4d00d8fa5bc ''

I think we should try to push FETH_HEAD to ORIG_ARGS instead of creating the new variable FETCH_HEAD_OR_EMPTY but i only took a very quick look

Change 630897 had a related patch set uploaded (by Jbond; owner: John Bond):
[operations/puppet@production] puppet-merge: correctly handle passing through sha1 vs FETCH_HEAD

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

herron triaged this task as Medium priority.Sep 30 2020, 5:25 PM

Change 630897 merged by Jbond:
[operations/puppet@production] puppet-merge: correctly handle passing through sha1 vs FETCH_HEAD

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

jbond claimed this task.