Skip to content

ci(fork): 所有改動都走同一個 PR 流程,CI 依改動的檔案決定要不要跑全套 - #80

Merged
audichuang merged 3 commits into
developfrom
fork-ci/docs-scope
Oct 26, 2026
Merged

audichuang merged 3 commits into
developfrom
fork-ci/docs-scope

Conversation

@audichuang

Copy link
Copy Markdown
Owner

為什麼

文件改動以前可以直推 develop,省掉 15~25 分鐘的 CI,但沒有 PR 紀錄,還要多一條「rebase 進行中不能直推」的例外。現在所有改動都開 PR,跑多少由 CI 依改動的檔案判斷,agent 不做任何選擇。

改了什麼

  • fork-pr.yml 新增 scope job:用上游的方法取 PR 改動的檔案清單,交給 config/scripts/fork-pr-scope.mjs 判斷。全部是文件(上游的 isDocsOnlyPath,加上 FORK.md;.claude/skills/ 永遠不算)→ docs,否則 full。空清單或分類失敗都跑全套。
  • 六個重的 job 只在 full 時跑。
  • verify(「Fork PR checks passed」)只有在 scope 成功而且判定 docs 時才接受被跳過的 job,其他情況維持每個 job 都要成功。fork-pr-gate-needs.mjs 固定的腳本與檢查訊息一起更新。
  • config/fork-upstream-api.txt 登記 isDocsOnlyPath,上游拿掉這個 export 時 lint 會紅。
  • FORK.md:拿掉文件直推 develop 的例外,寫明 CI 怎麼判斷。

驗證

  • 新舊關卡測試 53 個全過,新增:docs 範圍時重的 job 被跳過 → 過;docs 範圍但有 job 失敗、scope 失敗或被跳過、scope 輸出不是 docs、full 範圍有跳過 → 都擋下
  • Mutation:拿掉「scope 必須成功」或拿掉「只有 docs 才接受跳過」,都有測試變紅
  • 用真實改動驗分類:PR fix(fork): auto-rebase 發版途中不再失聯、過時的鎖會自動收,每次結果都寫進筆記 #77(skill、腳本、測試)→ full;兩次 FORK.md 修正 → docs;空清單 → full
  • make fork-check-lint、check:code-quality:changed v1.4.240 通過
  • 這個 PR 本身改了 workflow,會跑全套

🤖 Generated with Claude Code

audichuang and others added 3 commits October 26, 2026 10:54
…obs on docs

Docs went straight to develop so they would not wait 15-25 min for CI, which left no PR
record and needed a rebase-lock exception. Now every change opens a PR. fork-pr.yml's new
scope job classifies the changed paths with upstream's isDocsOnlyPath (plus FORK.md, never
.claude/skills); the heavy jobs run only on `full`, and verify accepts skipped jobs only
when scope succeeded and said `docs`. An empty path list or a failed scope runs everything.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… inputs

Gate review of #80: a docs-only PR skipped `pnpm lint`'s README link check, so a broken
link would turn every later PR red, and docs/site's package.json (read by the test-runner
check) counted as docs. The scope job now runs the link check itself, fork-pr-scope keeps
CI, build, agent and docs/site paths full even if upstream's docs list grows, and FORK.md
says a failed scope job blocks the PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oves

/code-review of #80: scope tests keep only paths the fork's full-scope guard rejects
(docs/site) plus the skills rule; the skip rule lives in the scope script and the gate
checker only; the heavy jobs drop a draft check scope already applies; the
isDocsOnlyPath pin says why it imports; FORK.md's local-check line follows the scope job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@audichuang
audichuang merged commit 484c9ed into develop Oct 26, 2026
15 checks passed
@audichuang
audichuang deleted the fork-ci/docs-scope branch October 26, 2026 03:16
audichuang added a commit that referenced this pull request Oct 26, 2026
audichuang added a commit that referenced this pull request Oct 26, 2026
… inputs

Gate review of #80: a docs-only PR skipped `pnpm lint`'s README link check, so a broken
link would turn every later PR red, and docs/site's package.json (read by the test-runner
check) counted as docs. The scope job now runs the link check itself, fork-pr-scope keeps
CI, build, agent and docs/site paths full even if upstream's docs list grows, and FORK.md
says a failed scope job blocks the PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Oct 26, 2026
…oves

/code-review of #80: scope tests keep only paths the fork's full-scope guard rejects
(docs/site) plus the skills rule; the skip rule lives in the scope script and the gate
checker only; the heavy jobs drop a draft check scope already applies; the
isDocsOnlyPath pin says why it imports; FORK.md's local-check line follows the scope job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Oct 27, 2026
… inputs

