Improve snapcraft.yaml validation errors.
Metadata
Current evaluation
Merged improvements to snapcraft.yaml validation error messages. Replaces cryptic jsonschema outputs with clear messages for missing or invalid icons, apparmor, and seccomp profiles. Approved by reviewers and integrated into the codebase.
Suggested action: —
No scores available.
Issue body
This PR fixes LP: [#1524663](https://bugs.launchpad.net/snapcraft/+bug/1524663) by improving YAML validation errors across the board. Specifically:
- Improve error message if icon isn't a .png or .svg, or doesn't exist.
Was: "'icon.png' is not an icon-path"
Now: "Specified icon 'icon.png' does not exist" or "'icon' must be either a .png or a .svg"
- Improve error message if apparmor or seccomp profiles don't exist.
Was: "The 'migration' property does not match the required schema: {'security-policy': {'apparmor': 'path/profile', 'seccomp': 'path/profile'}, 'type': 'migration-skill'} is not valid under any of the given schemas"
Now: "Specified file 'path/profile' does not exist"
- Improve generic jsonschema errors to include the properties which had the error.
Was: "None is not of type 'object'"
Now: "The 'parts' property does not match the required schema: None is not of type 'object'"
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged improvements to snapcraft.yaml validation error messages. Replaces cryptic jsonschema outputs with clear messages for missing or invalid icons, apparmor, and seccomp profiles. Approved by reviewers and integrated into the codebase. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged improvements to snapcraft.yaml validation error messages for invalid icons, missing security profiles, and schema mismatches. Resolves Launchpad bug #1524663. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged enhancements to snapcraft.yaml validation error messages. Improved diagnostics for invalid icons, missing apparmor/seccomp profiles, and jsonschema mismatches. Resolved Launchpad bug #1524663 after maintainer approval. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1615 schema: improve invalid app, hook, and part errors | snapcraft | merged | Merged changes improve validation error messages for invalid app, hook, and part names in snapcraft.yaml. Replaces confusing jsonschema errors with custom validation messages, resolving Launchpad bug #1606890. Approved by two reviewers and passed CI. | |
| #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. | |
| #5924 docs: clean up 'snapcraft.yaml' | snapcraft | merged | Merged documentation cleanup for snapcraft.yaml, including typo fixes, docstring link updates, and JSON schema regeneration. Reviewers approved the non-functional changes, and the schema workflow was resolved by running make schema. |