snapcraft.yaml root level plugs doesn't propagate to hooks
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
Incomplete
|
Undecided
|
Unassigned | ||
snapd |
Fix Released
|
High
|
Paweł Stołowski |
Bug Description
If you have a snapcraft project setup with the snap/hooks folder with any kind of hook in it, and a root level plugs specification in your snapcraft.yaml like so:
```yaml
name: test-snapcraft-
version: '0.1'
summary: test of snapcraft.yaml root level plugs and hooks
description: test root level plugs in snapcraft.yaml
grade: devel
confinement: devmode
plugs:
home: {}
removable-media: {}
network: {}
network-bind: {}
apps:
test-
command: echo "hello"
parts:
my-part:
plugin: nil
```
the generated snap.yaml has the same root level plugs spec, but nothing about the hook:
```yaml
name: test-snapcraft-
version: '0.1'
summary: test of snapcraft.yaml root level plugs and hooks
description: test root level plugs in snapcraft.yaml
architectures:
- amd64
confinement: devmode
grade: devel
plugs:
home: {}
network: {}
network-bind: {}
removable-media: {}
apps:
test-
command: command-
```
The snap.yaml should also propagate to the hooks spec in the snap.yaml, specifying something like this:
```yaml
hooks:
configure:
plugs:
- home
- network
- network-bind
- removable-media
```
This could also be considered a snapd bug where the root level plugs in the snap.yaml also by default cover the hooks too.
Changed in snapd: | |
importance: | Undecided → High |
Changed in snapd: | |
assignee: | nobody → Paweł Stołowski (stolowski) |
status: | New → In Progress |
I think there is also a snapd bug here:
- make a snap that has implicitly defined hook (just add a hook to meta/hooks)
- define a top-level plug or slot
- load the info and see what you get:
You will get the hook (yay), you will get the slot (yay) but the slot will not be present on the hook. We don't attach interfaces to implicitly defined hooks.