projects: add grammar validation
Metadata
Current evaluation
Merged #3654 via commit 17fcb85f8, validating snapcraft.yaml with craft-grammar Pydantic models before processing grammar-aware properties.
Resolution: closed resolved
Reason: PR #3654 was merged with implementation commit 59cf3f488. It added craft-grammar validation before grammar-aware project properties were processed.
Evaluated by: mr-cal-bot
No scores available.
Issue body
Validate snapcraft.yaml using pydantic validation models supplied by
craft-grammar before processing grammar-aware properties.
- [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/)?
- [ ] Have you successfully run `./runtests.sh static`?
- [ ] Have you successfully run `./runtests.sh tests/unit`?
-----
CRAFT-826
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged #3654 via commit 17fcb85f8, validating snapcraft.yaml with craft-grammar Pydantic models before processing grammar-aware properties. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged #3654 (ff705ed), adding pydantic validation of snapcraft.yaml grammar using craft-grammar models before processing grammar-aware properties. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #3654, adding Pydantic validation of snapcraft.yaml grammar using craft-grammar models; landed in merge commit 17fcb85f8. | |
| qwen/qwen3.6-35b-a3b | — | — | 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. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged after implementing pydantic-based grammar validation for snapcraft.yaml via craft-grammar models. The author noted a necessary update to a patched craft-grammar version. Codecov confirmed 100% diff coverage and a 0.16% overall increase. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #3633 projects: add project model and validation (CRAFT-763) | snapcraft | merged | Merged PR #3633 as d6636e12c, adding Pydantic models and validators for snapcraft.yaml, tests, and a package layout change to avoid cyclic imports. | |
| #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. | |
| #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. | |
| #328 fix: allow a mix of strings and dicts for grammar | craft-application | merged | Merged craft-application#328 as commit 2a1115d0, allowing grammar lists to mix strings and dicts; released in 2.6.2 and regression-tested by snapcraft#4768. | |
| #3 grammar: import from Snapcraft (CRAFT-818) | craft-grammar | merged | Merged PR #3 (69a12dc) imported the grammar from Snapcraft, updated lint/type tooling, and decoupled GrammarProcessor from ProjectOptions. |