cmd/snap: expose key commands in help listings#16808
cmd/snap: expose key commands in help listings#16808zyga wants to merge 1 commit intocanonical:masterfrom
Conversation
Unhide create-key, delete-key and keys so these commands are discoverable. Include key management commands in the Development category for "snap help --all", update the empty-keys guidance to point to "snap create-key", and add a manpage regression test for key command sections. Fixes: https://bugs.launchpad.net/snapd/+bug/1982499 Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
There was a problem hiding this comment.
Pull request overview
This PR makes snap’s key management commands easier to discover by un-hiding them, ensuring they’re included in snap help --all under the Development category, updating the “no keys” guidance to point to snap create-key, and adding a regression test to ensure the manpage lists key command sections.
Changes:
- Unhide
create-key,delete-key, andkeyscommands so they appear in help/manpage output. - Add key management commands to the Development category’s
--alllisting. - Update empty-key guidance text and add a manpage test to assert key commands appear as manpage subsections.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/snap/cmd_keys.go | Unhides keys and updates empty output guidance to reference snap create-key. |
| cmd/snap/cmd_keys_test.go | Updates stderr expectation for the revised empty-key guidance text. |
| cmd/snap/cmd_help.go | Adds key commands to the Development category --all command list. |
| cmd/snap/cmd_help_test.go | Adds regression coverage verifying manpage includes key command .SS sections. |
| cmd/snap/cmd_delete_key.go | Unhides delete-key so it appears in help/manpage output. |
| cmd/snap/cmd_create_key.go | Unhides create-key so it appears in help/manpage output. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #16808 +/- ##
==========================================
- Coverage 77.56% 77.55% -0.01%
==========================================
Files 1361 1364 +3
Lines 188402 188543 +141
Branches 2446 2446
==========================================
+ Hits 146131 146229 +98
- Misses 33447 33488 +41
- Partials 8824 8826 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Tue Mar 24 13:54:26 UTC 2026 Failures:Preparing:
Executing:
Skipped tests from snapd-testing-skip
|
|
@zyga historically we didn't list them because one is meant to go through snapcraft as only snapcraft has register-key |
| cmd := addCommand("create-key", | ||
| i18n.G("Create cryptographic key pair"), | ||
| i18n.G(` | ||
| The create-key command creates a cryptographic key pair that can be |
There was a problem hiding this comment.
given what @pedronis mentioned about snapcraft being the preferred UI, maybe the help message could mention that.
Unhide create-key, delete-key and keys so these commands are discoverable. Include key management commands in the Development category for "snap help --all", update the empty-keys guidance to point to "snap create-key", and add a manpage regression test for key command sections.
Fixes: https://bugs.launchpad.net/snapd/+bug/1982499