fix(update): compare the running image version, not just the git tag - #442
Merged
Conversation
`brainiac update`'s "already up to date" check compared only the tag at HEAD (`git describe --exact-match`) to the newest tag. A from-source build — or any checkout left sitting on the latest tag while running an older/different image — was wrongly reported up to date and the prebuilt image pull was skipped (observed after tagging a release on the checked- out commit while running a local build). Also compare the app's reported version (`/brainiac version`) and only short-circuit when both the checkout AND the running image are on the latest tag; otherwise proceed to pull. POSIX sh; `sh -n` clean. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
./brainiac update's "already up to date" check compared only the tag at HEAD (git describe --tags --exact-match) to the newest tag:This assumes git tag at HEAD == running image, which breaks for a from-source build (or any checkout left sitting on the latest tag while the running image is older/different). Observed live: after tagging a release on the checked-out commit while the stack ran a local from-source build,
updatesaid "already up to date (v1.118.0)" and skipped the image pull — leaving the running container on the local build, not the released image.Fix
Also compare the running app's reported version, and only short-circuit when both the checkout and the running image are on the latest tag:
If the container is down or reports a different version, it proceeds to pull — the correct behaviour.
v-prefix normalized on both sides.Verification
sh -n brainiacclean (POSIX).0.0.0-dockerfrom-source build, latest tagv1.118.0): the new check evaluates"0.0.0-docker" != "1.118.0"→ mismatch → would pull (old behaviour: false "up to date").Docs: SYSTEM.md decision-log entry.
🤖 Generated with Claude Code