fix: apply yaml transforms first
Metadata
Current evaluation
Merged fix ensuring _extra_yaml_transforms execute before project variable evaluation. Resolves snapcraft#4771 by allowing extensions that inject project variables to function correctly. Approved by two reviewers and passed CI checks.
Suggested action: —
No scores available.
Issue body
- [x] Have you followed the guidelines for contributing?
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [x] Have you successfully run `tox`?
-----
As raised in Matrix ([source](https://matrix.to/#/!GGqzbFAUQprdPgYYCM:ubuntu.com/$5CJQkAjgqbNn48zcF06HS8a0_0cjfogVCA_BDFi7XZE?via=ubuntu.com&via=matrix.org&via=kde.org)), `_extra_yaml_transforms` needs to occur before evaluating project variables.
For example, snapcraft will expand extensions in `_extra_yaml_transforms` and some extensions add project variables to the yaml.
Fixes https://github.com/canonical/snapcraft/issues/4771
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged fix ensuring _extra_yaml_transforms execute before project variable evaluation. Resolves snapcraft#4771 by allowing extensions that inject project variables to function correctly. Approved by two reviewers and passed CI checks. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged fix ensuring _extra_yaml_transforms executes before project variable evaluation. Resolves snapcraft issue #4771 by allowing extensions to correctly inject variables into the yaml. |
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. | |
| #885 fix: Removed reference to snapcraft.yaml in expand extensions | rockcraft | open | One-line fix removing the snapcraft.yaml reference from the expand-extensions help text and docstring, fixing #658. Approved by 2 reviewers with all CI checks green, but unmerged and inactive ~6 months; the fix is still unapplied in the codebase. | |
| #319 fix: apply yaml transforms before grammar | craft-application | merged | Merged a fix to apply extra_yaml_transforms before grammar processing. Backports #316 to hotfix/2.6, ensuring advanced grammar additions work correctly. Approved by two reviewers and passed CI. | |
| #4110 extensions: parse snapcraft.yaml before expanding extensions | snapcraft | merged | Merged fix for the expand-extensions command to parse snapcraft.yaml before expanding extensions. Resolves core22 parsing issues with parse-info and advanced grammar keywords. Approved, passed CI, and merged into main. | |
| #1103 fix: remove snapcraft.yaml reference from expand-extensions | rockcraft | open | Removes snapcraft.yaml references from expand-extensions help text and docstring (3 lines, 1 file). Approved with CI green, but inactive ~6 months; fix still unapplied in codebase; likely duplicate of older PR #885. | |
| #316 fix: apply yaml transforms before grammar | craft-application | closed | Merged to hotfix/2.6 after reviewers redirected it from hotfix/2.5 to align with other changes. The fix ensures extra_yaml_transforms execute before grammar parsing. Approved and shipped. |