721 Commits

Author SHA1 Message Date
Ivo De Decker
208726f538 Add BuiltOnBuilddPolicy
Signed-off-by: Ivo De Decker <ivodd@debian.org>
2019-07-06 09:18:16 +00:00
Paul Gevers
909a4e228a
Default series option to target suite name 2019-05-18 21:40:27 +02:00
Niels Thykier
d9f9c6d4a9
Let ExcuseFinder create migration items
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-01-27 06:58:02 +00:00
Niels Thykier
6dde43a339
Create an ExcuseFinder class for computing relevant excuses
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-01-27 06:58:00 +00:00
Niels Thykier
2c9e0b9b97
do_all: Prune cruft after non-recursive hints (e.g. "easy")
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-01-21 20:48:14 +00:00
Niels Thykier
73791e48d0
Rename migrate_item{,s}_to_target_suite
It accepts multiple items, so using a singular "item" seems like a
misfeature.

Signed-off-by: Niels Thykier <niels@thykier.net>
2019-01-21 20:35:01 +00:00
Niels Thykier
98d4553185
Include old cruft items directly in upgrade_me
This enables us to remove the recursion in iter_packages (and thereby
the added noise from it).  As a side-effect of this change, the solver
can now solve the "left-binary-removal" test case as it can see the
relevant cruft item together with the regular items needed to solve
the migration.

Signed-off-by: Niels Thykier <niels@thykier.net>
2019-01-21 20:35:00 +00:00
Niels Thykier
5d408fa800
Remove new cruft items in iter_packages
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-01-21 20:34:59 +00:00
Niels Thykier
32ebe9d4e0
Ensure get_auto_hinter_hints does not choke on cruft items
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-01-21 20:34:58 +00:00
Niels Thykier
e0b46e5196
Make the source pkg consistency checks a TargetSuite method
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-01-19 16:47:40 +00:00
Niels Thykier
e3d68164f1
Fix typo in log output
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-01-19 16:09:33 +00:00
Niels Thykier
d4bdccf021
Unconditionally cleanup cruft/smooth updates
If people do not use these features then there will be nothing to
remove anyway.

Signed-off-by: Niels Thykier <niels@thykier.net>
2019-01-19 16:06:34 +00:00
Niels Thykier
b0835fa4a1
Fix pycodestyle warnings
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-01-19 12:51:16 +00:00
Ivo De Decker
328695ee63
Enable BuiltUsingPolicy
Signed-off-by: Ivo De Decker <ivodd@debian.org>
2019-01-19 12:45:08 +00:00
Ivo De Decker
4fcb90b775
Read Built-Using info for binary packages
Signed-off-by: Ivo De Decker <ivodd@debian.org>
2019-01-19 12:45:06 +00:00
Niels Thykier
c9d523da93
Remove trailing whitespace
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-01-19 12:03:34 +00:00
Ivo De Decker
7be0dc2ee8 Sort impossible dependency output in excuses.
This makes the output more deterministic.

Signed-off-by: Ivo De Decker <ivodd@debian.org>
2019-01-19 11:38:21 +00:00
Niels Thykier
82fa58df20 Extract a compute_item_name method
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-01-16 22:37:23 +00:00
Ivo De Decker
97ed917db4 Sort some data for deterministic output in excuses
Signed-off-by: Ivo De Decker <ivodd@debian.org>
2019-01-16 22:37:23 +00:00
Niels Thykier
f928c7ed3d Make SourcePackage.binaries a set
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>
2019-01-14 13:19:05 +00:00
Ivo De Decker
69c94caa01 Add source_name return value to compute_groups
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>
2019-01-14 13:19:05 +00:00
Ivo De Decker
046bdc60c6 Add consistency checks for target suite.
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>
2019-01-14 13:13:45 +00:00
Niels Thykier
2fea931da3
Remove --control-files; It is not used any where
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-01-07 20:25:48 +00:00
Ivo De Decker
0709f8d96c Move block handling to BlockPolicy
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
2019-01-04 17:24:38 +00:00
Ivo De Decker
b395c6f760 Only ignore hints for the same package if arch matches
Signed-off-by: Ivo De Decker <ivodd@debian.org>
2019-01-01 18:34:59 +00:00
Ivo De Decker
7e05c0e5ac Apply policy to srcarch excuses
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>
2019-01-01 18:33:02 +00:00
Ivo De Decker
4cf03bbdc5 Rearrange decision for should_upgrade_srcarch
This should not change the logic in any way. It should allow adding policy
checks in a future commit.

