~bryce/git-ubuntu:fix_export_orig_empty_tarballs_traceback

Last commit made on 2021-07-09
Get this branch:
git clone -b fix_export_orig_empty_tarballs_traceback https://git.launchpad.net/~bryce/git-ubuntu
Only Bryce Harrington can upload to this branch. If you are Bryce Harrington please log in for upload directions.

Branch merges

Branch information

Name:
fix_export_orig_empty_tarballs_traceback
Repository:
lp:~bryce/git-ubuntu

Recent commits

ba53af3... by Bryce Harrington

build: Ensure fetch_orig() always returns a list

When no tarballs can be successfully found by any mechanism,
fetch_orig()'s loop will exit. Since no return statement was provided
in such a case, the function returns None. exportorig.py's main()
routine returns this None directly to the top level, where it is stored
in the variable tarball. This results in a traceback like:

  File "/snap/git-ubuntu/477/usr/lib/python3/dist-packages/gitubuntu/exportorig.py", line 117, in cli_main
    if len(tarballs) > 0:
  TypeError: object of type 'NoneType' has no len()

We don't yet have test cases for build.py, but I added an assert in
fetch_orig() prior to its return to avoid papering over unrelated errors
in mechanisms.

Fixes: https://bugs.launchpad.net/usd-importer/+bug/1868631

a1c4bbd... by Sergio Durigan Junior

Add gssproxy to the whitelist.

Signed-off-by: Sergio Durigan Junior <email address hidden>

69216f3... by Sergio Durigan Junior

Add mailman3 to the whitelist.

Signed-off-by: Sergio Durigan Junior <email address hidden>

be7fa10... by Robie Basak

Merge branch 'rich-history-from-changes-file'

7c43469... by Paride Legovini

snapcraft: drop --enable-experimental-package-repositories

The feature is not considered experimental anymore and the flag has
been dropped from snapcraft.

efad822... by Robie Basak

Add rich history import from changes files

Allow uploaders to specify where rich history associated with an upload
can be found directly from the changes file. This allows rich history to
be provided by any uploader without concern for things like access
control for pushing upload tags.

This partly deprecates upload tags. The generally recommended approach
to supply rich history will be through the changes file. Upload tags
remain to preserve the rich history preservation mechanism on reimport.
After a transition to changes file based rich history is complete, we
might refactor the rich history preservation mechanism and then drop
support for upload tags altogether. However it might be useful to retain
upload tag support for testing purposes, as they are easier to arrange
than this new changes file mechanism.

For the retry logic, we add a dependency on tenacity. This module seems
to be the most widely used for this purpose, and is already in main in
Ubuntu Focal.

22d2f37... by Robie Basak

Add get_changes_file_url() method

The underlying Launchpad source_package_publishing_history object may
contain a reference to a changes file associated with an upload. Add a
method to access this through the SourcePackageInformation object if it
exists.

7eb1963... by Robie Basak

Pass through spi

In a following change we will need find_or_create_unapplied_commit() to
opportunitistically have access to the underlying
SourcePackageInformation object if there is one available, so that it
can find any provided rich history through that channel. So pass it
through when it exists.

e71828d... by Robie Basak

Rename validate_upload_tag()

This is now a generic function to validate rich history regardless of
its source, so rename it and adjust termininology and the docstring
accordingly.

5162588... by Robie Basak

Refactor validate_upload_tag()

Arrange for the caller to provide the warning messages instead of the
callee.

For this to work, we return the nature of the validation failure in an
exception instead of returning False to indicate a validation failure.
The exception itself provides the nature of the problem, so we can
reduce ourselves to printing a single warning.

The version parameter is no longer needed since it was only used to
generate the warning, which is now done by the callee.

This refactoring will allow the validate_upload_tag() function to become
generic to rich history validation in general, and no longer be specific
to upload tags.