← Back to issue list

projects: add project model and validation (CRAFT-763)

View original Github issue

Metadata

Project
snapcraft
Number
#3633
Type
pull request
State
merged
Author
cmatsuoka
Labels
—
Created
Updated
Closed

Current evaluation

Merged PR #3633 as d6636e12c, adding Pydantic models and validators for snapcraft.yaml, tests, and a package layout change to avoid cyclic imports.

Resolution: closed resolved

Reason: PR #3633 was approved and merged in commit d6636e12c. It introduced project-file models and validation based on the legacy schema and public documentation.

Evaluated by: mr-cal-bot

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
stealth/space-bunny-alpha — closed resolved Merged PR #3633 as d6636e12c, adding Pydantic models and validators for snapcraft.yaml, tests, and a package layout change to avoid cyclic imports.
stealth/space-bunny-alpha — closed resolved Merged #3633 into snapcraft/7.0, adding Pydantic models and validation for snapcraft.yaml projects and reorganizing packages to prevent circular imports (d6636e12c).
stealth/space-bunny-alpha — closed resolved Merged into snapcraft/7.0 in #3633, adding Pydantic models and validation for snapcraft.yaml projects and reorganizing imports to avoid cycles.
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%.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#3654 projects: add grammar validation snapcraft merged Merged #3654 via commit 17fcb85f8, validating snapcraft.yaml with craft-grammar Pydantic models before processing grammar-aware properties.
79%
#3526 project: validate snapcraft yaml before using it (CRAFT-55) snapcraft closed Merged PR #3526 in commit 38891b17d, validating project YAML in get_project() before extensions or snap metadata consume potentially invalid data.
75%
#5730 feat: add inheritance-based validation and schemas snapcraft merged Merged as commit 7cfb25977, adding inheritance-based pydantic validation and JSON schema generation (tools/schema.py, snapcraft/models/project.py) for snapcraft.yaml, closing issue #5543.
75%