463 Commits

Author SHA1 Message Date
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
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
Niels Thykier
a05a249e04
Record exactly which binaries are updated in the transaction
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-16 20:03:19 +00:00
Niels Thykier
5d49a41204
Introduce a "Transaction" for changes to testing
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>
2018-12-16 19:58:02 +00:00
Niels Thykier
68fd0ba4b2
Remove --components/COMPONENTS as it is auto-detected
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-16 19:55:04 +00:00
Niels Thykier
7124313aa6
Make InstallabilityTester suite agnostic
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-16 11:00:02 +00:00
Niels Thykier
ced7b7b413
Refactor britney.py to use InstallabilityTester less
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-16 11:00:01 +00:00
Niels Thykier
0099c34d93
Refactor _read_binaries to reduce its complexity a bit
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-16 11:00:00 +00:00
Niels Thykier
f547fb20b1
suiteloader: Create a _setup_architecture method
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-16 10:59:59 +00:00
Niels Thykier
7efa865a04
Move Suite/Package loading into a separate class/module
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-15 21:58:37 +00:00
Niels Thykier
deb9482a2f
Move parse_provides to britney2.utils
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-15 21:58:36 +00:00
Ivo De Decker
3828a76053 Filter out cruft in find_smooth_updateable_binaries
When calculating smooth updateable binaries, filter out cruft binaries from
unstable, because they will not be part of the set of packages that britney
will try to migrate to testing.

Signed-off-by: Ivo De Decker <ivodd@debian.org>
2018-12-11 16:18:53 +00:00
Ivo De Decker
f0ddfc253f Fix parsing of migration item name for binNMU in tpu
The parsing of migration items should also look for the suite name in the
architecture part. This fixes the parsing for migration items like
some-src/amd64_tpu and some-src/amd64_tpu/1.0-1

Signed-off-by: Ivo De Decker <ivodd@debian.org>
2018-12-11 14:37:55 +00:00
Niels Thykier
65b67e763c
Replace the use of inst_tester with new suite functionality
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-11-11 09:38:20 +00:00
Niels Thykier
03df891b7e
Expand the Suite interface and create a TargetSuite sub-class
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-11-11 09:38:19 +00:00
Niels Thykier
0b4f58315f
Rename a method and reduce a table to a set
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-11-11 09:38:18 +00:00
Niels Thykier
0eb8b5a201
BinaryPackageUniverse: Provde equivalent_packages
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-11-11 09:38:17 +00:00
Niels Thykier
ef813bf0d8
Let the BinaryPackageUnvierse track broken packages
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-11-11 09:38:16 +00:00
Niels Thykier
8867ef0cf9
Let the BinaryPackageUniverse track essential packages
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-11-11 09:38:15 +00:00
Niels Thykier
07a407e810
Partly separate the solver from the inst_tester
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-11-11 09:38:14 +00:00
Niels Thykier
c0ecdd82fb
Remove now redundant APIs from the InstallabilityTester
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-11-11 09:38:13 +00:00
Niels Thykier
0a669461ca
Separate inst_tester from universe
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-11-11 09:38:12 +00:00
Niels Thykier
35b06ee007
tests: Separate inst_tester from universe
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>
2018-11-11 09:38:11 +00:00
Niels Thykier
d557610c6f
BinaryPackageUniverse: Implement packages_equivalent_to()
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-11-11 09:38:10 +00:00
Niels Thykier
530db5d3f7
Extract a BinaryPackageUniverse from the InstallabilityTester
The InstallabilityTester is suffering from a lack of clear purpose
because it serves multiple.  This commit extracts most of one of these
purposes into the BinaryPackageUniverse class while retaining the
original API of the InstallabilityTester.

Signed-off-by: Niels Thykier <niels@thykier.net>
2018-11-11 09:38:09 +00:00
Niels Thykier
32def47991
Fix typo in doc string
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-11-01 21:30:25 +00:00
Niels Thykier
b37575f000
Stop creating some throw-away data-structures for a method call
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-11-01 21:30:24 +00:00
Niels Thykier
f86cda97da
inst_tester: Improve doc string/argument name
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-11-01 21:30:23 +00:00
Niels Thykier
7bcbcb6282
Make clone_nuninst able to fully deep clone nuninst
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-10-28 21:26:48 +00:00
Niels Thykier
6c5300d873
Unfold the suite.binaries tuple into two members
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-10-25 18:34:41 +00:00
Ivo De Decker
9c606ef533 Don't add smooth-updatable cruft to migration items
Based on patch by Niels Thykier.

Signed-off-by: Ivo De Decker <ivodd@debian.org>
2018-10-24 22:15:27 +00:00
Niels Thykier
99a35a2986
autopkgtest.py: Update previous commit to match recent changes
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-10-01 19:46:43 +00:00
Iain Lane
c09a229dc9
autopkgtest: Run gcc-n's testuite, if it has one 2018-10-01 19:22:29 +00:00
Niels Thykier
880a614b2b
britney: Extract a find_smooth_updateable_binaries function
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-09-30 12:57:06 +00:00
Niels Thykier
c4931fb1b2
solver: Move a common variable out of an if
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-09-30 12:19:38 +00:00
Niels Thykier
1e46965924
inst/builder.py: Split function in three to reduce indentation levels
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-09-30 12:19:37 +00:00
Niels Thykier
dd5211d55a
inst-tester: Add missing element to a set
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-09-30 12:19:36 +00:00
Niels Thykier
55dd190fa6
inst-tester: Make "check" a list
Should be slightly cheaper (O(1)) than using a set.

Signed-off-by: Niels Thykier <niels@thykier.net>
2018-09-30 12:19:35 +00:00
Niels Thykier
cd1f384012
inst-tester: Remove obsolete "safe-set" optimization
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-09-30 12:19:34 +00:00
Niels Thykier
95b945d2b3
inst-tester: Remove obsolete optimization
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-09-30 12:19:34 +00:00
Niels Thykier
0690a85fe0
excuse: Avoid some unnecessary throw-away tuples
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-09-30 12:19:33 +00:00
Niels Thykier
bd1a0ea000
excuse: Fix some minor style/pep8 issues
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-09-30 12:19:32 +00:00
Niels Thykier
41f4b43f2c
excuse.p: Refactor some duplicated code
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-09-30 12:19:31 +00:00
Paul Gevers
18633e275c
autopkgtest: figure out which packages from unstable are needed
Currently autopkgtest tries to install our trigger from unstable and the rest
from testing. If that fails, than autopkgtest has a fall-back to allow all
packages from unstable to be installed. This has two severe issues:

1) the version of the test and the package it came from may be out-of-sync

2) too much from unstable may be installed, even stuff that should not/is not
allowed to migrate as it breaks stuff.

Make sure that test depends also get added to triggers if they are broken.
E.g. imagine the following scenario: trigger X changes (breaks) the output
generated by Y. Package Z has Y in the test dependencies and compares the
output in the autopkgtest. We want to have the opportunity that a new version
is automatically fixing the situation.

Two use cases are currently unsupported: needs-build (autopkgtest restriction)
and test dependencies generated by autodep8.
2018-09-05 21:37:23 +02:00
Paul Gevers
713b98ad6b
inst_tester: add is_pkg_in_testing 2018-09-05 21:27:41 +02:00
Paul Gevers
20a64cadef
Process space separated triggers individually 2018-08-30 16:11:24 +02:00
Niels Thykier
b6888c2716 test-builder: Avoid allocating empty throw-away lists on empty relations
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-08-12 14:38:36 +00:00