meta: don't overwrite preconfigured hooks with stubs
Metadata
Current evaluation
Merged a fix that prevents hook stub generation from overwriting existing preconfigured hooks by verifying script existence first. Includes unit tests and passed CI.
Suggested action: —
No scores available.
Issue body
If a hook stub is being generated it would overwrite a primed
hook (in meta/hooks/). Check for existence of script before
generating the stub.
Add some unit tests to get some needed coverage here, extending
the SnapcraftYaml fixture to include support for hooks.
LP: #1905072
Signed-off-by: Chris Patterson <chris.patterson@canonical.com>
- [ ] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [ ] Have you successfully run `./runtests.sh static`?
- [ ] Have you successfully run `./runtests.sh tests/unit`?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged a fix that prevents hook stub generation from overwriting existing preconfigured hooks by verifying script existence first. Includes unit tests and passed CI. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged a fix preventing hook stub generation from overwriting preconfigured hooks in meta/hooks/ by verifying script existence first. Includes unit tests and resolves LP: #1905072. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged a fix preventing hook stub generation from overwriting existing preconfigured hooks. The change adds an existence check before stub creation and includes unit tests. Resolves LP: #1905072. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2440 meta: make hooks executable instead of complaining they're not | snapcraft | merged | Merged into master. Hooks are now made executable instead of triggering an error, resolving bug #1812003. The change passed CI, received approval, and achieved 100% diff coverage. Whitelisting was deferred to a follow-up PR. | |
| #2441 legacy/meta: make hooks executable instead of complaining they're not | snapcraft | merged | Merged cherry-pick of #2440 that fixes bug #1812003 by making hooks executable instead of raising an error. Approved by one reviewer, passed CI, and modified 2 files. |