Skip to content

ci: isolate documentation publishing - #1290

Merged
ofek merged 1 commit into
mainfrom
refactor-preview-docs-publishing
Oct 20, 2026
Merged

ofek merged 1 commit into
mainfrom
refactor-preview-docs-publishing

Conversation

@ofek

@ofek ofek commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Intent

Fork documentation builds can finish successfully after maintainer approval while the current pull_request_target publisher has already failed on action_required. Move publishing authority to msgspec/docs-deploy so successful build completion starts publication and source maintainers cannot redirect Cloudflare credentials to another project.

Changes

Build documentation for PRs and main pushes, then use a trusted workflow_run bridge to dispatch the isolated publisher with only the build run ID and attempt. The publisher independently validates source metadata, artifact provenance and digest, and the fixed destination. A native Docs preview PR job waits for the matching bridge result, fails visibly on build or publication failure, and exposes the preview through an empty environment.

Full build reruns replace the docs artifact, while link-only retries can reuse that run's artifact. Add orchestration regressions to build preparation and document the preview and retry behavior for contributors.

Validation

python -m unittest discover -s tests -p test_docs_deploy.py
Ran 14 tests in 0.014s
OK
uvx --from ruff==0.17.0 ruff check scripts/docs_deploy.py tests/test_docs_deploy.py
All checks passed!
uvx --from ruff==0.17.0 ruff format --check scripts/docs_deploy.py tests/test_docs_deploy.py
2 files already formatted
actionlint .github/workflows/docs-deploy.yml .github/workflows/docs-pr.yml .github/workflows/docs.yml .github/workflows/prepare-build.yml
Exit 0; no diagnostics.
zizmor --offline .github
No findings to report. Good job! (2 ignored, 23 suppressed)
uvx codespell scripts/docs_deploy.py tests/test_docs_deploy.py .github/CONTRIBUTING.md
Exit 0; no diagnostics.

The publisher's CI run passed all 41 tests. A live read-only validation of fork PR #1214 resolved run 39306143416, downloaded artifact 12212809134, verified its SHA-256 digest, and validated all 115 static files.

Notes

This is the activation change. The GitHub App is installed with Actions write, Contents read, Pull requests read, and Metadata read permissions. A live fork preview canary passed in publisher run 39384183375, and invalid-attempt run 39384251513 failed before either publishing job started. A production canary must pass before retiring the old source Cloudflare credentials and removing the merge queue and obsolete capability restrictions. The required Docs preview status will be enabled during that final cutover, with strict branch-update enforcement disabled. Before the bridge reaches main, this draft's new preview job will wait for activation.

@ofek
ofek marked this pull request as ready for review October 20, 2026 07:12
@ofek
ofek requested a review from a team October 20, 2026 07:12
@ofek
ofek merged commit 99fcff7 into main Oct 20, 2026
25 of 26 checks passed
@ofek
ofek deleted the refactor-preview-docs-publishing branch October 20, 2026 07:12
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T07:15:05.938536Z 19e6aaf Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 19e6aafbc2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/docs_deploy.py
builder = source.api(f"actions/runs/{run_id}")
if (
builder["workflow_id"] != workflow["id"]
or builder["path"] != f".github/workflows/{BUILDER}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Normalize ref-qualified workflow paths

With the selected 2026-03-10 API version, workflow-run responses qualify path with the workflow ref (for example, .github/workflows/build.yml@main in the official response example), so a legitimate docs run will fail this equality check and every production/preview publisher request will stop before dispatch. The publisher outcome check at line 256 has the same problem; strip and validate the @ref suffix, or use an identity field whose documented format is unqualified.

Useful? React with 👍 / 👎.

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