Skip to content

snapcraft promote doesn't work when using the --yes flag. #5945

Closed

Description

@Guillaumebeuzeboc

Check existing issues

  • I've verified that this bug isn't described by any existing issues.

Bug description

The snapcraft promote cmd doesn't work when using the --yes flag.

In the context of a CI I must promote from edge to beta.
When calling the command, it seems the --yes flag prevent the command from working.

$ snapcraft promote ros2-snapd --from-channel edge --to-channel beta --yes
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: 'edge' is not a valid set value for --from-channel when using --yes.

Similar issue happens specifying the latest track:

$ snapcraft promote ros2-snapd --from-channel latest/edge --to-channel latest/beta --yes
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.

Without the --yes cmd, everything works as expected:

$ snapcraft promote ros2-snapd --from-channel jazzy/edge --to-channel jazzy/stable
snapcraft promote does not have a stable CLI interface. Use with caution in scripts.
Build set information for 'jazzy/edge'
Arch      Revision  Version
amd64           46  0+git.8c248c6
arm64           47  0+git.8c248c6
Do you want to promote the current set to the 'jazzy/stable' channel? [y/N]: y
Promotion from jazzy/edge to jazzy/stable complete

Environment

snapcraft 8.13.2

Activity

  1. bepri commented on Jan 7, 2026

    @bepri
    Member

    As some additional context, this is the offending if statement.

    This code was added in #3185, which doesn't give a clear motivation for excluding this behavior when promoting from edge. Since the store gives the same confirmation requirements (just a single "are you sure?") for this operation, I am inclined to say Snapcraft should have the same behavior. That is, this behavior of requiring manual confirmation even with --yes only for edge should be removed.

    I'm curious if anyone has any opposing thoughts, though.

  2. MirkoFerrati commented on Jan 8, 2026

    @MirkoFerrati
    Contributor

    @bepri see this also #4312

  3. bepri commented on Jan 8, 2026

    @bepri
    Member

    Thanks for this extra context @MirkoFerrati - I didn't find this issue!

  4. self-assigned this
    on Jan 8, 2026
  5. syncronize-issues-to-jira commented on Jan 8, 2026

    @syncronize-issues-to-jira

    Thank you for reporting your feedback to us!

    The internal ticket has been created: https://warthogs.atlassian.net/browse/SNAPCRAFT-1268.

    This message was autogenerated

  6. Hook25 commented on Jan 12, 2026

    @Hook25

    Given that the other issue was closed, bumping that we are still using this bodge to work around the issue

  7. bepri commented on Jan 12, 2026

    @bepri
    Member

    Thanks, @Hook25. There seems to be agreement in the team that we want to fix this, but we haven't yet decided if that's through something like --allow-unsafe-promotion or by simply letting --yes work in this case.

  8. mr-cal commented on Jun 15, 2026

    @mr-cal
    Collaborator

    This has been fixed in Snapcraft 9.0.

    Anyone using workarounds in a Github workflow like this:

    env:
        SNAPCRAFT_HAS_TTY: "true"
    run: |
      yes | snapcraft promote <snap-name> --from-channel latest/edge --to-channel latest/beta

    can use the --yes flag instead:

    run: |
      snapcraft promote <snap-name> --from-channel latest/edge --to-channel latest/beta --yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions