prepare-upload fails too silently

Bug #1942865 reported by Christian Ehrhardt 
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
git-ubuntu
Fix Released
Undecided
Robie Basak

Bug Description

Feel free to ignore this if we redesign push-for-upload away as part of "prepare-upload", but if not then this is an issue.

If it fails, it doesn't fail obviously enough.

Example - I was in a detached head which it can't use the name thereof.

$ dpkg-buildpackage -S -nc -d $(git ubuntu push-for-upload)
Traceback (most recent call last):
  File "/snap/git-ubuntu/623/usr/bin/git-ubuntu", line 11, in <module>
    load_entry_point('gitubuntu==1.0', 'console_scripts', 'git-ubuntu')()
  File "/snap/git-ubuntu/623/usr/lib/python3/dist-packages/gitubuntu/__main__.py", line 270, in main
    sys.exit(args.func(args))
  File "/snap/git-ubuntu/623/usr/lib/python3/dist-packages/gitubuntu/push_for_upload.py", line 127, in cli_main
    print(main(
  File "/snap/git-ubuntu/623/usr/lib/python3/dist-packages/gitubuntu/push_for_upload.py", line 80, in main
    assert not repo.raw_repo.head_is_detached
AssertionError
dpkg-buildpackage: info: source package postfix
dpkg-buildpackage: info: source version 3.5.6-1ubuntu

The problem is that the .changes are all fine, just missing the entries.
I'd ask that in the error-case we add like "--please --fail --me --as --I --aborted" which then breaks dpkg-buildpackage and helps to not be missed.
TBH I didn't see it in the console as it scrolls out so fast, only that I still control the created .changes file made me look for it.

Related branches

Robie Basak (racb)
tags: added: prepare-upload
Robie Basak (racb)
summary: - push-for-upload fails too silently
+ prepare-upload fails too silently
Robie Basak (racb)
Changed in usd-importer:
assignee: nobody → Robie Basak (racb)
status: New → In Progress
Revision history for this message
Bryce Harrington (bryce) wrote (last edit ):
Download full text (5.1 KiB)

This situation appears to also arise when running the command on a branch that needs a force-push (e.g. after applying changes from an MP review). And Robie's proposed solution sounds like it will address this use case as well.

Example output:

merges-jammy+22.04:~/pkg/Apache2/merge-v2.4.52-1/apache2-gu$ debuild -S -sa -uc -us $(git ubuntu prepare-upload args)
To ssh://git.launchpad.net/~bryce/ubuntu/+source/apache2
 ! [rejected] merge-v2.4.52-1-jammy -> merge-v2.4.52-1-jammy (non-fast-forward)
error: failed to push some refs to 'ssh://<email address hidden>/~bryce/ubuntu/+source/apache2'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
02/04/2022 18:30:35 - ERROR:Command exited 1: git push bryce refs/heads/merge-v2.4.52-1-jammy:refs/heads/merge-v2.4.52-1-jammy
02/04/2022 18:30:35 - ERROR:stdout: [Not captured]

02/04/2022 18:30:35 - ERROR:stderr: [Not captured]

Traceback (most recent call last):
  File "/snap/git-ubuntu/773/usr/bin/git-ubuntu", line 11, in <module>
    load_entry_point('gitubuntu==1.0', 'console_scripts', 'git-ubuntu')()
  File "/snap/git-ubuntu/773/usr/lib/python3/dist-packages/gitubuntu/__main__.py", line 270, in main
    sys.exit(args.func(args))
  File "/snap/git-ubuntu/773/usr/lib/python3/dist-packages/gitubuntu/prepare_upload.py", line 170, in cli_printargs
    headers = push(
  File "/snap/git-ubuntu/773/usr/lib/python3/dist-packages/gitubuntu/prepare_upload.py", line 125, in push
    repo.git_run(
  File "/snap/git-ubuntu/773/usr/lib/python3/dist-packages/gitubuntu/git_repository.py", line 1802, in git_run
    return git_run(
  File "/snap/git-ubuntu/773/usr/lib/python3/dist-packages/gitubuntu/git_repository.py", line 267, in git_run
    return run(['git'] + list(args), env=env, **kwargs)
  File "/snap/git-ubuntu/773/usr/lib/python3/dist-packages/gitubuntu/run.py", line 87, in run
    raise e
  File "/snap/git-ubuntu/773/usr/lib/python3/dist-packages/gitubuntu/run.py", line 64, in run
    cp = subprocess.run(
  File "/snap/git-ubuntu/773/usr/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git', 'push', 'bryce', 'refs/heads/merge-v2.4.52-1-jammy:refs/heads/merge-v2.4.52-1-jammy']' returned non-zero exit status 1.
 dpkg-buildpackage -us -uc -ui -i -I.bzr -I.svn -I.git -S -sa
dpkg-buildpackage: info: source package apache2
dpkg-buildpackage: info: source version 2.4.52-1ubuntu1
dpkg-buildpackage: info: source distribution jammy
dpkg-buildpackage: info: source changed by Bryce Harrington <email address hidden>
 dpkg-source -i -I.bzr -I.svn -I.git --before-build .
 fakeroot debian/rules clean
dh clean
   dh_clean
 dpkg-source -i -I.bzr -I.svn -I.git -b .
dpkg-source: warning: upstream signing key but no upstream tarball signature
dpkg-source: info: using source format '3.0 (quilt)'
dpkg-source: info: building apache2 using existing ./apache2_2.4.52.orig.tar.gz
dpkg-source: info: using patch list from debi...

Read more...

Robie Basak (racb)
Changed in git-ubuntu:
status: In Progress → Fix Committed
Revision history for this message
Robie Basak (racb) wrote : Fix released in git-ubuntu

Fix released in git-ubuntu version 1.1

Changed in git-ubuntu:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.