snapcraft close should complain early with one argument
Bug #1735800 reported by
Adam Collard
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
I find myself accidentally omitting the snap name quite often with snapcraft and didn't notice my mistake when attempting to close a branch using:
⟫ snapcraft close edge/bump-20
Your account lacks permission to close channels for this snap. Make sure the logged in account has upload permissions on 'edge/bump-20' in series '16'.
snapcraft knows that 'close' needs at least two arguments and additionally it should know that '/' is not a valid character for a snap name. By applying this knowledge, snapcraft could help me realise my typo.
Bonus points if it inspects the current directory for a snapcraft.yaml and suggests the right command to me.
To post a comment you must log in.
This has happened to users in the wild:
https:/ /forum. snapcraft. io/t/unable- to-close- channel- in-a-track/ 7063/4
https:/ /forum. snapcraft. io/t/firefox- please- create- the-track- esr/5006/ 22
Other than Adam's suggestion, perhaps the error message template can be changed to clearly indicate it's talking about the *snap* name, not the channel.
diff --git a/snapcraft/ storeapi/ errors. py b/snapcraft/ storeapi/ errors. py storeapi/ errors. py storeapi/ errors. py singPermissionE rror(StoreError ):
index 709b204a..25ef0b9f 100644
--- a/snapcraft/
+++ b/snapcraft/
@@ -598,8 +598,8 @@ class StoreChannelClo
fmt = (
'Your account lacks permission to close channels for this snap. Make '
- 'sure the logged in account has upload permissions on {snap_name!r} '
- 'in series {snap_series!r}.'
+ 'sure the logged in account has upload permissions on the '
+ '{snap_name!r} snap in series {snap_series!r}.'
)
def __init__(self, snap_name, snap_series):