fix: parse a snap file for the sign-build command
Metadata
Current evaluation
Merged fix aligning legacy and modern Craft CLI argument parsing for the sign-build command, resolving mismatch errors. Also removed redundant --local help text. Addresses #5618. Approved and passed CI.
Suggested action: —
No scores available.
Issue body
- [x] Have you followed the [guidelines for contributing](https://github.com/canonical/snapcraft/blob/main/CONTRIBUTING.md)?
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [x] Have you successfully run `make lint`?
- [x] Have you successfully run `make test`?
---
Snapcraft's legacy code passthrough requires that the modern Craft CLI implementations of legacy's CLI interfaces have the exact same arguments. For example, a legacy command with a click argument for `--foo` should have a corresponding `--foo` on its modern Craft CLI interface. This wasn't the case for the `sign-build` command, so following the advice of `--help` (generated by Craft CLI) would result in an error as the legacy backend expected `snap-file`, but providing a `snap-file` would result in an error as Craft CLI's validation of the argparse namespace would complain about `snap-file`.
This PR fixes that behavior, and as a drive-by, also removes this extra `--local` in the help text:
```
--local, --local: sign assertion, but do not upload to the Snap
Store
```
Fixes #5618.
SNAPCRAFT-1180
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged fix aligning legacy and modern Craft CLI argument parsing for the sign-build command, resolving mismatch errors. Also removed redundant --local help text. Addresses #5618. Approved and passed CI. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged fix aligning the sign-build command's modern Craft CLI with legacy argument expectations. Correctly parses the snap-file argument and removes a redundant --local help text flag. Resolves #5618. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Fixes argument parsing mismatch for the sign-build command by aligning the modern Craft CLI interface with legacy snap-file expectations. Removes redundant --local help text. Resolves #5618. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #831 'sign-build' implementation. | snapcraft | merged | Merged the snapcraft sign-build command for generating, signing, and pushing assertions. Supersedes PR 795. Lint errors were fixed and design concerns regarding future release integration were resolved with reviewer approval. | |
| #6228 refactor: migrate sign-build command | snapcraft | merged | Merged refactoring PR that migrates the sign-build command out of the legacy codebase (SNAPCRAFT-1320). Approved by two reviewers and integrated after a lint failure was resolved in a separate PR. | |
| #3173 cli: use snap pack instead of mksquashfs | snapcraft | merged | Merged. Replaced mksquashfs with snap pack, aligning with snapd standards and removing the --check-skeleton flag. Code refactored into snapcraft.cli. Windows support deferred to multipass. Approved and merged after passing CI. | |
| #839 Fixing 'sign-build' integration tests. | snapcraft | merged | Merged fix for sign-build integration tests. Updated the test to build, register, and sign a snap, and extended the fake server for account-info. Approved by one reviewer; merged with 57 additions and 17 deletions across three files. |