← Back to issue list

Snapcraft 9 fails silently with pre-9 CI promotion syntax

View original Github issue

Metadata

Project
snapcraft
Number
#6294
Type
issue
State
closed
Author
p-gentili
Labels
Status: Triaged
Created
Updated
Closed

Current evaluation

Cancelled `snapcraft promote` prompts now exit non-zero and warn when SNAPCRAFT_HAS_TTY is set without --yes, via PR #6304 (68c28110f), released in Snapcraft 9.0.1.

Resolution: closed resolved

Reason: Maintainer mr-cal closed the issue after commit 68c28110f "fix(commands/promote): exit non-zero when promotion is cancelled (#6304)" was merged, confirming the fix shipped in the Snapcraft 9.0.1 patch release with documented migration to `snapcraft promote --yes`.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### Check existing issues - [x] I've verified that this bug isn't described by any existing issues. ### Bug description When using `yes | snapcraft promote xxx --from-channel latest/edge --to-channel latest/beta` in a GitHub Actions workflow to promote a snap from edge, the step exits 0 and CI stays green, but the promotion does not happen. This behavior has started with snapcraft 9. ``` Warning: snapcraft promote does not have a stable CLI interface. Use with caution in scripts. Build set information for 'latest/edge' Arch Revision Version arm64 635 0.295.0 Channel promotion cancelled ``` Migrating to the new supported syntax, `--yes`, the promotion starts working correctly. Yet, it would be great to make the old syntax fail with error. ### Steps to reproduce A github workflow with the following step ``` - name: Promote `xxx` snap from edge to beta env: SNAPCRAFT_HAS_TTY: "true" run: | yes | snapcraft promote xxx --from-channel latest/edge --to-channel latest/beta ``` ### Environment Github CI, independently from the chosen runner. ### snapcraft.yaml ```yaml If the issue is specific to a project, share its `snapcraft.yaml`. This field automatically renders as YAML, so you don't need to add special formatting. ``` ### Log output ```shell Provide any relevant logging. This field automatically renders as a log, so you don't need to add special formatting. ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Cancelled `snapcraft promote` prompts now exit non-zero and warn when SNAPCRAFT_HAS_TTY is set without --yes, via PR #6304 (68c28110f), released in Snapcraft 9.0.1.
stealth/space-bunny-alpha — closed resolved Fixed in Snapcraft 9.0.1 by PR #6304: cancelled promotions now exit non-zero and warn that SNAPCRAFT_HAS_TTY is unsupported. Use --yes for CI promotion.
qwen/qwen3.6-35b-a3b — — Fixed in Snapcraft 9.0.1. The promote command now warns on legacy SNAPCRAFT_HAS_TTY usage and exits non-zero on cancellation. CI workflows must migrate to the --yes flag to ensure reliable automation.
qwen/qwen3.6-35b-a3b — — Fixed in Snapcraft 9.0.1. The promote command now warns when legacy TTY environment variables are used without --yes and exits non-zero when cancelled. CI workflows should migrate to the --yes flag.
qwen/qwen3.6-35b-a3b — — Fixed in Snapcraft 9.0.1. The promote command now exits with code 1 when cancelled and warns if the legacy SNAPCRAFT_HAS_TTY variable is used without --yes. CI workflows must migrate to the --yes flag for reliable automation.
qwen/qwen3.6-35b-a3b — — Fixed in Snapcraft 9.0.1. The promote command now warns when the legacy SNAPCRAFT_HAS_TTY variable is used without --yes, and exits with a non-zero code if the promotion is cancelled, resolving the silent CI failure.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: canonical/snapcraft#6304 (confidence 95%)

    Merged commit 68c28110f implementing both scoped changes: warn when SNAPCRAFT_HAS_TTY is set without --yes, and return non-zero exit code when promotion is cancelled.

  • Related To: canonical/snapcraft#6218 (confidence 70%)

    Commit 4012735f6 'refactor: migrate promote command (#6218)' moved promote from snapcraft_legacy to craft-cli, which introduced the regression by dropping SNAPCRAFT_HAS_TTY support.

Related issues

Issue Project State Summary Similarity
#6304 fix(commands/promote): exit non-zero when promotion is cancelled snapcraft merged PR #6304 (squash-merged as commit 68c28110f) makes `snapcraft promote` return exit code 1 when a promotion prompt is declined and warns that SNAPCRAFT_HAS_TTY is obsolete. Fixes #6294, shipped in Snapcraft 9.0.1.
82%
#5945 snapcraft promote doesn't work when using the `--yes` flag. snapcraft closed Fixed by merged PR #5984 (commit 1b669ec44), which removed the edge-channel restriction so `snapcraft promote --from-channel edge --to-channel beta --yes` now works. Shipped in Snapcraft 9.0.
71%