~cjwatson/launchpad:built-using-domination

Last commit made on 2020-04-23
Get this branch:
git clone -b built-using-domination https://git.launchpad.net/~cjwatson/launchpad
Only Colin Watson can upload to this branch. If you are Colin Watson please log in for upload directions.

Branch merges

Branch information

Name:
built-using-domination
Repository:
lp:~cjwatson/launchpad

Recent commits

7bfb655... by Colin Watson

Fix calculation of live source versions

The dominator previously incorrectly reinstated source publications if
they were the latest one being considered for domination, even if that
was an inactive publication with only inactive Built-Using references.

965bddb... by Colin Watson

Tighten up tests slightly

88f502f... by Colin Watson

Fix Built-Using domination twice in a row

If a source has Built-Using references to it but has already been
superseded by the dominator, then a subsequent run of the dominator will
still consider that source in case reinstatement is needed, and would
fail an assertion when trying to supersede a source that's already
superseded.

The simplest fix for this seems to be to have `planPackageDomination`
not add the publication to `supersede` or `delete` if it's already
inactive.

f4479f2... by Colin Watson

Handle Built-Using references in the dominator

Keep source publications with Built-Using references from active binary
publications. This may extend to reinstating the source publication
(via a copy) if it had already been superseded or deleted.

It's possible for this to cause confusing effects if a manual deletion
races with a build that produces binaries with a Built-Using reference
to the deleted source. I've guarded against this as best I can, and
hope the remaining cases will be rare, but err on the side of honouring
the reference.

LP: #1868558

06ccc3e... by Colin Watson

Simplify tests using createFromSourcePackageReleases

c0c4aa2... by Colin Watson

Expand deletion guard to other pockets

It now checks all pockets that could legitimately depend on the one from
which the publication is being deleted.

d7fbcfd... by Colin Watson

Guard removal of sources referenced by Built-Using

Prevent SourcePackagePublishingHistory.requestDeletion from deleting
source publications that have Built-Using references from active binary
publications in the same archive and suite.

This isn't necessarily complete: in particular, it can miss references
from other pockets, and in any case it might race with a build still in
progress. The intent of this is not to ensure integrity, but to avoid
some easily-detectable mistakes that could cause confusion.

LP: #1868558

d6e1f11... by Colin Watson

Show Built-Using references in the web UI

LP: #1868558

e9bb481... by Colin Watson

Add BinarySourceReference.createFromSourcePackageReleases

This makes some tests (especially in branches further up this stack)
more convenient.

8983670... by Colin Watson

Refactor createFromRelationship using Archive.getPublishedSources

Now that we're only considering a single archive, this is equivalent and
much clearer.