fix(deps): split BD_VERSION into version + source ref (ga-kgluj) - #111
Merged
Conversation
deps.env conflated two different things: BD_VERSION held a commit SHA, which
is not a version. Every consumer then had to treat a version field as a ref,
and upstream's new agent-image test — which asserts BD_VERSION is v1.1.0 —
could not pass.
Splits them, mirroring two models already in the tree: the ARG set in
contrib/k8s/Dockerfile.agent (BD_VERSION + BD_SOURCE_REF + BD_SOURCE_SHA256)
and the BD_CURRENT_VERSION/BD_CURRENT_REF pair in scripts/bd_version_pin_test.go.
deps.env BD_VERSION=v1.1.0 (what the pinned source declares)
BD_SOURCE_REF=e97839a2e1c0… (schema migration 0054)
BD_SOURCE_SHA256=e40acdcb… (verified against the real tarball)
Dockerfile repointed at the same commit go.mod pins
install-bd-archive.sh honours BD_SOURCE_REF; 40-hex BD_VERSION still works
workflows 12 pins split across 7 files
Why the bridge stays: measured, no published bd release carries 0054 —
v1.1.2 tops out at 0053, and upstream's own image ref (8e4e59d39) is 0053
too and is not an ancestor of our pin. A 0053 bd against gc's 0054 linked
library is the raw-bd/linked-lib skew that broke store consistency in #87.
Divergence is now three test constants (bdSourceRef/bdSourceSHA256/bdBuild)
that move and revert together, instead of a version field holding a commit.
BD_VERSION itself is no longer diverged, so upstream's assertion passes
unmodified — the earlier "accept either form" widening is reverted.
TestBDVersionPins keeps the lockstep invariant, now checked against the ref
rather than the version. Cache key in install-bd-archive.sh includes the
source ref so a cached v1.1.0 RELEASE build can never be served for a
source-pinned build of the same version.
CI/nightly execution-shape hashes re-derived: adding a job-level env key
changes the shape those pins guard, so the tripwire firing was correct.
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.
Closes the last known merge-induced red from the v1.4.0 resync (#109), and reduces fork divergence rather than adding to it.
The actual defect
deps.envconflated two different things:BD_VERSIONheld a commit SHA, which is not a version. Every consumer then had to treat a version field as a ref, and upstream's new agent-image test — which assertsBD_VERSIONisv1.1.0— could not pass.I originally reported this as "the Dockerfile builds from a release URL and structurally cannot consume a commit". That was wrong. The image already builds from source (
curlofbeads/archive/${BD_SOURCE_REF}.tar.gz);BD_VERSIONis only the version string it asserts againstcmd/bd/version.goand stamps into the binary.The fix
Splits them, mirroring two models already in this tree: the ARG set in
contrib/k8s/Dockerfile.agent(BD_VERSION+BD_SOURCE_REF+BD_SOURCE_SHA256), and theBD_CURRENT_VERSION/BD_CURRENT_REFpair inscripts/bd_version_pin_test.go.deps.envBD_VERSION=v1.1.0(what the pinned source declares) +BD_SOURCE_REF+BD_SOURCE_SHA256(verified against the real tarball)Dockerfile.agentgo.modpinsinstall-bd-archive.shBD_SOURCE_REF; a 40-hexBD_VERSIONstill works (backwards compatible)Why the bridge stays
Measured, not assumed: no published bd release carries schema migration 0054. v1.1.2 tops out at 0053, and upstream's own image ref (
8e4e59d39) is 0053 too and is not an ancestor of our pin. A 0053 bd against gc's 0054 linked library is precisely the raw-bd/linked-lib skew that broke store consistency in #87.Divergence, before and after
bdSourceRef/bdSourceSHA256/bdBuild) that move and revert together.BD_VERSIONis no longer diverged, so upstream's assertion passes unmodified — the earlier widening is reverted.Safety details
TestBDVersionPinskeeps its lockstep invariant, now checked against the ref rather than the version.install-bd-archive.shcache key includes the source ref, so a cached release build of v1.1.0 can never be served for a source-pinned build of the same version.Verified:
go build ./...andgo vet ./...clean;./scriptsand./scripts/cipolicygreen.