~racb/git-ubuntu:canonical-server-reporter

Last commit made on 2022-07-19
Get this branch:
git clone -b canonical-server-reporter https://git.launchpad.net/~racb/git-ubuntu
Only Robie Basak can upload to this branch. If you are Robie Basak please log in for upload directions.

Branch merges

Branch information

Name:
canonical-server-reporter
Repository:
lp:~racb/git-ubuntu

Recent commits

0e3ca5f... by Robie Basak

submit: default to ~canonical-server-reporter

On the Canonical Server Team, we have been using ~canonical-server in
its own review slot for the sole purpose of gathering all reviews we're
interested in tracking together on this team's +activereviews page.

A problem with this is that we all belong to this team, so when a person
does a review, they sometimes accidentally "grab" that slot, so it
appears as their name rather than the team's, and thus disappears from
the report.

One way around this is to use a separate team that none of us actually
belong to. This way we can't "grab" that slot.

This changes the default team to this new ~canonical-server-reporter
team to help those who use the "git ubuntu submit" command.

ab3351a... by Robie Basak

Improve documentation on validation constants

This should hopefully do a better job of signposting anyone who wants to
change the constants to better understand the implications of doing so.

c8216a7... by Robie Basak

Add test to accept refs that contain '+'

5b0868f... by Sergio Durigan Junior

Accept ref names containing plus sign

Currently, if the ref name contains a plus sign, git ubuntu will fail
due to the following assertion error:

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

However, branch names (which compose ref names) are allowed to contain
the plus sign. This commit expands the VCS_GIT_REF_VALIDATION regexp
to accept that.

FWIW, I triggered this assertion when I named my branch after the
Debian release I was merging (for the net-snmp package):

  merge-5.9.1+dfsg-4-kinetic

2133870... by Robie Basak

Refactor _head_version_is_equal

Add a docstring, refactor the code to make it more readable, and rename
the method to match its definition better.

This should not result in any functional change.

0b8cc0b... by Robie Basak

Rewrite launchpad_versions_published_after

The logic in this method can be simplified significantly with a rewrite.
To mitigate any regression, a parametrized unit test is added with the
expected behaviour thought out from the importer spec.

There is still an inefficiency present here. In theory we could skip
importing pocket copies if the branch corresponding to a pocket is
up-to-date. However, currently the algorithm only matches against the
exact date_created attribute of the Launchpad publication object against
which a particular version was first imported. To ensure that branches
are updated if any new pocket copies have occurred, we must "replay"
them all through the importer. Therefore there is potential here for a
future performance improvement.

9addaa0... by Robie Basak

launchpad_versions_published_after: drop return

This return statement is redundant since it's at the end of the method
anyway.

a11bfa8... by Robie Basak

launchpad_versions_published_after: refactor call

We don't need to set args and then call with **args, given that is all
we do with it. Instead, just call self.archive.getPublishedSources()
with keyword arguments directly.

b2f98c1... by Robie Basak

GitUbuntuSourceInformation: dependency injection

Add dependency injection to GitUbuntuSourceInformation. This allows the
creation of this object in tests such that we can mock a
launchpadlib.launchpad.Launchpad object.

284beb9... by Robie Basak

Add unit test for get_head_info()

Now that get_head_info() returns what we expect, we can add a unit test
for it now.