lifecycle: clean without parsing if possible.
Metadata
Current evaluation
Merged an optimization that skips YAML parsing during snapcraft clean when no parts or steps are specified, fixing invalid YAML failures and improving performance. Resolved after correcting step argument handling to pass CI tests.
Suggested action: —
No scores available.
Issue body
Currently snapcraft cleans each step of each part individually, even when `clean` is run without any parts or steps. This wastes time parsing YAML, and will even fail to clean if the YAML is invalid.
This PR fixes LP: [#1596596](https://bugs.launchpad.net/snapcraft/+bug/1596596) by cleaning smarter; it parses YAML as a last resort. If no parts are supplied, it cleans entire steps.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged an optimization that skips YAML parsing during snapcraft clean when no parts or steps are specified, fixing invalid YAML failures and improving performance. Resolved after correcting step argument handling to pass CI tests. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Optimizes snapcraft clean to skip YAML parsing when no parts or steps are specified, resolving LP #1596596 and preventing failures on invalid YAML. A default step argument bug causing CI failures was fixed prior to merge. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Optimizes snapcraft clean to skip YAML parsing when no parts or steps are specified, resolving LP #1596596. A test failure regarding step argument handling was fixed prior to merge. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2458 clean: error out on invalid or missing yaml | snapcraft | merged | Merged. Modifies the clean command to fail if snapcraft.yaml is missing or lacks a name field, preventing accidental cleanup of non-snapcraft projects. Resolves LP #1777501. Approved, passed CI, and merged. |