T602: move 'compose' logic to schedule, replace 'ifnotcurrent'
ClosedPublic

Authored by adamwill on Sep 4 2015, 12:04 AM.

Details

Summary

The meat of this commit is to implement T602 - moving a lot of
the 'jobs for specific compose' logic out of the CLI module
into the schedule module, allowing for non-CLI consumers to use
it. There are various related changes bundled in.

Most significantly, 'ifnotcurrent' is replaced with a 'force'
argument that's shared by most of the schedule functions - they
all ultimately pass it to run_openqa_jobs(), which handles it.
If force is false-y, jobs will not be scheduled if there are
any existing, non-cancelled jobs for the given ISO and flavor.
This fulfills the same basic goal as 'ifnotcurrent' - making
sure scheduled nightly and current runs won't schedule jobs for
the same compose - while avoiding the need to hit up the wiki
(and hence meaning jobs_from_compose() does not need the wiki
at all) and being more generally useful, I think.

We now need the wiki only for two things: jobs_from_current()
(to find what the 'current' compose *is*) and, obviously, result
reporting.

There's a more minor change to how arches are handled. The
ARCHES constant is a tuple not a list now (I did this because
it was the default value for an optional function argument and
those shouldn't be mutable; then I made it not the default
value any more, but keeping it as a tuple seems appropriate
anyway). jobs_from_fedfind() has arches=None as the default
and takes the list from the constant if arches isn't set; that
lets us clean things up in cli.py rather a bit.

There's a bit of a bugfix in the CLI to job reporting - we
weren't passing in the CLI wiki object or 'submit' value
properly for 'current' or 'compose', only for 'report'. I also
tried to clean up the logging a bit in general.

Test Plan

Check that all commands work as before, except that
you can pass a list of arches now (practically makes no real
difference ATM since we only have two) and --force replaces
--ifnotcurrent with the impact described in the commit msg.

Diff Detail

Repository
rOPENQA fedora_openqa
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
adamwill retitled this revision from to T602: move 'compose' logic to schedule, replace 'ifnotcurrent'.Sep 4 2015, 12:04 AM
adamwill updated this object.
adamwill edited the test plan for this revision. (Show Details)
adamwill added reviewers: jskladan, garretraziel.
NOTE: I did this on top of D556, since that helps simplify this.
garretraziel accepted this revision.Sep 4 2015, 2:26 PM

Ok, this LGTM.

This revision is now accepted and ready to land.Sep 4 2015, 2:26 PM
This revision was automatically updated to reflect the committed changes.