← Back to issue list

snapcraftctl: add checks for empty string for set-version & set-grade

View original Github issue

Metadata

Project
snapcraft
Number
#3325
Type
pull request
State
merged
Author
cjp256
Labels
—
Created
Updated
Closed

Current evaluation

Merged PR #3325 added explicit empty-string validation for snapcraftctl set-version and set-grade, replacing cryptic downstream failures with helpful errors.

Resolution: closed resolved

Reason: PR #3325 was merged via commit 63246a6d9. The change makes invalid empty version and grade values fail immediately with clear messages.

Evaluated by: mr-cal-bot

No scores available.

Issue body

It's a pretty common mistake for scriplets to end up setting "" in set-version, leading the the following error: `Failed to generate snap metadata: 'adopt-info' refers to part <part>, but that part is lacking the 'parse-info' property.` Setting an empty grade effectively just ignores the invalid value, relying on the default grade later. Explicitly error out with helpful messages when invalid options are used. Signed-off-by: Chris Patterson <chris.patterson@canonical.com> - [ ] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)? - [ ] 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`? -----

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged PR #3325 added explicit empty-string validation for snapcraftctl set-version and set-grade, replacing cryptic downstream failures with helpful errors.
stealth/space-bunny-alpha — closed resolved Merged PR #3325 as commit 63246a6d9, adding explicit empty-value checks and helpful errors for snapcraftctl set-version and set-grade.
stealth/space-bunny-alpha — closed resolved PR #3325 merged explicit empty-string validation for snapcraftctl set-version and set-grade, replacing cryptic downstream errors with helpful messages.
qwen/qwen3.6-35b-a3b — — Merged validation checks for empty strings in snapcraftctl set-version and set-grade. Empty inputs previously caused cryptic metadata errors. The change now explicitly rejects invalid values with clear error messages. Approved and merged.
qwen3.6-35b-a3b-mtp-q6 — — Merged. Adds validation for empty strings in snapcraftctl's set-version and set-grade. Prevents metadata errors by rejecting empty values with clear messages instead of relying on defaults.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#2067 many: add snapcraftctl set-grade snapcraft merged Merged PR #2067 in commit 4713f4ae3, adding snapcraftctl set-grade and validating final snap.yaml metadata; resolves #2064.
73%