Gate review of #80: a docs-only PR skipped `pnpm lint`'s README link check, so a broken
link would turn every later PR red, and docs/site's package.json (read by the test-runner
check) counted as docs. The scope job now runs the link check itself, fork-pr-scope keeps
CI, build, agent and docs/site paths full even if upstream's docs list grows, and FORK.md
says a failed scope job blocks the PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Oct 27, 2026
…oves

/code-review of #80: scope tests keep only paths the fork's full-scope guard rejects
(docs/site) plus the skills rule; the skip rule lives in the scope script and the gate
checker only; the heavy jobs drop a draft check scope already applies; the
isDocsOnlyPath pin says why it imports; FORK.md's local-check line follows the scope job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Oct 28, 2026
… inputs

Gate review of #80: a docs-only PR skipped `pnpm lint`'s README link check, so a broken
link would turn every later PR red, and docs/site's package.json (read by the test-runner
check) counted as docs. The scope job now runs the link check itself, fork-pr-scope keeps
CI, build, agent and docs/site paths full even if upstream's docs list grows, and FORK.md
says a failed scope job blocks the PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Oct 28, 2026
…oves

/code-review of #80: scope tests keep only paths the fork's full-scope guard rejects
(docs/site) plus the skills rule; the skip rule lives in the scope script and the gate
checker only; the heavy jobs drop a draft check scope already applies; the
isDocsOnlyPath pin says why it imports; FORK.md's local-check line follows the scope job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Oct 29, 2026
… inputs

Gate review of #80: a docs-only PR skipped `pnpm lint`'s README link check, so a broken
link would turn every later PR red, and docs/site's package.json (read by the test-runner
check) counted as docs. The scope job now runs the link check itself, fork-pr-scope keeps
CI, build, agent and docs/site paths full even if upstream's docs list grows, and FORK.md
says a failed scope job blocks the PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Oct 29, 2026
…oves

/code-review of #80: scope tests keep only paths the fork's full-scope guard rejects
(docs/site) plus the skills rule; the skip rule lives in the scope script and the gate
checker only; the heavy jobs drop a draft check scope already applies; the
isDocsOnlyPath pin says why it imports; FORK.md's local-check line follows the scope job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Oct 30, 2026
… inputs

Gate review of #80: a docs-only PR skipped `pnpm lint`'s README link check, so a broken
link would turn every later PR red, and docs/site's package.json (read by the test-runner
check) counted as docs. The scope job now runs the link check itself, fork-pr-scope keeps
CI, build, agent and docs/site paths full even if upstream's docs list grows, and FORK.md
says a failed scope job blocks the PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Oct 30, 2026
…oves

/code-review of #80: scope tests keep only paths the fork's full-scope guard rejects
(docs/site) plus the skills rule; the skip rule lives in the scope script and the gate
checker only; the heavy jobs drop a draft check scope already applies; the
isDocsOnlyPath pin says why it imports; FORK.md's local-check line follows the scope job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Nov 2, 2026
… inputs

Gate review of #80: a docs-only PR skipped `pnpm lint`'s README link check, so a broken
link would turn every later PR red, and docs/site's package.json (read by the test-runner
check) counted as docs. The scope job now runs the link check itself, fork-pr-scope keeps
CI, build, agent and docs/site paths full even if upstream's docs list grows, and FORK.md
says a failed scope job blocks the PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Nov 2, 2026
…oves

/code-review of #80: scope tests keep only paths the fork's full-scope guard rejects
(docs/site) plus the skills rule; the skip rule lives in the scope script and the gate
checker only; the heavy jobs drop a draft check scope already applies; the
isDocsOnlyPath pin says why it imports; FORK.md's local-check line follows the scope job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Nov 3, 2026
… inputs

Gate review of #80: a docs-only PR skipped `pnpm lint`'s README link check, so a broken
link would turn every later PR red, and docs/site's package.json (read by the test-runner
check) counted as docs. The scope job now runs the link check itself, fork-pr-scope keeps
CI, build, agent and docs/site paths full even if upstream's docs list grows, and FORK.md
says a failed scope job blocks the PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Nov 3, 2026
…oves

/code-review of #80: scope tests keep only paths the fork's full-scope guard rejects
(docs/site) plus the skills rule; the skip rule lives in the scope script and the gate
checker only; the heavy jobs drop a draft check scope already applies; the
isDocsOnlyPath pin says why it imports; FORK.md's local-check line follows the scope job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Nov 4, 2026
… inputs

Gate review of #80: a docs-only PR skipped `pnpm lint`'s README link check, so a broken
link would turn every later PR red, and docs/site's package.json (read by the test-runner
check) counted as docs. The scope job now runs the link check itself, fork-pr-scope keeps
CI, build, agent and docs/site paths full even if upstream's docs list grows, and FORK.md
says a failed scope job blocks the PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Nov 4, 2026
…oves

