Automatically group Docker Swarm stack containers#506
Draft
Copilot wants to merge 2 commits into
Draft
Conversation
Copilot
AI
changed the title
[WIP] Add support for docker swarm container grouping
Automatically group Docker Swarm stack containers
Jun 17, 2026
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.
Docker Swarm stack containers carry the
com.docker.stack.namespacelabel but lackcom.docker.compose.project, so they appeared as ungrouped "individual containers" instead of grouping by stack like Compose projects do. Users had to manually configuregroupBy: Label+groupByLabel: com.docker.stack.namespaceas a workaround.Changes
Grouping (
ContainerProperties.ts): The defaultCompose Project Namegrouping now falls back to the Swarm stack namespace label, so stack containers group under their stack name with no configuration. Extracted into agetComposeProjectGrouphelper:Group commands (
ContainerGroupTreeItem.ts): Compose-only commands (start/stop/restart/down/logs) require compose files that Swarm stacks don't have.contextValuenow gates thecomposeGroupcontext onisComposeProjectGroup(), so these commands surface only for real Compose projects; stack groups still expand by default and keep the orchestration icon.Updated the
Compose Project Nameproperty description, added unit tests for the grouping cases (compose / swarm / both / standalone), and added a CHANGELOG entry.Note
The issue also mentioned stack-name prefixes in container names feeling redundant. This mirrors Compose exactly (e.g.
project-service-1grouped underproject), which the extension intentionally does not strip, so naming is left unchanged for consistency.