Add support for hooks.
Metadata
Current evaluation
Merged into master to add hook support to snapcraft. Hooks are now supported via convention by placing executables in the snap/hooks directory or installing them from parts. Approved and passed CI checks.
Suggested action: —
No scores available.
Issue body
Hooks are now supported in snapd and the click reviewer tools. Time to finish off LP: [#1586465](https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1586465) by supporting them in snapcraft as well. This is done by convention, and two methods are supported:
1. Place hook executables in the `snap/hooks/` directory, and they will be copied into the snap automatically.
2. Install hook executables from parts into the `snap/hooks/` directory.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged into master to add hook support to snapcraft. Hooks are now supported via convention by placing executables in the snap/hooks directory or installing them from parts. Approved and passed CI checks. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged into master, adding hook support to snapcraft. Hook executables in snap/hooks/ or installed via parts are automatically included. The merge maintained 96.34% code coverage and completes support aligned with snapd and click reviewer tools. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged into master, adding snapcraft hook support via the snap/hooks/ directory and part installations. Aligns with snapd and click reviewer tools, maintaining 96.34% code coverage. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #3659 meta: add support for hooks | snapcraft | merged | Merged into snapcraft/7.0 branch after reviewer approval and passing CI checks. Adds support for hooks in snapcraft.yaml, modifying four files with 116 additions and 24 deletions while maintaining 100% diff coverage. | |
| #3837 fix: hooks: process generated hooks | snapcraft | merged | Merged fix to include generated hooks in snap packages. Ports legacy behavior to snapcraft, writing wrappers to meta/hooks/ while preserving pre-existing hooks. Added spread tests for core18, core20, and core22. | |
| #1042 Add documentation for hooks. | snapcraft | merged | Merged documentation update for snapcraft hook support, resolving Launchpad bug #1586465. The change adds 34 lines to one file, achieves 100% diff coverage, and was successfully integrated into the main branch. | |
| #1586465 Add support for hooks | snapcraft (launchpad) | closed | Closed without implementation. The feature request to add snap.yaml hooks support was abandoned or superseded by subsequent snapd developments. | |
| #2850 hooks: enable command-chain | snapcraft | merged | Merged changes enabling command-chain support in hooks regardless of base. The update passes through user-defined command-chain configurations from snapcraft.yaml without actively enabling it. Approved by one reviewer and passed CI checks. | |
| #49 packages: add snap package support | craft-parts | merged | Merged after implementing snap download and installation for stage and build snaps. Approved by two reviewers, passed CI, and added 1,072 lines across five files. Follows snapcraft conventions with future refactoring planned. | |
| #1812003 hooks should be made executable instead of erroring out | snapcraft (launchpad) | closed | Automatic executable permission for hooks was implemented via merged pull request #2440. Snapcraft now sets hook permissions automatically instead of raising an error. |