#1181 Pungi no longer defaults to the master branch on comps
Closed: Fixed 4 years ago by lsedlar. Opened 4 years ago by bowlofeggs.

Greetings!

I noticed that Bodhi's staging deployment was unable to compose a repo today. Pungi crashed with a failure to clone the comps repo:

https://kojipkgs.stg.fedoraproject.org/compose/updates/Fedora-29-updates-testing-20190506.1/logs/global/traceback.global.log

Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/pungi/wrappers/scm.py", line 120, in _clone
    run(["git", "fetch", "--depth=1", repo, branch], workdir=destdir)
  File "/usr/lib/python3.7/site-packages/kobo/shortcuts.py", line 364, in run
    raise exc
RuntimeError: ERROR running command: git fetch --depth=1 https://pagure.io/fedora-comps.git https://pagure.io/fedora-comps.git
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/bin/pungi-koji", line 482, in <module>
    main()
  File "/usr/bin/pungi-koji", line 261, in main
    run_compose(compose, create_latest_link=create_latest_link, latest_link_status=latest_link_status)
  File "/usr/bin/pungi-koji", line 367, in run_compose
    init_phase.start()
  File "/usr/lib/python3.7/site-packages/pungi/phases/base.py", line 64, in start
    self.run()
  File "/usr/lib/python3.7/site-packages/pungi/phases/init.py", line 43, in run
    global_comps = write_global_comps(self.compose)
  File "/usr/lib/python3.7/site-packages/pungi/phases/init.py", line 86, in write_global_comps
    get_file_from_scm(scm_dict, tmp_dir, logger=compose._logger)
  File "/usr/lib/python3.7/site-packages/pungi/wrappers/scm.py", line 255, in get_file_from_scm
    scm.export_file(scm_repo, i, scm_branch=scm_branch, target_dir=tmp_dir)
  File "/usr/lib/python3.7/site-packages/pungi/wrappers/scm.py", line 153, in export_file
    self._clone(scm_root, scm_branch, tmp_dir)
  File "/usr/lib/python3.7/site-packages/pungi/wrappers/scm.py", line 127, in _clone
    run(["git", "checkout", branch], workdir=destdir)
  File "/usr/lib/python3.7/site-packages/kobo/shortcuts.py", line 364, in run
    raise exc
RuntimeError: ERROR running command: git checkout https://pagure.io/fedora-comps.git
Frame run in /usr/lib/python3.7/site-packages/kobo/shortcuts.py at line 364
<CODE>
     357     err_msg = "ERROR running command: %s" % cmd
     358     if logfile:
     359         err_msg += "\nFor more details see %s" % logfile
     360 
     361     if proc.returncode != 0 and not can_fail:
     362         exc = RuntimeError(err_msg)
     363         exc.output = output
-->  364         raise exc
     365 
     366     if proc.returncode != 0 and show_cmd:
     367         print(err_msg, file=sys.stderr)
     368 
     369     if not return_stdout:
     370         output = None
</CODE>
<LOCALS>
         buffer_size = 4096
            can_fail = False
                 cmd = 'git checkout https://pagure.io/fedora-comps.git'
             err_msg = 'ERROR running command: git checkout https://pagure.io/fedora-comps.git'
                 exc = RuntimeError('ERROR running command: git checkout https://pagure.io/fedora-comps.git')
              kwargs = {}
               lines = b''
                 log = None
             logfile = None
              output = b"error: pathspec 'https://pagure.io/fedora-comps.git' did not match any file(s) known to git\n"
                proc = <subprocess.Popen object at 0x7ff841bbf668>
       return_stdout = True
            sentinel = b''
            show_cmd = False
               stdin = None
          stdin_data = None
              stdout = False
  universal_newlines = False
             workdir = '/tmp/tmpdeycei27'
</LOCALS>

I chatted with @puiterwijk about it a bit, and he suggested that it could be due to us assuming a default branch in our pungi config:

comps_file = {
    'scm': 'git',
    'repo': 'https://pagure.io/fedora-comps.git',
    'branch': None, # defaults to cvs/HEAD or git/master
    'file': 'comps-[[ release.branch ]].xml',
    'command': 'make',
}

I tried changing 'branch': None to 'branch': 'master' and that did seem to get this crash to go away.

Was the default intentionally changed?


Heh, it seems that @kevin and I were filing the same issue at the same time. This might be a dupe of https://pagure.io/pungi/issue/1180.

This is a different problem than #1180. The default should remain the same as before, but during other changes I didn't realize there could be explicit None in the config, and so getting the default does not work correctly.

The patch is included in pungi-4.1.36-2.fc29

Metadata Update from @lsedlar:
- Issue set to the milestone: 4.1.37

4 years ago

Login to comment on this ticket.

Metadata
Related Pull Requests
  • #1184 Merged 4 years ago