plainbox:job: don't require the id field

This patch removes the requirement to have the 'id' field (which maps to
the partial_id property) in each JobDefinition object created from
RFC822 record. The reason for that code was to originally provide some
form of validation and protection against broken records. Now that task
is better suited by the job validator subsystem so let's remove this
check and use the validator instead.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:job: validate the presence of job.partial_id

We should validate partial_id, id is always there.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:job: drop validator_cls argument

This patch drops the unused argument of JobDefinition.validate().  This
argument prevents us from just having a bunch of keyword arguments for
the validator itself.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:job: add Problem.deprecated

This attribute allows us to report problems related to field deprecation

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:job: add strictness control to job validator

This patch adds two optional arguments to the validator, strict, which
effectively runs the validator at maximum strictness and deprecated
which makes it find deprecated fields or values.

The default settings will ignore harmless errors (thus making the
validator do no evil) while still reporting (and preventing) serious
problems that would definitely fail at job runtime.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:secure:providers: drop useless import

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:secure:providers: expose control for job validation

This patch allows two settings (validate and validation_kwargs) to propagate
from Provider1 to JobDefinitionPlugIn. By default validation is enabled
but no validation keywords are supplied so only serious problems are
"reported" (as in preventing a job definition from being loaded).
Those can be changed by passing the two new keyword-only arguments.

They are passed from Provider1.from_definition(),
through Provider1.__init__() and to JobDefinitionPlugIn where they control
the validation block. The second argument (validation_kwargs) is passed
directly to the validator to control its behavior.

Some tests were altered not to overly validate everything where it is
obvious we don't care about valid jobs, just about getting some dummy
data across.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:provider_manager: enforce strong validation in `manage.py validate`

This patch ironically allows the validate command to load broken job
definitions and inspect them manually inside the command core.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:provider_manager: handle deprecated fields

This patch makes the `manage.py validate` command support the
Problem.deprecated problem which is used to report 'name' being used
inside job definitions.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
Launchpad automatic translations update.
providers: ensure we uninstall provider packages for development

Fixes: https://bugs.launchpad.net/checkbox/+bug/1298874

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:provider_manager: fix install in flat layout

The location= field must match all the other directories used in the
flat installation layout. Tests were just checking that the value was
generated but a real provider would not be able to find any data.

Fixes: https://bugs.launchpad.net/checkbox/+bug/1299486

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
"automatic merge by tarmac [r=roadmr][bug=1299486][author=zkrynicki]"
"automatic merge by tarmac [r=roadmr][bug=1298874][author=zkrynicki]"
Launchpad automatic translations update.
plainbox:provider_manager: put src/ into source tarball

This patch makes the `manage.py sdist` command archive the contents of
the src directory.

Fixes: https://bugs.launchpad.net/checkbox/+bug/1297255

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
Launchpad automatic translations update.
plainbox:provider_manager: add manage_py_extension

This patch adds a decorator that is a part of the public API of
`plainbox.provider_manager` class. It allows to replace an existing
command or add a new command and use it from within manage.py

Fixes: https://bugs.launchpad.net/checkbox/+bug/1299748

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
"automatic merge by tarmac [r=sylvain-pineau][bug=1299748][author=zkrynicki]"
"automatic merge by tarmac [r=sylvain-pineau][bug=1297255][author=zkrynicki]"