Skip to content

failed when promote snap using option: --yes #4312

Closed

Description

@boukendesho

Bug Description

I want to promote a snap without confirmation, so i use --yes option

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

Activity

  1. boukendesho commented on Aug 10, 2023

    @boukendesho
    Author

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

    drop the 'latest/' track name also got same error

  2. sergiusens commented on Aug 10, 2023

    @sergiusens
    Contributor

    Thanks for the report. Is the error confusing? what we are essentially saying is that you shouldn't be auto promoting from edge as it is a moving target

  3. boukendesho commented on Aug 10, 2023

    @boukendesho
    Author

    @sergiusens Yeah a bit confusing to me, so this is a normal behavior by design? I want to automatically promote through cron tasks. Is there any way to do this currently?

  4. sergiusens commented on Aug 11, 2023

    @sergiusens
    Contributor

    Not currently, but we can consider adding a flag like --enable-dangerous-promotion. Since edge is a moving target, there is no set that can be created from edge in a reliable way. We could also consider creating sets with version and/or build ids (launchpad and our action-build add these)

  5. boukendesho commented on Aug 11, 2023

    @boukendesho
    Author

    @sergiusens ok, thx

  6. krille-chan commented on Sep 18, 2023

    @krille-chan

    This got closed, does it mean that --enable-dangerous-promotion is now implemented?

  7. 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions