Repository navigation
fix: keep docs publishing during steady updates - #146
Merged
Merged
Conversation
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.
Related: #143 — successive discarded R2 builds delayed publication of the merged Markdown-alias repair until a quiet window.
Additional instructions
MUST: Keep Allow edits from maintainers enabled for this PR so maintainers can help update the branch when needed.
What Problem This Solves
Fixes an issue where readers continue seeing old documentation or missing pages during steady source updates even though R2 Pages reports successful workflow runs. The full build takes roughly six minutes, source syncs arrive at a similar cadence, and several consecutive completed builds skipped publication.
Why This Change Was Made
Use one head/successor owner at two boundaries: admit a snapshot under the serialized
r2-pagesqueue before source checkout, installation and build; then check for missing successors after successful publication. Obsolete queued builds yield immediately, but an admitted coherent snapshot finishes even when main advances during its build. Post-publication catch-up schedules missed updates without revoking admission or vetoing the completed upload.The existing artifact-relevance classification, successor lookup, scoped content identity and smoke-range/request-id context remain. Stale scoped dispatches fail early so callers retry. The former inline shell policy and internal stdin-classifier CLI are removed rather than retained as parallel paths. No permissions, concurrency, credentials, workflow inputs, dependencies, storage, Worker routing or uploader algorithm change.
User Impact
Documentation publication can make forward progress while updates continue arriving. Changes made during a build through
GITHUB_TOKEN, skip-ci pushes or truncated push filters still get a successor when no run exists. Operators verify actual upload and Worker deployment steps; a green skipped run is not deployment proof.Evidence
9ec5f58a7f8e28fafd7dd94d224d4646fb99bc09: failure because admission follows source preparation.node --test scripts/docs-site/head-drift.test.mjs: 31/31 passed, including scope/worker-only/none gates, real Git refresh, scoped source identity, successor existence, API lookup failure, dispatch failure, smoke-range forwarding and Git failure.npm test: 87/87 passed.actionlint .github/workflows/r2-pages.yml,node --check scripts/docs-site/head-drift.mjsandgit diff --checkpassed.07ea4a3733e81219cc8cd22506d26c30d85be7ed. The docs-code job covers script syntax, all helpers, Worker bundle, shell artifact, routing smoke and visual smoke. Live production proof passed after merge: an obsolete queued run completed admission in one second and skipped the expensive build immediately. An admitted full publication checked main at 02:59:05 UTC, built afterward, successfully uploaded at 03:04:05–03:04:12, and completed post-publication catch-up at 03:04:16. Both phases ran in their intended order without a late upload veto.Commands:
npm testProduction/tooling: +93/-80 (net +13) after moving the existing decision/dispatch behavior into one shared owner. The remaining growth carries the necessary second catch-up boundary and explicit publication outcomes; duplicate shell policy and obsolete CLI behavior are deleted. Tests: +275/-11 (net +264). Hosting guidance: +5/-1 (net +4). No generated docs were hand-edited.
The automatic R2 safety boundary is one admitted snapshot per serialized workflow, not an assumption about FIFO ordering. GitHub's concurrency contract allows one active workflow in the group. Publishing every stale queued snapshot permits regression; refreshing during a build mixes snapshots; retaining a late veto preserves starvation; dropping post-publication catch-up loses successorless updates. Manual Pages router deployment remains operator-owned outside automatic R2 ordering. Existing successor lookup remains existence-based, and a docs-only successor still does not inherit a skipped Worker deployment.