prepare-upload verification breaks on non-default but valid remotes

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

Bug Description

Hi,
today I wanted to upload DPDK.
I happened to run into this bug:

$ git ubuntu push-for-upload
Traceback (most recent call last):
  File "/snap/git-ubuntu/624/usr/bin/git-ubuntu", line 11, in <module>
    load_entry_point('gitubuntu==1.0', 'console_scripts', 'git-ubuntu')()
  File "/snap/git-ubuntu/624/usr/lib/python3/dist-packages/gitubuntu/__main__.py", line 270, in main
    sys.exit(args.func(args))
  File "/snap/git-ubuntu/624/usr/lib/python3/dist-packages/gitubuntu/push_for_upload.py", line 127, in cli_main
    print(main(
  File "/snap/git-ubuntu/624/usr/lib/python3/dist-packages/gitubuntu/push_for_upload.py", line 95, in main
    assert gitubuntu.importer.VCS_GIT_URL_VALIDATION.fullmatch(
AssertionError

The assertion per code is:

  VCS_GIT_URL_VALIDATION = re.compile(
      r'https://[A-Za-z0-9_.-]+(/[A-Za-z0-9._~/?=&+-]*)?',
  )

But my remote wasn't set up by git-ubuntu, since I worked on this since the very early days.
Thereby it is:

paelzer ssh://<email address hidden>/~paelzer/ubuntu/+source/dpdk (fetch)
paelzer ssh://<email address hidden>/~paelzer/ubuntu/+source/dpdk (push)

I use ssh for fetch as well which IMHO is just as fine.

So maybe the regexp should do (https|ssh) in place of just https.
Not sure if non secure 'http' might also be an option or '<email address hidden>' as well.

For the time being I've reconfigured it to the following and now it works:
paelzer https://git.launchpad.net/~paelzer/ubuntu/+source/dpdk (fetch)
paelzer ssh://<email address hidden>/~paelzer/ubuntu/+source/dpdk (push)

Related branches

Revision history for this message
Robie Basak (racb) wrote :

Thank you for the report.

ssh://<email address hidden>/ is actually invalid from the importer's point of view since it cannot use that to fetch rich history. However, there's no reason that push-for-upload/prepare-upload can't automatically map that to https://git.launchpad.net/, so I'll leave this bug open to do that.

tags: added: push-for-upload
Changed in usd-importer:
status: New → Triaged
importance: Undecided → Medium
Robie Basak (racb)
tags: added: prepare-upload
removed: push-for-upload
Robie Basak (racb)
summary: - push-for-upload verification breaks on non-default but valid remotes
+ prepare-upload verification breaks on non-default but valid remotes
Robie Basak (racb)
Changed in usd-importer:
assignee: nobody → Robie Basak (racb)
status: Triaged → In Progress
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Just wanted to mention I still keep hitting these every now and then, e.g. today

paelzer ssh://<email address hidden>/~paelzer/ubuntu/+source/needrestart (fetch)
paelzer ssh://<email address hidden>/~paelzer/ubuntu/+source/needrestart (push)

$ git ubuntu prepare-upload args
Traceback (most recent call last):
  File "/snap/git-ubuntu/819/usr/bin/git-ubuntu", line 11, in <module>
    load_entry_point('gitubuntu==1.0', 'console_scripts', 'git-ubuntu')()
  File "/snap/git-ubuntu/819/usr/lib/python3/dist-packages/gitubuntu/__main__.py", line 270, in main
    sys.exit(args.func(args))
  File "/snap/git-ubuntu/819/usr/lib/python3/dist-packages/gitubuntu/prepare_upload.py", line 170, in cli_printargs
    headers = push(
  File "/snap/git-ubuntu/819/usr/lib/python3/dist-packages/gitubuntu/prepare_upload.py", line 112, in push
    assert gitubuntu.importer.VCS_GIT_URL_VALIDATION.fullmatch(
AssertionError

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

A new one, slightly different

$ git remote -v
paelzer https://git.launchpad.net/~paelzer/ubuntu/+source/checksecurity (fetch)
paelzer ssh://<email address hidden>/~paelzer/ubuntu/+source/checksecurity (push)
pkg https://git.launchpad.net/ubuntu/+source/checksecurity (fetch)
pkg ssh://<email address hidden>/ubuntu/+source/checksecurity (push)

$ git ubuntu prepare-upload args
Traceback (most recent call last):
  File "/snap/git-ubuntu/820/usr/bin/git-ubuntu", line 11, in <module>
    load_entry_point('gitubuntu==1.0', 'console_scripts', 'git-ubuntu')()
  File "/snap/git-ubuntu/820/usr/lib/python3/dist-packages/gitubuntu/__main__.py", line 270, in main
    sys.exit(args.func(args))
  File "/snap/git-ubuntu/820/usr/lib/python3/dist-packages/gitubuntu/prepare_upload.py", line 170, in cli_printargs
    headers = push(
  File "/snap/git-ubuntu/820/usr/lib/python3/dist-packages/gitubuntu/prepare_upload.py", line 118, in push
    assert gitubuntu.importer.VCS_GIT_REF_VALIDATION.fullmatch(ref.name)
AssertionError

What is broken here, I do not know :-/
So no workaround for me ...

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

I hit it again, it is not fatal, but annoying.

paelzer ssh://<email address hidden>/~paelzer/ubuntu/+source/openssh (fetch)
paelzer ssh://<email address hidden>/~paelzer/ubuntu/+source/openssh (push)

Fails

Changed my remotes to now be

paelzer https://git.launchpad.net/ubuntu/+source/openssh (fetch)
paelzer ssh://<email address hidden>/~paelzer/ubuntu/+source/openssh (push)

works.

But why do I need to re-discover this each time, seems fixable.

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.