projects: add project model and validation (CRAFT-763)
Metadata
Current evaluation
Merged into snapcraft/7.0 after approval and CI checks. Added pydantic models and validators for snapcraft.yaml project files, adjusted package layout to prevent cyclic imports, and increased coverage by 2.02%.
Suggested action: —
No scores available.
Issue body
Add pydantic model and validators for the snapcraft.yaml project file,
based on legacy schema and public documentation.
Package layout was slightly changed to prevent cyclic imports during
test execution. The layout may be further changed during the integration
of craft-parts. Additional validation and tests will be added as more features are
implemented.
Signed-off-by: Claudio Matsuoka <claudio.matsuoka@canonical.com>
- [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] Have you successfully run `./runtests.sh static`?
- [x] Have you successfully run `./runtests.sh tests/unit`?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged into snapcraft/7.0 after approval and CI checks. Added pydantic models and validators for snapcraft.yaml project files, adjusted package layout to prevent cyclic imports, and increased coverage by 2.02%. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Adds a pydantic model and validators for the snapcraft.yaml project file. Package layout was adjusted to prevent cyclic imports during testing. Code coverage increased by 2.02%. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged into snapcraft/7.0. Implemented a pydantic model and validators for snapcraft.yaml project configuration. Adjusted package layout to prevent cyclic imports. Increased overall coverage by 2.02% with 89.60% diff coverage. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #3526 project: validate snapcraft yaml before using it (CRAFT-55) | snapcraft | closed | Merged into master. Moves snapcraft YAML validation to get_project() to prevent errors during extension application and JSON schema checks. Approved by two reviewers. | |
| #3654 projects: add grammar validation | snapcraft | merged | Merged after review and CI approval. Adds pydantic validation for snapcraft.yaml grammar using craft-grammar models. A follow-up update was noted to align with a craft-grammar version change that switched grammar entries to lists. | |
| #3637 meta: generate basic snap.yaml (CRAFT-801) | snapcraft | merged | Merged into snapcraft/7.0, adding automatic generation of a basic snap.yaml to enable snap packing. Approved by a reviewer, passed CI, and increased test coverage by 1.16%. |