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>
All the output is a duplicate of what is being sent to the root logger
(albeit in a different format) and in e.g. our test suite the output
is entirely redundant.
Signed-off-by: Niels Thykier <niels@thykier.net>
With a bit of code we can replace the manual file-handling for
"upgrade_output" with a logger. This will enable us to refactor other
bits that currently depend on "output_write" by making those bits use
a logger instead.
This also migrates "do_hint" to use the new output logger. This is
due to "do_hint" being the only method relying on writing of partial
lines and maintaining support for that in "output_write" would have
been non-trivial.
To ensure "pretty" formatting to stdout, the messages in
"output_write" are now chopped into multiple lines.
The only visible change is that the output to stdout from
"output_write" now also includes the prefix with a timestamp.
However, then contents of "upgrade_output" remain unchanged
deliberately.
Signed-off-by: Niels Thykier <niels@thykier.net>
We already know the item is successful when we print it and the next
line ("final:") will confirm it any way.
Signed-off-by: Niels Thykier <niels@thykier.net>
At a glance, it looks like the value of "better" variable can be
decided from 3-4 places. However, due to the code flow only two of
those assignments are truly "live"/useful.
Signed-off-by: Niels Thykier <niels@thykier.net>
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>
The "Out of date" binaries loop has gotten too complex to also handle
the "unsatisifiable dependency" check. Concretely, we failed to
generate proper excuses for arch:all packages due to this.
Separate the two loops to restore the arch:all check.
Signed-off-by: Niels Thykier <niels@thykier.net>
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>
We basically use them as sets and do not need to rely on the ordering,
so we might as well just turn them into proper sets.
Signed-off-by: Niels Thykier <niels@thykier.net>
The original method confused IntelliJ into thinking that binary_t was
a boolean rather than an object.
Signed-off-by: Niels Thykier <niels@thykier.net>
With this change, Britney can now provide a very brief summary of the
migration via one single value (YAML) or line (HTML). This solves two
issues:
* It provides an aggregated version of the policy decision without
having to loop over all policies (and even those would not give
a full verdict on their own as not all rejections come from
policies)
* It enables a simple way to inform readers of the HTML excuses of
whether a rejection is permanent or not. This should hopefully
make it easier for contributors to understand Britney and react
more pro-actively.
Signed-off-by: Niels Thykier <niels@thykier.net>
In the unlike case that there are multiple removal hints, showing
the first valid hint should be sufficient.
Signed-off-by: Niels Thykier <niels@thykier.net>
Doing this means that you can't use the hint tester for packages with
uppercase characters in the version, e.g.
Version mismatch, dreamchess 0.2.1-rc2-2build1 != 0.2.1-RC2-2build1
Closes: Debian#846141
Signed-off-by: Niels Thykier <niels@thykier.net>
This fixes commit 497edc to really allow policies to see if the excuse has
already been invalidated by previous policies.
Signed-off-by: Niels Thykier <niels@thykier.net>
Cleanly split doop_source into a (small) part about source packages
and a (longer) part about binary packages.
Signed-off-by: Niels Thykier <niels@thykier.net>
Coverage suggests that the conditions are always true. If so, we can
replace the "elif" with a regular "if" - but for now, lets keep an
assert.
Signed-off-by: Niels Thykier <niels@thykier.net>
Add a check to ensure we do not create broken test data (as happened
recently, where the architecture values were swapped for a single
binary). A cold hard failure like this is easier to debug
compared to Britney playing "garbage in, garbage out".
Signed-off-by: Niels Thykier <niels@thykier.net>
Add some "no cover" to some unrecoverable exceptions
(e.g. misconfiguration) or base-class methods that are not intended to
be invoked.
Signed-off-by: Niels Thykier <niels@thykier.net>
This gives Policies the opportunity to see if a previous check
(build/installability) or earlier policies already invalidated the update. This
allows writing policies that work on groups of packages, or skipping expensive
checks (such as triggering autopkgtests while the package is not built or
installable yet).
Signed-off-by: Niels Thykier <niels@thykier.net>
Why duplicate that in the configuration when Britney can just pull it
in the Release file for testing? :)
Closes: Debian/britney2#11
Signed-off-by: Niels Thykier <niels@thykier.net>
As a side effect, remove mips64el from NEW_ARCHES as we no longer need
that as a work around.
Closes: Debian/britney2#12
Signed-off-by: Niels Thykier <niels@thykier.net>
It is unwieldy to have one half of output data generation in the policy but not
the other half of updating the excuse. Now that apply_policy() gets the excuse
object as argument we can move everything there.
Signed-off-by: Niels Thykier <niels@thykier.net>
This allows tests to check whether there are any missing builds or old
binaries, so that expensive actions such as "trigger an autopkgtest" are not
done too early/in vain.
Signed-off-by: Niels Thykier <niels@thykier.net>
For future policies such as running autopkgtests it is important to know
whether a package has built, so that expensive actions such as "trigger an
autopkgtest" are not done too early/in vain.
This requires dropping the "age != 0" check for adding the out-of-date-ness to
the Excuse, as the policies now run later. But this check only applied to an
infinitesimal age, and even with age == 0 it is still a valid excuse that there
are missing binaries.
Signed-off-by: Niels Thykier <niels@thykier.net>
FAILED/SUCCESS lines would be separated by a whitespace from the list
of architectures, but not itself followed by whitespace. This is slightly
confusing, as one could interpret it as being a heading for the following
block of tested packages, rather that the final result of the previous
block.
This includes refining "HINTS_ALL" to cover all hints added at
runtime.
Currently, it is not very useful. However, a later commit will allow
policies to use this feature.
Signed-off-by: Niels Thykier <niels@thykier.net>