Skip to content

Stamp image tags from STABLE_ status keys - #244

Merged
EdSchouten merged 1 commit into
buildbarn:mainfrom
matx-sjacob:sjacob/stable-stamp-keys
Aug 8, 2026
Merged

Stamp image tags from STABLE_ status keys#244
EdSchouten merged 1 commit into
buildbarn:mainfrom
matx-sjacob:sjacob/stable-stamp-keys

Conversation

@matx-sjacob

@matx-sjacob matx-sjacob commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Related buildbarn/bb-storage#358

BUILD_SCM_REVISION and BUILD_SCM_TIMESTAMP have no STABLE_ prefix, so Bazel files them in volatile-status.txt and reports an unchanging digest for that file whatever it contains. The expand_template in bb-storage that turns them into the image tag is therefore never invalidated, and _stamped.tags.txt is generated once and reused indefinitely — on a build machine whose cache persists, every later build pushes its image to the tag produced by the first build on that machine.

The bb-storage bump is part of the fix, not incidental. That template is what expands these keys, and the pin here (3991d6e) predates 33530b6, which switched it to the prefixed names. Renaming the keys alone would leave the pinned template still reading the volatile ones, so nothing would change.

@EdSchouten

Copy link
Copy Markdown
Member

I think you also ought to bump the dependency on bb-storage to make this work.

@matx-sjacob
matx-sjacob force-pushed the sjacob/stable-stamp-keys branch 2 times, most recently from b5b7896 to 31ac83b Compare August 6, 2026 13:52
@matx-sjacob

Copy link
Copy Markdown
Contributor Author

I think you also ought to bump the dependency on bb-storage to make this work.

Cool, that's a better solution, I've made it part of this PR. PTAL when you can @EdSchouten

@EdSchouten

Copy link
Copy Markdown
Member

Please also bump the hash of bb-storage in go.mod. I know the Bazel build won't use it, but it's necessary to make plain "go build" work.

BUILD_SCM_REVISION and BUILD_SCM_TIMESTAMP have no STABLE_ prefix, so Bazel
files them in volatile-status.txt and reports an unchanging digest for that
file whatever it contains. The expand_template in bb-storage that turns them
into the image tag is therefore never invalidated, and _stamped.tags.txt is
generated once and reused indefinitely.

Ephemeral CI never sees this, since each job starts with an empty cache. On a
build machine whose cache persists, every later build pushes its image to the
tag produced by the first build on that machine, silently overwriting what was
published there before.

Bump bb-storage to 33530b6 so the template consuming these keys expects the
prefixed names. Renaming the keys without the bump would have no effect, since
the pinned template still reads the volatile ones. Move go.mod to the matching
commit as well, so a plain "go build" resolves the same version the Bazel
build does.
@matx-sjacob
matx-sjacob force-pushed the sjacob/stable-stamp-keys branch from 31ac83b to 1454493 Compare August 6, 2026 21:44
@matx-sjacob

Copy link
Copy Markdown
Contributor Author

Done. PTAL @EdSchouten - Thanks!

@EdSchouten

Copy link
Copy Markdown
Member

Interesting. Why doesn't GitHub try to run CI jobs for this PR? Will merge this change once I've confirmed this doesn't cause any regressions.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants