unused and potentially confusing support for plugs/slots at a part level in the snapcraft.yaml schema
Metadata
Current evaluation
Snapcraft 2.9 now rejects plugs and slots declared at the part level via merged PR canonical/snapcraft#514 (6fabd20bc); the fix passed SRU verification.
Resolution: closed resolved
Reason: Merged PR canonical/snapcraft#514, commit 6fabd20bc, added schema validation that rejects part-level plugs and slots. The fix shipped in Snapcraft 2.9 and passed stable-release verification.
Evaluated by: mr-cal-bot
No scores available.
Issue body
[Impact]
* snapcraft has a schema that describes allowed snapcraft.yaml files. Part of this schema describes plugs and slots that are defined as the level of a part (so not globally and not at the level of an app).
* keeping this code in the schema can create potential confusion for users who expect snapcraft to validate the input to be correct.
* the change is minimal, altering the schema only
[Test Case]
* create a snapcrat.yaml with a part defining a plug and a slot
* run snapcraft
* snapcraft should complain about the plug/slot definition at a part level
...
parts:
foo:
plugin: nil
plugs: [iface1]
slots: [iface2]
...
[Regression Potential]
* snaps that used parts defining plugs or slots will no longer build
* snaps that will be built after removing the offending declarations will behave exactly as before so the regression potential is minimal
[Other Info]
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Snapcraft 2.9 now rejects plugs and slots declared at the part level via merged PR canonical/snapcraft#514 (6fabd20bc); the fix passed SRU verification. | |
| stealth/space-bunny-alpha | — | closed resolved | Part-level plugs/slots were rejected by merged PR canonical/snapcraft#514 (commit 6fabd20bc), released in Snapcraft 2.9 after successful verification. | |
| stealth/space-bunny-alpha | — | closed resolved | Part-level plugs and slots are now rejected by snapcraft.yaml validation. Merged in canonical/snapcraft#514 via commit 6fabd20bc. | |
| qwen/qwen3.6-35b-a3b | — | — | Removed unused schema support for part-level plugs and slots in snapcraft.yaml. The schema now rejects these definitions, preventing user confusion. Verified and closed. | |
| qwen/qwen3.6-35b-a3b | — | — | Removed unused part-level plugs and slots from the snapcraft.yaml schema. Snapcraft now rejects these definitions, resolving validation confusion. The change was verified and the issue closed. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Likely Fixed By:
canonical/snapcraft#514
(confidence 100%)
Merged as commit 6fabd20bc and included in Snapcraft 2.9.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2884 plugs/slots: match output format read in snapcraft.yaml | snapcraft | merged | Merged PR #2884 (commit 70e7789a7, cjp256) reverted the long-form plug/slot emission from #2840, restoring 3.8 output so snap.yaml matches the syntax used in snapcraft.yaml (no implied `interface`). | |
| #503 Reject plug/slot definitions at part level | snapcraft | closed | PR #503 (zyga) removing misleading part-level plugs/slots schema entries was closed unmerged by sergiusens on 2016-05-24 in favour of #514, which added real validation rejecting plugs/slots in parts. | |
| #2840 plugs: plugs can have no element | snapcraft | merged | Merged in snapcraft#2840 via commit 971424d0c, fixing null plug and slot definitions to use their names as implicit interfaces instead of crashing. |