/code-review of #80: scope tests keep only paths the fork's full-scope guard rejects
(docs/site) plus the skills rule; the skip rule lives in the scope script and the gate
checker only; the heavy jobs drop a draft check scope already applies; the
isDocsOnlyPath pin says why it imports; FORK.md's local-check line follows the scope job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Nov 5, 2026
… inputs

Gate review of #80: a docs-only PR skipped `pnpm lint`'s README link check, so a broken
link would turn every later PR red, and docs/site's package.json (read by the test-runner
check) counted as docs. The scope job now runs the link check itself, fork-pr-scope keeps
CI, build, agent and docs/site paths full even if upstream's docs list grows, and FORK.md
says a failed scope job blocks the PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Nov 5, 2026
…oves

/code-review of #80: scope tests keep only paths the fork's full-scope guard rejects
(docs/site) plus the skills rule; the skip rule lives in the scope script and the gate
checker only; the heavy jobs drop a draft check scope already applies; the
isDocsOnlyPath pin says why it imports; FORK.md's local-check line follows the scope job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Nov 5, 2026
… inputs

Gate review of #80: a docs-only PR skipped `pnpm lint`'s README link check, so a broken
link would turn every later PR red, and docs/site's package.json (read by the test-runner
check) counted as docs. The scope job now runs the link check itself, fork-pr-scope keeps
CI, build, agent and docs/site paths full even if upstream's docs list grows, and FORK.md
says a failed scope job blocks the PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Nov 5, 2026
…oves

/code-review of #80: scope tests keep only paths the fork's full-scope guard rejects
(docs/site) plus the skills rule; the skip rule lives in the scope script and the gate
checker only; the heavy jobs drop a draft check scope already applies; the
isDocsOnlyPath pin says why it imports; FORK.md's local-check line follows the scope job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Nov 6, 2026
… inputs

Gate review of #80: a docs-only PR skipped `pnpm lint`'s README link check, so a broken
link would turn every later PR red, and docs/site's package.json (read by the test-runner
check) counted as docs. The scope job now runs the link check itself, fork-pr-scope keeps
CI, build, agent and docs/site paths full even if upstream's docs list grows, and FORK.md
says a failed scope job blocks the PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Nov 6, 2026
…oves

/code-review of #80: scope tests keep only paths the fork's full-scope guard rejects
(docs/site) plus the skills rule; the skip rule lives in the scope script and the gate
checker only; the heavy jobs drop a draft check scope already applies; the
isDocsOnlyPath pin says why it imports; FORK.md's local-check line follows the scope job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Nov 7, 2026
… inputs

Gate review of #80: a docs-only PR skipped `pnpm lint`'s README link check, so a broken
link would turn every later PR red, and docs/site's package.json (read by the test-runner
check) counted as docs. The scope job now runs the link check itself, fork-pr-scope keeps
CI, build, agent and docs/site paths full even if upstream's docs list grows, and FORK.md
says a failed scope job blocks the PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Nov 7, 2026
…oves

/code-review of #80: scope tests keep only paths the fork's full-scope guard rejects
(docs/site) plus the skills rule; the skip rule lives in the scope script and the gate
checker only; the heavy jobs drop a draft check scope already applies; the
isDocsOnlyPath pin says why it imports; FORK.md's local-check line follows the scope job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Nov 8, 2026
… inputs

Gate review of #80: a docs-only PR skipped `pnpm lint`'s README link check, so a broken
link would turn every later PR red, and docs/site's package.json (read by the test-runner
check) counted as docs. The scope job now runs the link check itself, fork-pr-scope keeps
CI, build, agent and docs/site paths full even if upstream's docs list grows, and FORK.md
says a failed scope job blocks the PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Nov 8, 2026
…oves

/code-review of #80: scope tests keep only paths the fork's full-scope guard rejects
(docs/site) plus the skills rule; the skip rule lives in the scope script and the gate
checker only; the heavy jobs drop a draft check scope already applies; the
isDocsOnlyPath pin says why it imports; FORK.md's local-check line follows the scope job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Nov 8, 2026
… inputs

Gate review of #80: a docs-only PR skipped `pnpm lint`'s README link check, so a broken
link would turn every later PR red, and docs/site's package.json (read by the test-runner
check) counted as docs. The scope job now runs the link check itself, fork-pr-scope keeps
CI, build, agent and docs/site paths full even if upstream's docs list grows, and FORK.md
says a failed scope job blocks the PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Nov 8, 2026
…oves

/code-review of #80: scope tests keep only paths the fork's full-scope guard rejects
(docs/site) plus the skills rule; the skip rule lives in the scope script and the gate
checker only; the heavy jobs drop a draft check scope already applies; the
isDocsOnlyPath pin says why it imports; FORK.md's local-check line follows the scope job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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