Signed-off-by: Ivo De Decker <ivodd@debian.org>
2019-01-01 18:28:27 +00:00
Ivo De Decker
0d80bad65c Move handling of policies to PolicyEngine
Signed-off-by: Ivo De Decker <ivodd@debian.org>
2018-12-31 19:15:29 +00:00
Niels Thykier
b16ae8046a
Add some '# pragma: no cover' for error cases, abstract methods, etc.
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-31 18:07:29 +00:00
Niels Thykier
542f030a96
Remove now obsolete code from MigrationItem
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-31 12:00:53 +00:00
Niels Thykier
61d3068de6
Move suite name auto-correction to MigrationItemFactory
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-31 12:00:52 +00:00
Niels Thykier
6174d2c3f9
Create a MigrationItemFactory and migrate most code to use it
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>
2018-12-31 12:00:50 +00:00
Niels Thykier
584f75bbc0
Defer loading and registering of hints
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-31 12:00:48 +00:00
Ivo De Decker
18d951be25 Handle dependencies between excuses in a generic way
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>
2018-12-31 11:46:10 +00:00
Niels Thykier
7502bc72f3
Avoid some hash lookups
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-29 14:15:55 +00:00
Niels Thykier
e13eb7d0cb
Pass correct source_data to find_smooth_updateable_binaries
This fixes a thinko in e0c19b3.  Thanks to ivodd for reporting it.

Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-29 04:21:18 +00:00
Ivo De Decker
22c6be76ba Split calculating and running of auto-hinter hints
Signed-off-by: Ivo De Decker <ivodd@debian.org>
2018-12-27 20:16:59 +00:00
Ivo De Decker
12187421c8 Show newly uninstallables before validation
Signed-off-by: Ivo De Decker <ivodd@debian.org>
2018-12-27 20:16:10 +00:00
Niels Thykier
5642a90449
Rename _compute_groups to compute_groups
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-20 20:29:00 +00:00
Niels Thykier
c7dbd95c0b
Have MigrationManager keep track of active transaction
This leaves callers with only having to track the transaction they
need to care about (if any).

Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-18 22:08:20 +00:00
Niels Thykier
4803065e1a
Move (and rename) try_migration to the MigrationManager
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-18 21:57:12 +00:00
Niels Thykier
28c7a052fa
Move to MM and rename doop_source to apply_item_to_target_suite
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-18 21:55:12 +00:00
Niels Thykier
4ae6a34a27
Move _compute_groups to a new MigrationManager class
Other migration methods are expected to follow in future commits.

Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-18 21:55:11 +00:00
Niels Thykier
d688c9753b
Split a loop to make the special-case more obvious
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-18 21:55:11 +00:00
Niels Thykier
ce6a5704fa
Make _compute_group take a migration item instead of 4 parameters
All callers can supply one and currently just unfold it at the
call-site.

Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-18 21:55:10 +00:00
Niels Thykier
e0c19b3adb
Inline a call to _compute_groups
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>
2018-12-18 21:55:09 +00:00
Niels Thykier
82ff8010e2
Rename unused variable/return value to "_"
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 5d49a4120488e5beba0e1946613a1e8873bfefdd).

Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-17 22:18:47 +00:00
Ivo De Decker
4dc2cf7172
Try to remove old libs during hint run
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>
2018-12-17 21:56:35 +00:00
Niels Thykier
70d461ff11
Remove "skip" return value of _compute_groups
The "skip" value was a hack to support keeping cruft out of testing
while not breaking the undo code.  With new the undo code
(a05a249e04926034ea8f915abcd51b62acac41c5), 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>
2018-12-17 20:20:16 +00:00
Ivo De Decker
12debfc7c8 Check that version increases when adding packages to testing
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>
2018-12-17 20:08:53 +00:00