Skip to content

ci: gate the docs site build on pull requests - #4895

Merged
lidge-jun merged 1 commit into
devfrom
codex/ci-docs-site-build-gate
Sep 17, 2026
Merged

lidge-jun merged 1 commit into
devfrom
codex/ci-docs-site-build-gate

Conversation

@lidge-jun

Copy link
Copy Markdown
Owner

Summary

The Astro toolchain had no pull-request build gate. .github/workflows/ci.yml contained no docs-site reference and built no docs, and deploy-docs.yml triggers only on push to main, which is after promotion. So the first machine that could discover a broken docs site was the deploy, and a dependency bump under docs-site/ could only be backed by an author's local run.

That is not hypothetical. It is why the review of #4873, which moves astro from 7.2.2 to 7.3.3, could not close: a fully green run on that head would still have said nothing about whether the site builds.

This adds a docs filter to the existing changes job and one job selected by it.

docs-site/** is deliberately not added to the ci filter. Widening ci would start the whole cross-platform matrix for a prose edit, which is cost without matching evidence: a docs change has to build, not to pass the runtime suite. A separate filter output keeps the two questions apart.

.github/workflows/ci.yml is in the docs filter so an edit to the job verifies itself. Without that entry this pull request would skip the job it adds, which is the exact failure mode being removed.

One Linux leg. The site is static output from a Node/Bun toolchain with no OS-specific behaviour to promise, so a Windows or macOS leg would spend queue time without buying coverage. --frozen-lockfile carries as much of the value as the build does: it fails on a manifest and lockfile that disagree, which is the shape a hand-edited override introduces.

The aggregate ci gate is event-aware, and it fails by name on any job with no declared expectation, so the job is declared in the four places that have to agree: needs, CHANGES_DOCS, GATED_JOBS, and expected_for. Requested when the filter is true, required skipped otherwise, exactly like the other scoped jobs.

No existing job's sharding, timeout, or runner selection changes. No Windows leg is added. Workflow-level permissions stay contents: read and the new job adds none. Actions stay pinned to immutable SHAs with their version comments.

Verification

This pull request is its own first evidence. Because the workflow file is in the docs filter, docs site build is requested on this head, so a green run here means the filter selects correctly, the job installs and builds docs-site, and the aggregate accepts it.

tests/ci-workflows/ci-workflows.test.ts independently derives the expected needs list from the workflow's own job keys and asserts every job carries a numeric timeout-minutes, so a job added without being gated fails rather than passing quietly. It also asserts the pinned action SHAs this job reuses.

Checked statically against the gate's own accounting: the workflow now declares 14 jobs, ci is the only ungated one, and needs, GATED_JOBS, and expected_for each cover the remaining 13.

Verified by reading the workflow and the call graph rather than by running the suite locally, so hosted CI at this head is the verification of record.

structure/ops/docs-and-release.md owns docs-site/ and is updated in the same change: the deploy workflow is now described as the deploy path rather than a review gate, with the new job named as the pull-request gate, and the workflow map row updated.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

This changes a GitHub Actions workflow, which MAINTAINERS.md and .github/AGENTS.md both place under explicit security review. The relevant surface: no trigger is broadened (pull_request already started this workflow for every PR), no permission is added, no secret is read, and no third-party action is introduced.

The Astro toolchain had no pull-request build gate. ci.yml contained no
docs-site reference and built no docs, and deploy-docs.yml triggers only on
push to main, which is after promotion. The first machine that could discover a
broken docs build was the deploy, so a dependency bump under docs-site/ could
only be backed by an author's local run.

Adds a docs filter to the existing changes job and one job selected by it.

docs-site/** is deliberately not added to the ci filter: a prose edit has no
business starting the cross-platform matrix, it only has to build. A separate
filter output keeps those two questions apart. The workflow file itself is in
the docs filter so an edit to the job verifies itself, without which this
change's own pull request would skip the job it adds.

One Linux leg. The site is static output from a Node/Bun toolchain with no
OS-specific behaviour to promise, so another platform would spend queue time
without buying coverage. --frozen-lockfile carries as much of the value as the
build does, because it fails on a manifest and lockfile that disagree, which is
the shape a hand-edited override introduces.

The aggregate ci gate is event-aware, so the job is declared in the four places
that have to agree: needs, CHANGES_DOCS, GATED_JOBS, and expected_for. No
existing job's sharding, timeout, or runner selection changes, no Windows leg is
added, and permissions stay contents: read.
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 17, 2026 09:13
@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 33 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: a5edfed4-de6f-465e-bd12-5bea0c36adc7

📥 Commits

Reviewing files that changed from the base of the PR and between a1fe84b and ff350f9.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml
  • devlog/_plan/260917_l1_preview_read_fence_and_dep_audit/030_unit_c_docs_site_build_gate.md
  • structure/ops/docs-and-release.md

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 17, 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-09-17T09:16:37.089642Z ff350f9 PR opened
ℹ️ 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.

@lidge-jun

Copy link
Copy Markdown
Owner Author

리뷰 · 우선순위 77 / 80

이 PR은 지금 dev(HEAD a1fe84b31, 패키지 2.58.0, 팁은 #4880 L4 Responses private-field 계획)에 문서 사이트(Astro)를 풀리퀘스트에서 한 번도 빌드하지 않는 구멍을 메웁니다.

지금 dev를 기준으로 보면 .github/workflows/ci.yml에는 docs-site 이야기가 없고, deploy-docs.ymlmain에 올라간 뒤에야 돕니다. 그래서 docs-site/ 아래 의존성이나 Astro 설정이 깨져도, 머지·프로모션 전에는 기계가 그걸 잡지 못합니다. 사람이 노트북에서 bun run build 한 번 돌린 결과만 증거가 됩니다. 이 저장소가 다른 영역에서는 받아들이지 않는 형태입니다.

그 구멍은 이미 #4873(Astro 7.2→7.3 등 deps 감사) 리뷰에서 드러났습니다. 그 헤드가 아무리 초록이어도 문서 사이트가 실제로 빌드되는지는 아무 것도 말하지 않습니다. 이 Unit C(#4895)는 그 리뷰를 정직하게 닫을 수 있게 하려는 선행 작업입니다. 계획 문서도 devlog/_plan/260917_l1_preview_read_fence_and_dep_audit/030_unit_c_docs_site_build_gate.md로 같이 열었습니다.

하는 일은 단순합니다. changes 잡에 docs 필터를 하나 더 두고(docs-site/** + 워크플로 자기 자신), 그 필터가 켜질 때만 Linux 한 다리 docs-site-builddocs-site에서 bun install --frozen-lockfilebun run build를 돌립니다. docs-site/**를 기존 ci 필터에 넣지 않은 점이 핵심입니다. 문장만 고친 PR이 크로스플랫폼 테스트 행렬을 깨우는 낭비는 피하고, 빌드되는지만 따로 묻습니다.

집계 게이트(ci 잡)도 맞춰 두었습니다. #4837 이후 이 게이트는 이벤트별로 무엇을 요청했는지 읽고, 요청된 잡은 success, 나머지는 skipped를 요구하며, 선언이 빠진 잡은 이름으로 실패합니다. 그래서 새 잡이 needs / CHANGES_DOCS / GATED_JOBS / expected_for 네 곳에 같이 들어갔습니다. tests/ci-workflows/ci-workflows.test.ts가 잡 키에서 needs 목록을 다시 계산하므로, 게이트에 안 넣으면 조용히 통과하지 않습니다. 권한은 워크플로 기본 contents: read만 쓰고 잡에 추가 권한·시크릿·새 서드파티 액션이 없습니다. 체크아웃 SHA 핀과 ./.github/actions/setup-project-bun 재사용도 기존 CI 패턴과 같습니다.

structure/ops/docs-and-release.md도 같이 고쳐서, deploy-docs.yml배포 경로이고 PR 게이트는 ci.ymldocs-site-build라고 적어 두었습니다. Preview 배포를 계획에 넣는 변경은 아닙니다.

라인 - 문제

.github/workflows/ci.yml docs 필터에 .github/workflows/ci.yml 포함 - 의도된 자기검증이지만, 앞으로 CI만 손본 PR마다 Astro 빌드 한 다리가 항상 따라옵니다. 비용은 작아도 영구 세금입니다.
docs-site-build vs deploy-docs.yml - PR 게이트는 setup-project-bun(루트 package.json Bun, 현재 1.4.0) + bun run build이고, 배포는 withastro/action + bun@latest입니다. 초록 PR 뒤에 프로모션에서만 깨질 여지가 남습니다.
devlog/.../030_unit_c_docs_site_build_gate.md - 같은 폴더에 000/010/020 없이 Unit C만 새 디렉터리로 생깁니다. L1 계획의 나머지 단위가 어디에 있는지 읽는 사람이 헷갈릴 수 있습니다.
tests/ci-workflows/ci-workflows.test.ts - needs 파생 검사는 새 잡을 잡지만, docs 필터 출력·docs-site-build 잡 자체의 전용 characterisation(타임아웃/명령/if)은 docker-smoke 수준으로 아직 없습니다. 회귀 시 늦게 드러날 수 있습니다.

메인테이너의 판단이 필요한 지점

  • ci.ymldocs 필터에 영원히 둘지, 아니면 이번 PR 통과 후 필터에서 빼고 별도 워크플로/수동 검증으로 옮길지.
  • 배포(withastro/action)와 PR 게이트(bun run build) 툴체인을 맞출지, 아니면 지금처럼 게이트만 frozen-lockfile로 더 엄하게 둘지.
  • 이 유닛을 #4873보다 먼저 머지한 뒤, fix(deps): bump hono, astro, and docs-site overrides to resolve audit CVEs #4873 헤드에 docs-site-build가 보이도록 재실행만 할지 / 리베이스가 필요한지(계획 문서 Sequencing 그대로).
  • 고아 Unit C 계획 폴더를 이 PR에 둘지, L1 기준 문서(000)를 같은 변경에 붙일지.

너의 추천

KEEP. types/config 분할에 무효화되지 않고, 중복도 아니며, 권한·시크릿 확장이 없습니다. 이 헤드에서 docs-site-build가 실제로 요청·성공하고 집계 ci가 통과한 exact-head 초록을 확인한 뒤 머지하세요. 머지 후 #4873은 새 잡이 헤드에 잡히도록 재실행(또는 필요 시 tip-rebase)이 다음 손입니다. Preview deploy는 계획 밖이니 이 PR 범위에 넣지 마세요.

이 댓글은 grok-bot이 작성했습니다

@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: ff350f93eb

ℹ️ 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 .github/workflows/ci.yml
Comment on lines +977 to +978
- name: Setup project Bun
uses: ./.github/actions/setup-project-bun

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Match the deployment toolchain in the docs gate

The PR gate installs the root-pinned Bun version (1.4.0 in this commit), but .github/workflows/deploy-docs.yml still builds with Node 22 and package-manager: bun@latest. Once bun@latest differs—or if the Node-backed Astro action behaves differently—a docs change can pass this gate and then fail during the post-promotion Pages build, defeating the gate's stated purpose. Pin the deploy workflow to the same toolchain or exercise the deployment action/configuration here.

Useful? React with 👍 / 👎.

@github-actions github-actions Bot added the chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). label Sep 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@lidge-jun
lidge-jun merged commit e05ae26 into dev Sep 17, 2026
26 checks passed
@lidge-jun
lidge-jun deleted the codex/ci-docs-site-build-gate branch September 17, 2026 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant