~racb/git-ubuntu:smart-whitelisting

Last commit made on 2021-04-19
Get this branch:
git clone -b smart-whitelisting 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:
smart-whitelisting
Repository:
lp:~racb/git-ubuntu

Recent commits

c5f4099... by Robie Basak

Add smart whitelist support

We don't want imported repositories to languish; if imported once into
Launchpad, they should continue to be maintained.

Rather than relying on manual import into the whitelist, we can instead
just dynamically check to see if we have already imported a package, and
if so, treat it as if it is whitelisted.

This implements that, calling it a "team whitelist" and adding a
--team-whitelist option to the poller to specify which Launchpad team
should be consulted in order to determine if a package is already
imported.

As the logic gets more complex, we refactor it all into
a filter function created by
importer_service_poller.create_filter_func(). This neatly simplifies
importer_service.request_imports(). For this to work, we pull out the
Launchpad login into the caller, renaming the object to "lp" everywhere
to match convention elsewhere.

I chose to add has_import_repository() to importer_service.py as it's a
general function that feels like it isn't necessary poller specific. But
I placed create_filter_func() to importer_service_poller.py as the logic
of what to include and exclude is closely tied to the poller itself.
This nicely separates the decision logic and list management in the
poller from the search implementation in the main importer_service.py
service handling library.

As the blacklist and whitelist functionality is now pulled into
create_filter_func(), that functionality is removed from
srcpkgs_to_import_list() and should_import_srcpkg(). This invalidates
the admin tools import-source-packages.py, source-package-walker.py and
update-repository-alias.py, so I've removed them. These tools haven't
been used in a long time anyway. import-source-packages.py and
source-package-walker.py are redundant now that we have the queue driven
importer service implementation. update-repository-alias.py is currently
done by hand, but I intend to replace it with an
imported-repository-driven equivalent anyway.

Finally, this means that scriptutils.py becomes mostly redundant and it
might be worth removing the redundant parts and pulling what's left into
importer_service_poller.py, but this change seems to have gotten big
enough now that I'll leave that for another time.

d13680c... by Robie Basak

Correctly compare package version strings

build.py currently has no tests, so it's difficult to add a test for
this fix. But this is a trivial and obvious improvement, so I think it's
worth landing without.

b12c8e9... by Robie Basak

Drop GitUbuntuRepository.descendant_of()

Now that we have unpinned pygit2, the newer version of pygit2 provides a
pygit2.Repository.descendant_of() method directly, so we can drop our
temporary implementation and adjust the single caller.

We retain the test to ensure that the implementation swap does not
change behaviour.

1638f8d... by Robie Basak

Drop pygit2_signature_tuple

Now that we have unpinned pygit2, the newer version of pygit2 allows
direct comparison of pygit2.Signature objects, so we no longer need this
wrapper.

c29ec02... by Robie Basak

Drop pinning

Now that we are based on a core20 (Focal) build that uses only
distribution dependency packages, we no longer need to pin anything.

A couple of opportunities blocked on unpinning were noted in the
comments here; they are resolved in the two changes subsequent to this
one.

LP: #1855725

d11cf50... by Robie Basak

Drop GPG key ID workaround

With LP: #1918967 fixed in snapcraft, we must match and change the
substring of the fingerprint used for the public key file supplied to
snapcraft; otherwise the build fails.

b530026... by Robie Basak

Add ubuntu-dev-tools for update-maintainer

update-maintainer is used by "git ubuntu merge", so this is a dependency
and needs adding to both the deb and the snap.

See LP: #1918999 for details on why it has to also be added to
stage-packages explicitly.

d2fb520... by Sergio Durigan Junior

Add python-azure to whitelist

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

7b156d3... by Robie Basak

Merge branch 'core20'

f994cd5... by Robie Basak

Also add ansible-base to whitelist