lp://qastaging/~zyga/checkbox/better-provider-validation

Created by Zygmunt Krynicki and last modified
Get this branch:
bzr branch lp://qastaging/~zyga/checkbox/better-provider-validation
Only Zygmunt Krynicki can upload to this branch. If you are Zygmunt Krynicki please log in for upload directions.

Branch merges

Related bugs

Related blueprints

Branch information

Owner:
Zygmunt Krynicki
Project:
Checkbox
Status:
Development

Recent revisions

2584. By Zygmunt Krynicki

plainbox: use NotUnsetValidator for Provider1Definition.version

Signed-off-by: Zygmunt Krynicki <email address hidden>

2583. By Zygmunt Krynicki

plainbox:providers: use the public `base_dir` attribute

Signed-off-by: Zygmunt Krynicki <email address hidden>

2582. By Zygmunt Krynicki

plainbox:providers: add_get{user,secure}_path()

Those confusingly named methods return the directory from which
user and secure providers are loaded. This patch will need some work
as we also need to include /usr/local in the secure part thus making
this a list instead of a single directory. The names could be a little
bit more fortunate as well

Signed-off-by: Zygmunt Krynicki <email address hidden>

2581. By Zygmunt Krynicki

plainbox:secure:providers: allow Provider1Plugin to fail

This patch enforces validation of Provider1Definition data that is
interpreted by Provider1Plugin and translates any ValidationError
exceptions into PlugInError, thus preventing problematic providers
from being loaded.

It also ensures that the specified location is an existing directory,
preventing typos or "ghost" providers.

Signed-off-by: Zygmunt Krynicki <email address hidden>

2580. By Zygmunt Krynicki

plainbox:secure:providers: ensure that location and name are set

Signed-off-by: Zygmunt Krynicki <email address hidden>

2579. By Zygmunt Krynicki

plainbox: prefer Provider1.load_all_jobs() over get_builtin_jobs()

Signed-off-by: Zygmunt Krynicki <email address hidden>

2578. By Zygmunt Krynicki

plainbox:secure:providers: add Provider1.load_all_jobs()

This method acts just like get_builtin_job() that it replaces with two
important differences. First, it never raises RFC822SyntaxError, instead
it collects all such exceptions into a list. This allows it to keep
loading jobs from subsequent files even if the first file has a syntax
problem early on. Second is that the full list of problems is returned
to the caller.

This allows it to be more resilient in face of user errors and makes it
a valuable method to have for tools that are aimed at provider developers.

The old get_builtin_jobs() is retained for compatibility but has been
re-implemented on top of load_all_jobs().

Signed-off-by: Zygmunt Krynicki <email address hidden>

2577. By Zygmunt Krynicki

plainbox:secure:providers: drop Provider1.load_jobs()

This method is no longer used, having been completely replaced by the
JobDefinitionPlugIn and FsPlugInCollection so it can be safely removed.

Signed-off-by: Zygmunt Krynicki <email address hidden>

2576. By Zygmunt Krynicki

plainbox:secure:providers: rewrite get_builtin_jobs()

This patch rewrites get_builtin_jobs() to use the FsPlugInCollection
class along with the new JobDefinitionPlugIn class. This simplifies the
implementation and testing lot since none of the new code needs to deal
with filesystem-related APIs.

Signed-off-by: Zygmunt Krynicki <email address hidden>

2575. By Zygmunt Krynicki

"automatic merge by tarmac [r=][bug=][author=zkrynicki]"

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
Stacked on:
lp://qastaging/checkbox
This branch contains Public information 
Everyone can see this information.

Subscribers