130 Commits

Author SHA1 Message Date
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
cd08deb943 Fix build-dep check for source with only arch: all binaries
When a source has only arch: all binaries, the Build-Depends had no relevant
architectures, so the check was skipped. Instead check it on any architecture,
just like Build-Depends-Indep.

Signed-off-by: Ivo De Decker <ivodd@debian.org>
2019-01-19 09:45:52 +00:00
Ivo De Decker
15e5228669 Add src_policy option to policies.
The src_policy defines wether, for source items, the source policy should be
run (RUN_SRC, the default), the arch policy should be run on every arch
(RUN_ON_EVERY_ARCH_ONLY), or both (RUN_SRC_AND_EVERY_ARCH).

Signed-off-by: Ivo De Decker <ivodd@debian.org>
2019-01-17 18:40:39 +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
Niels Thykier
6c3f8354e5
BlockPolicy: Compile regex once rather than once per migration item
Regex compilation is often rather expensive and in this case, we can
do it once instad of once per migration item.

Signed-off-by: Niels Thykier <niels@thykier.net>
2019-01-07 21:20:39 +00:00
Niels Thykier
c4371b9f58
BlockPolicy: Replace print with logger.info
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-01-07 21:07:43 +00:00
Niels Thykier
603aa9fdca
Drop unused local variables
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-01-06 11:03:47 +00:00
Ivo De Decker
f1cd87dc9c Check build-depends-indep
Signed-off-by: Ivo De Decker <ivodd@debian.org>
2019-01-05 12:53:53 +00:00
Ivo De Decker
1c115eee11 For build-depends-indep, only add best result
This is based on the first architecture that had this result.

Signed-off-by: Ivo De Decker <ivodd@debian.org>
2019-01-05 12:53:53 +00:00
Ivo De Decker
3f575a1cd0 For b-d-indep track best result and archs per result
Signed-off-by: Ivo De Decker <ivodd@debian.org>
2019-01-05 12:53:53 +00:00
Ivo De Decker
fa44a3f968 Implement get_check_archs for build-depends-indep
Signed-off-by: Ivo De Decker <ivodd@debian.org>
2019-01-05 12:53:53 +00:00
Ivo De Decker
65128a13b7 Read all_buildarch config option
Signed-off-by: Ivo De Decker <ivodd@debian.org>
2019-01-05 12:53:52 +00:00
Ivo De Decker
a28a7665f3 Split off adding build-dep info into separate function
Signed-off-by: Ivo De Decker <ivodd@debian.org>
2019-01-05 12:53:52 +00:00
Ivo De Decker
07643f4c30 Define BuildDepResult object (based on IntEnum)
Signed-off-by: Ivo De Decker <ivodd@debian.org>
2019-01-05 12:53:52 +00:00
Ivo De Decker
c9148d475a Get dependency type from variable
Signed-off-by: Ivo De Decker <ivodd@debian.org>
2019-01-04 23:42:16 +00:00
Ivo De Decker
ccbaedab1d Split of _get_check_archs into separate function
Signed-off-by: Ivo De Decker <ivodd@debian.org>
2019-01-04 23:42:16 +00:00
Ivo De Decker
a073e35940 BuildDependsPolicy: split off checking in separate function
Signed-off-by: Ivo De Decker <ivodd@debian.org>
2019-01-04 23:42:16 +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
49d9a38d25 Skip unimplemented policies in excuses
Return PolicyVerdict.NOT_APPLICABLE, which means no data is added to
policy_info in the excuse.

Signed-off-by: Ivo De Decker <ivodd@debian.org>
2019-01-02 00:34:49 +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
d0b5cc2ce1 Rename apply_policy to apply_src_policy
apply_src_policy expects an excuse with a new source and binaries. It doesn't
apply to srcarch excuses, which only have new binaries for an existing source.

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
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
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
dd3dcf818f
Mark a regex pattern as a raw string
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-29 04:46:55 +00:00
Ivo De Decker
348274947e Add option fake_runtime to override runtime in britney.conf
This is useful to run tests with the data files from a specific point in time,
without changes due to ageing when the test runs later.

Signed-off-by: Ivo De Decker <ivodd@debian.org>
2018-12-25 22:12:33 +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
0a669461ca
Separate inst_tester from universe
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-11-11 09:38:12 +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
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
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
20a64cadef
Process space separated triggers individually 2018-08-30 16:11:24 +02:00
Niels Thykier
fc834624fc Avoid some unnecessary hash look ups
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-08-12 08:37:07 +00:00
Niels Thykier
1d45b2a3b2 Move autopkgtest specific field to Autopkgtest policy
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-08-07 19:28:25 +00:00
Paul Gevers
0868962ee3
autopkgtest: Ignore triggers without a forward slash
They are manual triggers in the name of britney, most likely by mistake (but
those happen).

Closes: #905600
2018-08-07 08:47:25 +02:00
Niels Thykier
f67fc00292 AgePolicy: Move self.options usage to constructor/initialization
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-08-05 07:22:04 +00:00
Niels Thykier
8e9e099a67 BasePolicy: Make an easy accessor for state_dir
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-08-05 07:03:44 +00:00
Niels Thykier
b0e193d955 Add missing @property - otherwise "verdict.is_blocked" is always True
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-08-05 06:56:53 +00:00
Niels Thykier
36608194f8 test_policy: Add additional tests of AgePolicy
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-08-04 20:09:03 +00:00
Niels Thykier
e88f4d2e5e AgePolicy: Explicitly ignore comment lines in data files
Currently not useful, but it enables us to write comment lines in the
test data files.

Signed-off-by: Niels Thykier <niels@thykier.net>
2018-08-04 20:09:03 +00:00
Paul Gevers
c219c42804 Add text to excuses in case autopkgtest is delayed
In case autopkgtest triggering is delayed because the required builds aren't
ready yet or the package is not installable, currently there is only the
message that autopktest delays the migration, but no hint why. This commit adds
these hints.
2018-08-01 09:58:41 +00:00
Paul Gevers
08a6cdde6f Don't have britney create migration-references itself
The initial idea was to do this to bootstrap the baseline, but it turns out
that this has the drawback it triggers runs for a package that has a new
autopkgtest where it didn't have it in the version in the target suite. It was
considered harmless (as it would just have a failing reference), but due to
autodep8, package can have a passing result in the target suite while the new
autopkgtest is actually broken. Such a package should not be blocked / getting
a penalty.

The alternative is to make the check here smarter, but as this is only for
bootstrapping, lets do that outside of britney proper.
2018-07-29 14:03:41 +00:00
Niels Thykier
97d707e5c0 britney: Avoid some references to britney.{sources,binaries}
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-07-29 09:27:20 +00:00
Niels Thykier
6c6b8fcb96 policies: Make policies suite name agnostic
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-07-29 09:23:12 +00:00
Niels Thykier
54e5eb0e74 policies: Use suite class instead of suite name
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>
2018-07-29 09:23:12 +00:00
Niels Thykier
37f02d611c Revert "Rename autopkgtest related hints"
This reverts commit a07fa9f9070fc9c328021db5cc3e4c4f3063798e.

The new names are just as unhelpful and confusing as the old ones.
Undo for now.
2018-07-25 18:17:36 +00:00