Skip to content

feat(images): show affected stacks and containers - #5122

Open
ahlner wants to merge 20 commits into
getarcaneapp:mainfrom
ahlner:feat-image-usage-stacks
Open

ahlner wants to merge 20 commits into
getarcaneapp:mainfrom
ahlner:feat-image-usage-stacks

Conversation

@ahlner

@ahlner ahlner commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor
  • This PR is opened from a feature branch.
  • New user-facing strings use Paraglide.

What this implements

We manage many stacks and need to quickly see which deployments use a vulnerable image. The image overview groups matching containers by Compose project or Swarm stack, shows their status, and links to the project, stack, and container details.

Related: #1215.

Testing

Manually tested with local Docker. Chromium verified navigation to the project and container. Frontend and backend hot reload verified; just format all and just lint all completed. Screenshots use the same example data.

Screenshots

Before After
Image overview before Image overview with affected projects and Swarm stacks

AI assistance

OpenCode (GPT-6.2 Sol) implemented the feature and assisted with tests and verification.

Disclaimer Greptiles Reviews use AI, make sure to check over its work.

To better help train Greptile on our codebase, if the comment is useful and valid Like the comment, if its not helpful or invalid Dislike

To have Greptile Re-Review the changes, mention greptileai.

Confidence Score: 5/5 Tier: plusRetriggerView in Greptile

The PR appears safe to merge; no new actionable issue was found.

Summary

Adds an image overview panel that groups matching containers by Compose project or Swarm stack.

  • Image details show matching containers grouped by Compose project or Swarm stack.
  • Image usage groups link to project, stack, and container details when access allows.
  • Deleting a Swarm stack refreshes lists that include its manager.
  • Security export tests allow refreshes of the visible page.

All four previous threads were rechecked. They are unnumbered, so they receive no numbered ledger entries. The project-scoped container-link thread was manually resolved without explanation.

Review used source checks only. Tests and UI capture were not run; no development stack was started.

Reviews (20) · Last reviewed commit: "Merge remote-tracking branch 'upstream/m..." · Reviewed by Greptile

@ahlner
ahlner requested a review from a team November 28, 2026 21:18
- Group containers running the image by Compose project or Swarm
  stack, listing each container with its status
- Link stacks to registered projects or swarm stacks and containers
  to their detail pages, gated by permissions
- Fetch project/swarm lookups lazily and fall back to plain names
  when a stack is unregistered or lookups fail
- Resolve compose stack projects via runtimeServices container IDs so
  stacks whose compose name differs from the Arcane project name still
  link to the right project
- Treat matches spanning multiple projects as unresolvable; "Not
  registered in Arcane" now only shows when no project matches
- Cover the name-mismatch case in the images E2E spec
@ahlner
ahlner force-pushed the feat-image-usage-stacks branch from d9953e1 to bfd408e Compare November 29, 2026 14:20
@kmendell

Copy link
Copy Markdown
Member

If stacks are referring to docker swarm then leave it, otherwise if its meant to be projects then update the naming to be as such pls.

- The image detail usage panel lists Compose projects and Swarm stacks,
  not just stacks; rename the section label and empty-state copy to say
  both.
- Update e2e selectors and expected text to match the new wording.
@ahlner

ahlner commented Nov 29, 2026

Copy link
Copy Markdown
Contributor Author

If stacks are referring to docker swarm then leave it, otherwise if its meant to be projects then update the naming to be as such pls.

done

@ahlner

ahlner commented Nov 29, 2026

Copy link
Copy Markdown
Contributor Author
affected-projects-and-swarm-stacks

- Add optional resource (type/id) to userHasPermission so resource-scoped
  grants match the specific container, project, or stack
- Link containers and projects only when the user can read that resource
- Link swarm stacks only when they exist in the stack list and
  swarm-stacks:list/read are permitted
- Extend e2e test with a retired swarm stack expecting no link
- The old invalidation used an exact `listPrefix(scope, 'stacks')` query key, so
  stack lists in other environments or with different request options stayed
  stale after a delete.
- Add `invalidateSwarmStackLists`, which matches every `swarm` stacks list query
  whose scope contains the affected environment, and use it from both the stacks
  table and the stack detail page's delete flow.
- Show container links in the image stack usage panel when the user
  holds a project-scoped containers:read grant for the container's
  compose project, matching the server's AllowedComposeProjects
  canonical naming instead of per-container grants only.
- Add E2E coverage for non-global admins with project grants.
The image stack usage panel only linked swarm stacks when the current
environment was a swarm manager, so stacks on worker environments
showed up unlinked. Container task IDs are now matched against task
lists from permitted manager environments, and the stack link points
at the manager that owns the tasks.
- Live updates may refetch the visible page, so stop requiring zero
  list requests after CSV export
- Assert refetched requests use the current page's query params,
  proving the export never fetches other pages
…acks

# Conflicts:
#	frontend/messages/en.json
…acks

# Conflicts:
#	frontend/messages/en.json
…acks

# Conflicts:
#	frontend/messages/en.json

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants