feat(stack)!: require an explicit stack ID instead of guessing one - #2146
Open
patrickhilker wants to merge 2 commits into
Open
patrickhilker wants to merge 2 commits into
patrickhilker wants to merge 2 commits into
Conversation
Commands operating on a container stack no longer pick a stack on their own. The stack ID has to be passed via --stack-id/-s (or as argument) or set in the context with `mw context set --stack-id`. - remove the fallback to the project's default stack (project ID used as stack ID) from `container run`, `volume create` and `volume delete` - remove the automatic selection of a project's only stack from all stack-aware commands - `stack delete` now always deletes the stack, including a former default stack, instead of only emptying it; --with-volumes is deprecated and has no effect anymore - `volume create` verifies that the stack belongs to the given project BREAKING CHANGE: Commands that operate on a stack (`container run`, `volume create`, `volume delete`, `stack deploy`, `stack ps`, `stack delete`, `stack template install`) fail if no stack ID is given via flag, argument or context, even if the project has only a single stack. `stack delete` now removes a project's default stack instead of emptying it.
patrickhilker
marked this pull request as ready for review
September 29, 2026 19:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR: Stack-aware commands no longer guess a stack. The stack ID must be passed via
--stack-id/-s(or argument) or set in the context. The default-stack special handling is removed. This is a breaking change and will result in a major release.Motivation
Projects no longer get a default stack, and existing default stacks can now be deleted. The CLI used to rely on the default stack in two ways:
container run,volume createandvolume deletefell back to the project ID as stack ID when no stack was given. Without a default stack this fails with an opaque API error.stack deleteonly emptied a project's default stack instead of deleting it.The root cause is a design flaw in the CLI, not in the API: the API modelled stacks from the very beginning, so that the stack feature could later be introduced properly without breaking the API. The CLI, however, wrongly relied on every project always having a default stack (with the project ID as its stack ID). This change removes that assumption.
Additionally, all stack-aware commands silently picked a project's stack if it was the only one. Implicitly choosing a stack (e.g. for
volume delete) is risky, and scripts relying on it break as soon as a second stack is created.Changes
optionalStackFlags/withStackIdOrDefault;container run,volume createandvolume deletenow use the regularstackFlags/withStackIdwithStackIdstack deletealways callsdeleteStack;--with-volumesis deprecated and has no effectvolume createchecks that the stack belongs to the given project (the project ID was only used for the default-stack fallback before)Breaking changes
container run,volume create,volume delete,stack deploy,stack ps,stack deleteandstack template installfail withNo stack ID given. Please specify one with --stack-id or set a default stack with 'mw context set --stack-id <stack-id>'if no stack ID is given via flag, argument or context — even if the project has only a single stack.stack deleteremoves a project's default stack instead of emptying it.Testing
yarn lint,yarn compileandyarn testpass. There are no existing tests covering stack resolution or the affected commands; the change was not tested against the live API. The docs indocs/*.mdwill be regenerated by the README workflow.🤖 Generated with Claude Code