You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 525faab
Browse filesBrowse the repository at this point in the historyBrowse files
fix(deploy): take the version from the image being deployed, not from git HEAD
Observed in production: `teploy deploy --image .../fylun-web:462d7a7` printed
"Deployed fylun-web version fe82bf0", named the containers
`fylun-web-web-fe82bf0`, and wrote fe82bf0 into `teploy log` — while running the
image tagged 462d7a7. fe82bf0 was simply the local git HEAD at that moment.
During a rollback that is worse than cosmetic. `teploy log` is where an operator
picks a target, and every version in it named a commit that had no relationship
to the image that ran.
Cause, in deployAppConfig: gitShortHash() was called FIRST and unconditionally,
with the image consulted only in its *error* branch. So inside any git repo the
version was always HEAD and the image tag was never read. And because step 3
resolves `image = appCfg.Image` beforehand, a teploy.yml pinning a prebuilt
image hit the same path with no flag passed — this was never about --image.
versionFromImage derives the label from the reference. A digest wins over an
accompanying tag, because Docker resolves the digest and ignores the tag, so
labelling `repo:1.2.3@sha256:...` as 1.2.3 would be the same class of lie. The
tag is read only when the last colon falls after the last slash, or a registry
port (100.108.123.49:49152/tyler/app) parses as a tag.
Output is gated on Docker's tag grammar, not merely parsed. Versions are
interpolated UNQUOTED into remote shell commands through ContainerName, and
until now a version could only originate from git output or an operator's own
--version; an image reference is a less-trusted source and is treated as one.
":latest" and untagged references are refused, falling back to the existing
timestamp. Reusing a floating tag as the version gives every deploy the same
container name and leaves CurrentHash == PreviousHash, which disables rollback
outright. A timestamp is at least unique. This is a behaviour change for
build-with-pinned-yml-image deploys, documented in the CHANGELOG.
plan.go carried a comment promising it resolved the version "exactly as deploy
does" and no longer did; left alone it would predict container names the deploy
never creates. Now shares the same rule.
LogEntry gains `image`, so the log can be checked against what ran instead of
being taken on faith. AppState already carried ImageRef and ImageDigest; the
log was the gap.
Checked the four places a version string travels: container naming (needs the
grammar gate above), Caddy routing (name-only, unaffected), rollback target
resolution (matches the teploy.version label — opaque strings are fine, but a
NON-UNIQUE version would break it, which is why :latest is refused), and
keep_versions pruning (groups by the same label, unaffected).
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CfMxUBzUH4UP3reJ71j59K
0 commit comments