[fix] stack redeploy rebuilds an edited build context - #106
Closed
malickyeu wants to merge 1 commit into
Closed
Conversation
StackRedeploy ran a plain `docker compose up -d`, so a CLI-discovered stack declaring build: kept running the image from its first deploy no matter what changed in its Dockerfile or context on the host — the same staleness bug fixed for Projects in #99, on the other code path. Found while auditing the docs against the merged code: the two deploy paths are separate, and only one had been corrected. The test builds the stack with the real compose CLI so the labels StackRedeploy works from are genuine, then edits the context and redeploys through the app. Verified by mutation: without --build it fails with marker "v1".
10 tasks
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.
Summary
StackRedeployran a plaindocker compose up -d, so a CLI-discovered stack thatdeclares
build:kept running the image from its first deploy however much itsDockerfile or build context changed on the host — while the CLI reported
Container Runningand exited 0.This is the same staleness bug fixed for Projects in #99, on the other code
path. A project deploys through the API handler; a CLI stack deploys through
StackRedeploy. Fixing one didn't fix the other, and nothing pointed that out —it surfaced while auditing the docs against the merged code, because the doc I was
about to write said
up -dand I checked why.Redeploy now passes
--build, which is a no-op for services that only pull animage.
Type of change
Checklist
go test -short ./...andgo vet ./...passgofmtgate is clean (gofmt -l $(git ls-files '*.go')after staging)cd web && npx tsc --noEmit)web/distdocs/and added aCHANGELOG.mdentryNotes for reviewers
The test creates the stack with the real
docker composeCLI, not withhand-written labels. That matters here: labels are the only thing
StackRedeployhas to work from — project name,config_files,working_dir—so a fixture that writes them by hand would be testing my idea of what compose
stamps rather than what it actually stamps. It then edits the context on disk and
redeploys through the app.
Mutation-verified, per the discipline recorded in #104: dropping
--buildfails the test with
marker is "v1", expected "v2". It fails for the rightreason — the image genuinely wasn't rebuilt — rather than on an unrelated error.
Also updated the UI's confirm dialog, which promised
docker compose up -d.It now says
up -d --buildand mentions thatbuild:services are rebuilt, sothe dialog still describes what the button does.
Not given an opt-out, unlike the project deploy's
{"build": false}: thestack redeploy endpoint takes no body, and inventing one for a case that costs
nothing on image-only stacks seemed worse than the consistency. Easy to add if a
large-context stack over a slow link ever makes it worth it.
Test data: the stack (
dctest-stackredeploy) and its built image are removedin
t.Cleanup, and the whole project label is swept withfreeStackbefore andafter — the pattern added in #100 after a failed guard left containers behind.
Verified zero
dctest*leftovers across the run.