The recent code changes made use remove from the "binaries" field in
SourcePackages. Lists are not particularly optimized for this kind
of removal and we have a few source packages with a lot of binary
packages (e.g. libreoffice, gcc-X-cross{,-ports}) that might trip
poor performance.
Signed-off-by: Niels Thykier <niels@thykier.net>
When the item is a single binary cruft removal, the source name is different
from the package. compute_groups has this info anyway, so just pass it on as a
returm value.
Signed-off-by: Ivo De Decker <ivodd@debian.org>
This test checks if every binary in the target suite is listed as a binary for
its source package and vice-versa.
This adds a config option check_consistency_level:
0: no checks
1: only check at the end
2: also check for every hint run (default)
3: check for every transaction (slow - only useful for the testsuite)
Signed-off-by: Ivo De Decker <ivodd@debian.org>
Note that this now also applies to binNMUs. A source block also blocks
binaries. Binaries on a specific architecture can be unblock with an
architecture-specific unblock hint.
This also means all binaries from non-primary suites
(testing-proposed-updates, etc) need approval.
Closes: #916209
Currently no policy implements this.
A policy can now implement apply_src_policy_impl or apply_srcarch_policy_impl
(or both), so apply_src_policy_impl is no longer an abstractmethod.
Signed-off-by: Ivo De Decker <ivodd@debian.org>
This is a step towards making migration unit-testable. This step
reduces the need for global state (in the MigrationItem class as class
fields) and with another step we can remove the global state entirely
and enable unit tests to create migration items without having to
worry about other unit tests.
Signed-off-by: Niels Thykier <niels@thykier.net>
All types of dependencies between excuses (Depends, Build-Depends,
Build-Depends-Indep, ...) are handled by the same code. The DependencyType is
used to distinguish between the types where needed.
Signed-off-by: Ivo De Decker <ivodd@debian.org>
The should_upgrade_srcarch method only needs _compute_groups for the
purpose of computing smooth update candidates. In the concrete case,
it is rather simple to inline that part directly (and fold away
irrelevant code).
This also enables us to rewrite _compute_groups to accept an migration
item as all remaining callers simply unfold the migration item into
the arguments required by _compute_groups. This change will come in a
future commit.
Signed-off-by: Niels Thykier <niels@thykier.net>
This makes it more explicit that we are not using the value for
anything (and its name did not match it content due to a mistake
in 5d49a41204).
Signed-off-by: Niels Thykier <niels@thykier.net>
Attempt the removal of the old libraries from smooth updates during every hint
run. In some cases, the removal needs to happen during the hint run for the
hint to succeed.
Signed-off-by: Ivo De Decker <ivodd@debian.org>
The "skip" value was a hack to support keeping cruft out of testing
while not breaking the undo code. With new the undo code
(a05a249e04), britney can now handle
this cause without the "skip" value and it has therefore out-lived its
purpose.
Signed-off-by: Niels Thykier <niels@thykier.net>
When we try to compute_groups for a group which has a source or a binary with
a lower version than testing, throw an exception. In the cases where this can
happen, the exception is caught. In other cases, it is not and it serves as an
assert.
This can only happen when there are multiple candidates (from multiple suites)
changing the same source or binary.
This should fix the ordering issues tested in these tests:
- tpu-unstable-binnmu
- binnmu-tpu
- tpu-with-unstable-binnmu
With this change, it should be possible to accept binNMUs from *pu again.
Signed-off-by: Ivo De Decker <ivodd@debian.org>
The issue with an implicit rollback is that the caller has no idea
whether it should invoke rollback or not if an exception occurs.
Signed-off-by: Niels Thykier <niels@thykier.net>
This isolates the undo handling in the new transaction object and in
doop_source, which currently generates the undo items. This commit
will be a stepping stone to rewriting the undo handling.
Signed-off-by: Niels Thykier <niels@thykier.net>
Support for binNMUs from *pu is currently broken, so disable it for now.
see https://bugs.debian.org/916209 for more info.
Signed-off-by: Ivo De Decker <ivodd@debian.org>
When building the excuses, don't calculate smoothbins for items not from
unstable.
This improves the change from commit db584d9fdc
Also try to make the code more readable.
Signed-off-by: Ivo De Decker <ivodd@debian.org>
When building the excuses, don't calculate smoothbins if the source is not in
unstable. Doing so would result in a KeyError and a crash. This happens for
sources that are in testing and (testing-)proposed-updates, but not in
unstable.
Signed-off-by: Ivo De Decker <ivodd@debian.org>
Support blocking the removal of a package with a removal hint. This is useful
to block an auto-removal.
Before this patch, only removals for packages not in unstable could be
blocked.
Signed-off-by: Ivo De Decker <ivodd@debian.org>
This commit updates the test suite to use the BinaryPackageUniverse
instead of the InstallabilityTester where that makes sense. The rest
of Britney has yet to be updated except where absolutely necessary (as
that will come in a later commit).
Signed-off-by: Niels Thykier <niels@thykier.net>
Don't make dependencies of cruft a blocker for being a candidate. In most
cases, the cruft won't migrate to testing, so it shouldn't be a blocker. If
the cruft would be considered for migration to testing, the installability
check will catch missing deps.
Signed-off-by: Ivo De Decker <ivodd@debian.org>
Signed-off-by: Niels Thykier <niels@thykier.net>
At the moment, britney will always read the nuncache from disk
(possibly regenerating it before reading it). However, we can save
the "read from disk" by moving the initialization of nuninst into the
constructor of Britney and relying on clone_nuninst.
Signed-off-by: Niels Thykier <niels@thykier.net>
Previously, we split affected into a "reverse relations with a
dependency on the migrated/change package" set and a set of "the
rest". With this commit we change the sets into a set of packages
with a direct relation on the migrated/changed package and the full
set of all affected.
The change has no effect on Britney's results as the first set is only
used as an optimization to reject some items faster.
Signed-off-by: Niels Thykier <niels@thykier.net>
At the moment, the two are identical, but they are not intended to
remain identical (i.e. the name should eventually become the full
suite name).
Signed-off-by: Niels Thykier <niels@thykier.net>
Cherry-Pick: 80bf9060de
Cherry-Pick: f32907acea
Cherry-Pick: 9ef496177f86b18d9f910da1360dd773b82f1fb7
Cherry-Pick: b16530a37d
Signed-off-by: Niels Thykier <niels@thykier.net>
Flatten the defaultdict(set) for unsat_deps into a standard dict for output
When determining whether a policy applies to a given item, use the
suite class rather than the suite name.
Signed-off-by: Niels Thykier <niels@thykier.net>
The "almost" comes from the fact that there is a reference to
"pu"/"stable" which does not have an obvious fix at the moment.
Signed-off-by: Niels Thykier <niels@thykier.net>
Previously, we would always create empty data structures for "pu" and
"tpu" if these optional suites were not configured. However, we only
reference "pu" and "tpu" directly in very few spots that can easily be
rewritten.
Signed-off-by: Niels Thykier <niels@thykier.net>
Into 3 categories:
* target suite ("testing")
* primary source suite ("unstable")
* additional source suites ("pu" and "tpu")
This will be useful for implementing logic working with suites without
basing it on the name of the suite.
Signed-off-by: Niels Thykier <niels@thykier.net>
At the moment, it is just a glorified dict. However, we will
eventually use it to get rid of the hardcoded references to "testing"
etc. all over the code.
Signed-off-by: Niels Thykier <niels@thykier.net>