Skip to content

fix: actually redeploy swarm stack when saving edits#2365

Open
GiulioSavini wants to merge 1 commit intogetarcaneapp:mainfrom
GiulioSavini:fix/swarm-stack-update-redeploy
Open

fix: actually redeploy swarm stack when saving edits#2365
GiulioSavini wants to merge 1 commit intogetarcaneapp:mainfrom
GiulioSavini:fix/swarm-stack-update-redeploy

Conversation

@GiulioSavini
Copy link
Copy Markdown
Contributor

@GiulioSavini GiulioSavini commented Apr 13, 2026

What

Editing a Swarm stack and clicking Save only persisted the new compose source to disk — the running services were never updated. Docker was left running the original config, so any changes (new ports, volumes, env vars) were silently dropped.

Root cause

In edit mode, the form's submit handler called updateStackSource which is a storage-only endpoint. It writes files but doesn't touch Swarm.

Fix

Wire the save button in edit mode to deployStack instead. deployStack does the actual docker stack deploy AND persists the source, so the stack ends up in the right state without needing a separate redeploy step.

Fixes #2361

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.

Greptile Summary

This PR fixes a bug where editing a Swarm stack and saving only persisted the compose source to disk but never redeployed the running services. The one-line fix replaces the updateStackSource (storage-only PUT) call with deployStack (which runs docker stack deploy and persists the source) inside handleSaveStackSource.

Confidence Score: 5/5

Safe to merge — minimal, targeted fix that correctly wires the save action to the deploy endpoint.

Single-line change with a clear root cause and well-understood fix. No new logic is introduced; the edit-mode save path now mirrors what docker stack deploy does (idempotent create-or-update). Error messages and redirect paths in the success callback remain appropriate for edit mode.

No files require special attention.

Reviews (1): Last reviewed commit: "fix: redeploy swarm stack when saving ed..." | Re-trigger Greptile

clicking save on a swarm stack in edit mode was only persisting the
source files on disk — the running services were never updated with the
new config. wire the save button to deployStack so changes actually land
in swarm instead of silently getting ignored.

fixes getarcaneapp#2361
@GiulioSavini GiulioSavini requested a review from a team April 13, 2026 07:35
@kmendell
Copy link
Copy Markdown
Member

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐞 Bug: Editing Swarm stack doesn't redeploy service

2 participants