multi-value attributes in declarations are not properly validated
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
review-tools |
Fix Released
|
Undecided
|
Emilia Torino |
Bug Description
Given a snap.yaml that contains multiple values in attributes, such as:
fram-devices:
interface: custom-device
devices:
- /dev/mtd[0-9]
- /dev/chunkfs/
read-devices:
- /dev/chunkfs/geom
- /dev/chunkfs/stats
- /dev/chunkfs/sizes
And a declaration which supports this definition:
"custom-device": {
"allow-
{
"on-store": [
],
],
]
},
]
}
]
}
review-tools fails to review with the following error:
declaration-
human review required due to 'allow-
Related branches
- Samuele Pedroni (community): Approve
- Alex Murray: Approve
-
Diff: 568 lines (+448/-66)2 files modifiedreviewtools/sr_declaration.py (+49/-63)
reviewtools/tests/test_sr_declaration.py (+399/-3)
Changed in review-tools: | |
assignee: | nobody → Emilia Torino (emitorino) |
status: | New → In Progress |
Changed in review-tools: | |
status: | In Progress → Fix Committed |
Changed in review-tools: | |
status: | Fix Committed → Fix Released |
I think this is expected - the snap declaration should use regex's for matching these attributes - something like the following I think (off the top of my head, this is untested):
"custom-device": { installation" : [
"honeywell- international- inc"
"slot- attributes" : {
"devices" : "/dev/( mtd\\[0- 9\\]|chunkfs/ chunkfs\ \[0-2\\ ])",
"read- devices" : "/dev/chunkfs/ (geom|stats| sizes)"
"slot- names": [
"fram- devices"
"allow-
{
"on-store": [
],
},
]
}
]
}