← Back to issue list

feat(store): close a channel for specific architectures

View original Github issue

Metadata

Project
snapcraft
Number
#6520
Type
pull request
State
open
Author
mbeijen
Labels
—
Created
Updated
Closed
—

Current evaluation

Adds --arch flag to snapcraft close to close channels per-architecture. New feature, 5 days old, no review yet, CI mostly passing with one failing security scan.

Suggested action: needs review

Reason: This is a new feature PR (5 days old) addressing a long-requested capability (referenced by multiple forum threads and Launchpad bug #1732501). The implementation follows the web UI workaround and includes safety checks. It has no reviewer yet and one failing CI check (OSV-scanner) that needs investigation, but the diff is clean (+346/-3, 5 files) and the author has verified lint and test locally.

Evaluated by: mr-cal-bot

Impact: 70 Quick Win: 23 Complexity: 45 Confidence: 75 Actionability: 60

Issue body

Add `--arch` to `snapcraft close`, so a channel can be closed for specific architectures only: ``` snapcraft close my-snap stable --arch amd64 ``` The store API can't close a channel per architecture; `POST /dev/api/snaps/<id>/close` only takes a list of channels. The snapcraft.io web UI works around this in `closeRevision`: it closes the channel and then releases the revisions of the other architectures to it again. This PR does the same from the CLI. `--arch` can be repeated. Without it, `close` behaves as before. Before changing anything, the command reads the channel map and refuses when: - a requested architecture has no release in the channel - a revision that should be kept is also built for an architecture being closed, because releasing it again would bring that architecture back - a kept architecture has a progressive release in progress Before closing, it prints the revisions it will release again, so they can be restored by hand if a release fails partway. The progressive check comes from a real failure. I had a 10% progressive release on `stable` and closed one architecture through the web dashboard. The other architecture's newer revision was released again without its progressive settings, so `stable` went to 100% of the new version. Releasing a progressive revision again would also pick a new random set of devices and drop a paused state, so the command refuses instead of trying to rebuild the rollout. Users have asked for this on the forum many times, and the only answer has been to close the whole channel and release the wanted revisions again by hand: - https://forum.snapcraft.io/t/7517 - https://forum.snapcraft.io/t/10510 - https://forum.snapcraft.io/t/28405 - https://forum.snapcraft.io/t/29002 - https://forum.snapcraft.io/t/34031 ### Open questions - **A store API for this.** Closing and releasing again leaves the channel briefly closed for the other architectures too. A store endpoint that unreleases a single architecture from a channel would avoid that, and would let both the CLI and the dashboard drop the workaround. Is that something the store team could add? - **The dashboard bug.** On load, `getReleaseDataFromChannelMap` in snapcraft.io keeps only the first channel-map entry per channel and architecture, so during a progressive release it drops one of the two revisions. `closeRevision` then releases the kept revision again without its progressive settings. Should snapcraft.io refuse in the same cases as this PR? I also added a "Close a channel" section to the how-to on managing revisions and releases, which didn't cover `snapcraft close` yet. --- - [x] I've followed the [contribution guidelines](https://github.com/canonical/snapcraft/blob/main/CONTRIBUTING.md). - [x] I've signed the [CLA](http://www.ubuntu.com/legal/contributors/). - [x] I've successfully run `make lint && make test`. - [x] I've added or updated any relevant documentation. - [x] In documents I changed, I [added a meta description](https://canonical-starflow.readthedocs-hosted.com/how-to/add-a-page-meta-description/) if one was missing. - [ ] I've updated the relevant release notes. 🤖 Generated with [Claude Code](https://claude.com/claude-code)

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b
Impact: 70
Quick Win: 23
Complexity: 45
Confidence: 75
Actionability: 60
needs review Adds --arch flag to snapcraft close to close channels per-architecture. New feature, 5 days old, no review yet, CI mostly passing with one failing security scan.

Update history

Date Change
updated
updated
created

Related issues

Issue Project State Summary Similarity
#1732501 it's not possible to close a channel for only one architecture snapcraft (launchpad) open Architecture-specific channel closing remains unimplemented and open: snapcraft close still targets all architectures, while the Store API has no scoped close operation.
76%
#1752459 Not possible to close a channel for only a specific architecture snapcraft (launchpad) open Acknowledged gap: `snapcraft close` (snapcraft/commands/manage.py) accepts only name+channel and posts {"channels":[channel]} to /dev/api/snaps/<id>/close, closing all arches; no arch-scoped close exists and store API lacks it. Workaround: close then reopen other arches.
72%