prepare-upload-args does not handle error when remote branch cannot be fast-forwarded
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
git-ubuntu |
Fix Released
|
Undecided
|
Robie Basak |
Bug Description
When a branch changes locally, trying to use prepare-upload args crashes if a previous upload was performed using the same branch name.
While this is expected in most cases, it may be an issue when sponsoring uploads since the git-ubuntu user (i.e., the uploader) will not interact directly with their own remote/branch.
We could improve the experience here by providing a better error message or asking if the user want to retry with a force push.
$ dpkg-buildpackage -S -nc -v27.13.6 $(git ubuntu prepare-upload args)
To ssh://git.
! [rejected] upload-
error: failed to push some refs to 'ssh://<email address hidden>
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.
04/06/2023 11:19:41 - ERROR:Command exited 1: git push athos-ribeiro refs/heads/
04/06/2023 11:19:41 - ERROR:stdout: [Not captured]
04/06/2023 11:19:41 - ERROR:stderr: [Not captured]
Traceback (most recent call last):
File "/snap/
load_
File "/snap/
sys.
File "/snap/
headers = push(
File "/snap/
repo.git_run(
File "/snap/
return git_run(
File "/snap/
return run(['git'] + list(args), env=env, **kwargs)
File "/snap/
raise e
File "/snap/
cp = subprocess.run(
File "/snap/
raise CalledProcessEr
subprocess.
dpkg-buildpackage: info: source package ubuntu-
dpkg-buildpackage: info: source version 27.14.4~22.04
dpkg-buildpackage: info: source distribution jammy
dpkg-buildpackage: info: source changed by Renan Rodrigo <email address hidden>
dpkg-source --before-build .
dpkg-buildpackage: warning: building a source package without cleaning up as you asked; it might contain undesired files
dpkg-source -b .
dpkg-source: info: using source format '3.0 (native)'
dpkg-source: info: building ubuntu-
dpkg-source: info: building ubuntu-
dpkg-genbuildinfo --build=source -O../ubuntu-
dpkg-genchanges --build=source -v27.13.6 -O../ubuntu-
dpkg-genchanges: warning: 'since' option specifies non-existing version '27.13.6'
dpkg-genchanges: warning: use newest entry that is earlier than the one specified
dpkg-genchanges: warning: the current version (27.14.4~22.04) is earlier than the previous one (27.14.4)
dpkg-genchanges: info: including full source code in upload
dpkg-source --after-build .
dpkg-buildpackage: info: source-only upload: Debian-native package
signfile ubuntu-
signfile ubuntu-
signfile ubuntu-
Related branches
- Server Team CI bot: Approve (continuous-integration)
- Steve Langasek: Approve
- git-ubuntu developers: Pending requested
-
Diff: 1106 lines (+709/-141)3 files modifiedgitubuntu/prepare_upload.py (+401/-91)
gitubuntu/prepare_upload_test.py (+299/-43)
sandbox/gu-build (+9/-7)
tags: | added: prepare-upload |
summary: |
- prepare-upload-args does not handle errors when remote branch differs + prepare-upload-args does not handle error when remote branch cannot be + fast-forwarded |
Changed in git-ubuntu: | |
status: | New → In Progress |
assignee: | nobody → Robie Basak (racb) |
Fixed in 1.1.