There is no way to use a resource from another namespace

Bug #1296424 reported by Zygmunt Krynicki
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PlainBox (Toolkit)
Fix Released
Critical
Zygmunt Krynicki

Bug Description

Job definitions may have the so-called resource requirements. Those are python-like expressions (parsed with python's ast module) that prevent a job from running unless there is a resource record with a particular name, that has at least one object that causes the resource expression to evaluate to true. This is documented in [1].

The way plainbox infers the name of the resource record to look up from the python-like identifier used inside the expression is limiting. Traditionally it prevented resources to follow the "group/name" pattern since "/" cannot be used in python identifiers. Now the problem is more serious since it also prevents us from reaching out to resources from other provider namespaces.

This severely limits other tests authors and prevents them from using common resources such as 'device' and 'package', that ship with checkbox.

[1] http://plainbox.readthedocs.org/en/latest/dev/resources.html

Related branches

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

I'd like to propose that we allow test authors to use this new syntax to refer to arbitrary job identifiers as resource containers:

package = resource("2013.com.canonical.certification::package")
package.name == "checkbox"

The resource identifier would become a implicit / builtin callable that would be picked up by the resource program analyzer and in turn would make the identifier 'package' refer to the job with the full id given as argument.

As an extension to this method, if the argument to resource() is not a fully qualified job identifier, then implicit namespace of the encompassing provider will be automatically used to construct the full identifier. This would match the existing convention of only having to use full job identifiers when spanning namespace boundaries.

Zygmunt Krynicki (zyga)
Changed in checkbox:
milestone: none → plainbox-0.6
Zygmunt Krynicki (zyga)
Changed in plainbox:
milestone: none → 0.6
importance: Undecided → Critical
status: New → In Progress
Zygmunt Krynicki (zyga)
Changed in checkbox:
milestone: plainbox-0.6 → none
Zygmunt Krynicki (zyga)
Changed in plainbox:
milestone: 0.6 → 0.5.5
Zygmunt Krynicki (zyga)
no longer affects: checkbox
Zygmunt Krynicki (zyga)
tags: removed: plainbox
Changed in plainbox:
milestone: 0.5.5 → 0.9
Revision history for this message
Daniel Manrique (roadmr) wrote :

If not assigned to anyone, it can't be in progress :P

Changed in plainbox:
status: In Progress → Triaged
Zygmunt Krynicki (zyga)
Changed in plainbox:
assignee: nobody → Zygmunt Krynicki (zkrynicki)
status: Triaged → In Progress
Changed in plainbox:
status: In Progress → Fix Committed
Changed in plainbox:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.