snapcraft icon indicating copy to clipboard operation
snapcraft copied to clipboard

failed when promote snap using option: --yes

Open krille-chan opened this issue 2 years ago • 3 comments

Bug Description

I want to promote a snap without confirmation, so i use --yes option from the edge channel. Without this I cannot promote my snap in github actions.

This reopens https://github.com/snapcore/snapcraft/issues/4312 as this is not solved for me.

To Reproduce

snapcraft promote SNAP_NAME --from-channel latest/edge --to-channel latest/candidate --yes

then i got

Error: 'latest/edge' is not a valid set value for --from-channel when using --yes.

Environment

Ubuntu 23.04 snapcraft 7.5.2

snapcraft.yaml

no

Relevant log output

no log

Additional context

No response

krille-chan avatar Nov 05 '23 12:11 krille-chan

Interesting, can you provide the output of status for this snap?

sergiusens avatar Nov 30 '23 18:11 sergiusens

Same problem, here's mine:

❯ snapcraft promote --yes --from-channel 'latest/edge' --to-channel 'latest/beta' kissiel-hello2
snapcraft promote does not have a stable CLI interface. Use with caution in scripts.
Usage: snapcraft promote [OPTIONS] <snap-name>
Try 'snapcraft promote -h' for help.

Error: 'latest/edge' is not a valid set value for --from-channel when using --yes.

~ via 🐍 v3.11.6 
❯ snapcraft status kissiel-hello2
Track    Arch    Channel    Version    Revision    Progress
latest   amd64   stable     -          -           -
                 candidate  -          -           -
                 beta       -          -           -
                 edge       0.1.2      1           -    

kissiel avatar Dec 06 '23 15:12 kissiel

We have this workaround, not perfect at all but it works for now: https://github.com/canonical/checkbox/pull/877/files

This is possibly related to this line in snapcraft: https://github.com/snapcore/snapcraft/blob/662af4c00fb43b97b87eef16f4edbba4ff12a1cf/snapcraft_legacy/cli/store.py#L164

Makes me think it is intentional, probably we want a different error message, something like

Error: we don't allow to promote un-branched edge channels with no user interaction

Hook25 avatar Dec 06 '23 15:12 Hook25