yaml_utils: move _load_yaml from project for re-use (and add tests)
Metadata
Current evaluation
Merged. Moved _load_yaml to yaml_utils as load_yaml_file, added tests, and improved error handling to raise YamlValidationError. Approved, passed CI, and changed 3 files. Logic will be reused for snapcraft config files.
Suggested action: —
No scores available.
Issue body
Rename to `load_yaml_file`.
This version of load has the most complete error handling,
converting the assortment of yaml errors into a YamlValidationError.
We will re-use this logic for snapcraft's configuration file.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged. Moved _load_yaml to yaml_utils as load_yaml_file, added tests, and improved error handling to raise YamlValidationError. Approved, passed CI, and changed 3 files. Logic will be reused for snapcraft config files. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Moved load_yaml to yaml_utils, renamed to load_yaml_file, and added tests. Enhanced error handling converts YAML errors to YamlValidationError. Now available for reuse in snapcraft configuration files. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged changes moving and renaming _load_yaml to load_yaml_file in yaml_utils. Added tests and improved error handling to convert YAML errors into YamlValidationError for reuse in snapcraft configuration files. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #3385 yaml_utils: promote module to a package | snapcraft | merged | Merged after rebasing to resolve conflicts. Promoted yaml_utils to a package by moving error handling and tests to snapacraft.yaml_utils.errors. Approved and passed CI. | |
| #2517 project: ensure yaml load returns a dictionary | snapcraft | merged | Merged fix for SNAPCRAFT-JQ ensuring yaml.load returns an empty dictionary instead of None for empty files. Prevents validation crashes when Snapcraft processes empty YAML. Approved by reviewer and passed all CI checks. | |
| #4338 refactor(parts): move yaml utils out of lifecycle | snapcraft | merged | Merged into main after approval and passing CI. Relocated four YAML utility functions from the lifecycle module to yaml_utils. No functional changes. Prepares codebase for related work. | |
| #2160 many: refactor snapcraft.yaml loading out of load_config | snapcraft | merged | Merged a refactor separating raw snapcraft.yaml loading from validated processing within load_config. Approved by reviewer, passed CI checks, and integrated into master with 95.54% diff coverage. | |
| #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. | |
| #3669 parts: raise error when duplicate keys are used | snapcraft | merged | Merged. Refactored YAML loading into a new yaml_utils module and forward-ported safe loading to raise errors for duplicate keys in parts configuration. Approved by reviewer and passed CI. |