109 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
8eaee4309e Rewrite "self.log -> self.logger.<severity>" for autopkgtest
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-03-31 05:57:43 +00:00
Niels Thykier
f752ea4ac7 Merge branch 'master' into autopkgtest 2018-03-31 05:35:06 +00:00
Niels Thykier
32b2ee326a Use lazy evaluation of format arguments in logging
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-03-30 17:38:50 +00:00
Niels Thykier
8bf73610ee policies: Use logger instead of "log"
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-03-30 17:11:10 +00:00
Niels Thykier
5e825043d3 Replace "print" logging with the "logging" module
This commit rewrites the make-shift "log" methods to use the logging
framework without requiring changes to the callers.  This will be done
in a latter commit to keep things reviewable.

Signed-off-by: Niels Thykier <niels@thykier.net>
2018-03-30 17:11:09 +00:00
Paul Gevers
011e9a14b7
Merge branch 'master' into autopkgtest 2018-02-11 20:58:54 +01:00
Paul Wise
94a3136f64 Drop duplicate 'has new bugs' excuses item
The other item includes bug numbers so this one is less useful.

Closes: https://bugs.debian.org/886509
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-01-07 12:18:13 +00:00
Paul Gevers
fd03083ea5
Merge branch 'master' into autopkgtest 2017-11-28 20:19:48 +01:00
Niels Thykier
2242821c01 BuildDependsPolicy: Add missing build_depends=True to get_dependency_solvers
Signed-off-by: Niels Thykier <niels@thykier.net>
2017-11-12 11:36:35 +00:00
Niels Thykier
c195268019 piuparts: Properly discard the URL for testing
The PiupartsPolicy does not use the report URL for testing, so we do
not need to store it in memory.  Unfortunately, the logic was broken
and the discard did not happen.

Signed-off-by: Niels Thykier <niels@thykier.net>
2017-11-12 08:41:39 +00:00
Niels Thykier
bda39f8ca0 Support :native in build-dependency relations
Signed-off-by: Niels Thykier <niels@thykier.net>
2017-11-12 07:50:49 +00:00
Niels Thykier
89765bc374 BuildDependsPolicy: Keep block_txt and block in sync
If a package had:

  Build-Depends: foo [i386], uninstallable-pkg

Then the excuses for amd64 would point to "foo [i386]" rather than
"uninstallable-pkg".

Signed-off-by: Niels Thykier <niels@thykier.net>
2017-11-11 22:07:49 +00:00
Niels Thykier
ee27d7a67c Add BuildDependsPolicy to check Build-Depends(-Arch) availability
Add a new "BuildDependsPolicy" that will check the satisfiability of
the build-dependencies listed in the Build-Depends and
Build-Depends-Arch fields.  This enables gating of packages based on
missing / broken build-dependencies.

There are some limitations:

 * Build-Depends-Indep is ignored for now.  Missing or broken packages
   listed in Build-Depends-Indep will be continue to be silently
   ignored.

 * Being a policy check, it does not enforce "self-containedness" as
   a package can still migrate before a build-dependency.  However,
   this can only happen if the build-dependency is ready to migrate
   itself.  If the build-dependency is not ready (e.g. new RC bugs),
   then packages build-depending on it cannot migrate either (unless
   the version in testing satisfies there requirements).

Signed-off-by: Niels Thykier <niels@thykier.net>
2017-11-11 15:49:48 +00:00
Niels Thykier
c537f0554f Move PolicyVerdict to britney2.policies 2017-11-02 19:31:11 +00:00
Paul Gevers
b553b205ce
Add age changes due to penalties or bounties to the excuses output 2017-10-19 21:50:56 +02:00
Paul Gevers
f2f20eb460
Limit accumulated bounties to configurable minum age 2017-10-19 21:50:55 +02:00
Paul Gevers
77ea1cc8d5
Enable no-penalties urgencies; to exempt urgency >= high from penalties 2017-10-19 21:50:43 +02:00
Paul Gevers
be5a378da5
Enhance debugging information for applied bounties and penalties 2017-10-18 19:54:57 +02:00
Paul Gevers
eb60fc557e
Implement bounty/penalty system for autopkgtest 2017-10-15 21:42:51 +02:00
Niels Thykier
189edf42ec britney: Move britney's start of day to 7 pm
In preparation for running Britney 4 times a day and we wanting the
22:00 UTC run to do the aging.

Signed-off-by: Niels Thykier <niels@thykier.net>
2017-04-08 06:21:26 +00:00
Niels Thykier
f6120e5ec3 Use the correct required age in html excuses
Signed-off-by: Niels Thykier <niels@thykier.net>
2017-03-19 18:01:35 +00:00
Niels Thykier
9ca5f7e24e Add more verdicts to provide more detailed excuses
Signed-off-by: Niels Thykier <niels@thykier.net>
2017-02-13 19:37:53 +00:00
Niels Thykier
b34ac3bdd9 Add a verdict field to all policies with the actual verdict
Signed-off-by: Niels Thykier <niels@thykier.net>
2017-02-13 19:37:53 +00:00