Don't write the build stamp on CI builds - #3981
Merged
Merged
Conversation
The stamp existed only to speed up local dev rebuilds, but writing it unconditionally meant it landed in the assembled output directory and was deployed to staging. The docs-internal-workflows then found the unexpected file and failed. Gate the write behind `effectiveAssumeBuild`, which is already `false` on CI, so the stamp is produced only for local runs where the skip optimisation is actually used. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Docs preview (local build)Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/3981/ |
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.
The assembler wrote
.assembler-build-stamp.jsoninto the output directory unconditionally after every successful build, including CI builds. The file was then deployed to staging, wheredocs-internal-workflowsfound it and failed.Affects: Assembler builds, Deploys & previews
Why
The build stamp was introduced in #3964 purely to speed up local dev rebuilds — when inputs haven't changed, the next local run can skip the build. That optimisation has no value on CI, where
effectiveAssumeBuildis alreadyfalseand the stamp check is skipped entirely. Writing the file on CI serves no purpose, but it lands in the assembled output and reaches the deploy step, which does not expect it.What
Stamp write gated on
effectiveAssumeBuildThe write in
AssemblerBuildServicepreviously ran whenever the build succeeded and was not an Elasticsearch-only export. Adding&& effectiveAssumeBuildto that condition makes the stamp a purely local artefact. On CI,effectiveAssumeBuildresolves tofalse(unless--assume-buildis passed, which is already rejected on CI with an exception), so the stamp is never written and never appears in deployed output.The read path is unaffected — it already handles a missing file gracefully by returning
nulland triggering a full rebuild.