Skip to content

fix: keep docs publishing during steady updates - #146

Merged
steipete merged 1 commit into
mainfrom
steipete/docs-publish-admission-f9a625
Aug 31, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/docs-publish-admission-f9a625

Conversation

@steipete

@steipete steipete commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

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-pages queue 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

  • Live pre-fix runs 33345324046, 33345925980 and 33346637948 completed successfully but skipped both Upload changed R2 objects and Deploy Worker before live smoke after main advanced during their builds. Live aliases still lacked Markdown-target metadata. A later quiet window finally allowed 33347542672 to upload; this PR removes the dependence on such a window.
  • Independent early-admission regression against 9ec5f58a7f8e28fafd7dd94d224d4646fb99bc09: failure because admission follows source preparation.
  • The first draft exposed a connected regression: a successorless docs push during an admitted build would be missed. The boundary test failed after admitting A, advancing a real temporary Git remote to B and recording publication of the A fixture. The final owner schedules B afterward without modifying admission. Git operations are real; only the GitHub CLI boundary is faked, with its requests checked.
  • Final 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.
  • Scoped publication caller tests: 11 mocked R2-dispatch tests plus 1 canary/batch gating test passed. These are not live deployment claims.
  • actionlint .github/workflows/r2-pages.yml, node --check scripts/docs-site/head-drift.mjs and git diff --check passed.
  • Fresh isolated Codex review of the complete final four-file patch: scoped-clean at the configured P0 blocking threshold. Exact-head Docs Code CI and CodeQL passed on 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:

node --test scripts/docs-site/head-drift.test.mjs
npm test
python3 -B .github/scripts/i18n/tests/test_i18n_scripts.py -k dispatch_r2_pages
python3 -B .github/scripts/i18n/tests/test_i18n_scripts.py I18NScriptTests.test_full_workflow_gates_batches_after_canary
actionlint .github/workflows/r2-pages.yml

Production/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.

@steipete steipete self-assigned this Aug 31, 2026
@steipete
steipete marked this pull request as ready for review August 31, 2026 01:52
@steipete
steipete requested a review from a team as a code owner August 31, 2026 01:52
@steipete
steipete merged commit 88260a0 into main Aug 31, 2026
6 checks passed
@vincentkoc
vincentkoc deleted the steipete/docs-publish-admission-f9a625 branch September 25, 2026 11:13
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.

1 participant