project_loader: add preflight check
Metadata
Current evaluation
Merged. Adds a preflight check to validate snap directory contents, resolving LP #1791368. Implementation refactored into snapcraft.project as project sanity checks, retained in cli.lifecycle. Approved and merged after code review.
Suggested action: —
No scores available.
Issue body
- [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [x] If this is a bugfix. Have you checked that there is a bug report open for the issue you are trying to fix on [bug reports](https://bugs.launchpad.net/snapcraft)?
- [x] If this is a new feature. Have you discussed the design on the [forum](https://forum.snapcraft.io)?
- [x] Have you successfully run `./runtests.sh static`?
- [x] Have you successfully run `./runtests.sh tests/unit`?
-----
This is a mechanism that can be used for further quick sanity checks, but currently the only one implemented is ensuring that the snap directory doesn't include unexpected things, which makes this PR fix [LP: #1791368](https://bugs.launchpad.net/snapcraft/+bug/1791368).
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged. Adds a preflight check to validate snap directory contents, resolving LP #1791368. Implementation refactored into snapcraft.project as project sanity checks, retained in cli.lifecycle. Approved and merged after code review. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Added a preflight check to validate snap directory contents. Refactored into snapcraft.project as project sanity checks. Fixes LP: #1791368. One test failure was linked to an unrelated LXD issue. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Adds a preflight sanity check to the project loader, validating the snap directory and fixing LP: #1791368. Checks were relocated to the project package and renamed during review. The change was merged after passing unit tests and code coverage. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2279 sanity checks: run properly on build VMs | snapcraft | merged | Merged. Updated snap directory sanity checks from cwd-relative to project-relative paths to resolve build VM failures. Resolves LP: #1792962. Approved by one reviewer with 14 additions and 7 deletions across two files. | |
| #1141 parser: use the project loader code to find the origin's snapcraft.yaml | snapcraft | merged | Merged a refactor replacing custom snapcraft.yaml detection with existing project_loader code, resolving LP bug #1665007. The author addressed reviewer feedback on commit formatting and conventions before final approval. |