Skip to content

docs(docs-audit): record why CHANGELOG.md is NOT added to the drift exclusion - #4136

Merged
os-zhuang merged 2 commits into
mainfrom
claude/console-screen-flow-submit-jfpjy4
Jul 30, 2026
Merged

docs(docs-audit): record why CHANGELOG.md is NOT added to the drift exclusion#4136
os-zhuang merged 2 commits into
mainfrom
claude/console-screen-flow-submit-jfpjy4

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

纯文档,无代码改动。把一个「看起来显然该做、实测是空操作」的后续记下来,省掉下一位读者的一个 PR。

背景

#4091 让 drift 映射器在推导变更包根之前丢掉测试文件 —— 测试观察行为、不定义行为,改不出实现文档的陈旧。按同一条理由,packages/*/CHANGELOG.md 是下一个显然的候选:发布日志定义行为的程度还不如测试。

我本来准备把它做掉。先量了一下,结论是不该做 —— 两条彼此独立的理由:

1. 唯一会批量动这些文件的 PR 类型,压根不跑 Actions

chore: version packageschangesets/action 用仓库自带的 GITHUB_TOKEN 开出,而 GitHub 不会为 GITHUB_TOKEN 产生的事件创建 workflow run。实测 #3910一个 check run,来自 Vercel 自己的 App,零个 Actions。

这不是路径过滤的问题 —— ci.ymlpull_request: branches: [main]、无路径过滤,那个 150 文件的 PR 它无条件匹配,仍然一次没跑。所以 drift 这道闸门根本没机会在 release PR 上吵。

2. 就算跑了,包根集合也一模一样

changeset version 在每个追加了 CHANGELOG.md 的包旁边同时写 package.json#3910 diff 第一页:45 个 package.json 对 46 个 CHANGELOG.md)。package.json 不在排除范围内,所以丢掉 CHANGELOG 之后推导出的包根集合逐位相同。

另外,在 release 之外手改 CHANGELOG 的提交实际上近乎不存在。

顺带澄清一件容易误读的事

「version PR 上没有任何 check」看着像个洞,其实不是:ci.ymllint.yml 都挂在 push: main 上,release.yml 也把 publish 卡在一个绿色的 pnpm run build 之后。版本 bump 是被验证的,只是验证发生在合入之后而不是之前 —— 而 bump 只改版本号和内部依赖区间,坏区间会直接让 install/build 挂掉。所以我没有为此开 issue:那正是我这个会话里已经拦下三次的假报形状。

验证

  • node scripts/docs-audit/affected-docs.mjs --self-test → 14 cases pass
  • 本分支对 origin/main0 docs affected by 0 changed package(s),即 fix(tooling): docs-drift stops flagging docs for tests-only changes #4091 为「守卫自身被守卫」预期的那条良性结论
  • 本 PR 只碰 scripts/docs-audit/**,所以 drift 工作流会在它自己身上跑一遍,并贴出 0 changed package(s) ✅

🤖 Generated with Claude Code

https://claude.ai/code/session_01QoA8AV99Ss1RRkLLAYmDzq


Generated by Claude Code

…xclusion

#4091 dropped test files before deriving the changed-package roots, because a
test cannot make an implementation-accuracy doc stale. `packages/*/CHANGELOG.md`
is the obvious next candidate by the same argument — release notes define
behaviour no more than a test does — and extending the exclusion there is a
provable no-op. Measured before writing anything down:

- `chore: version packages` is the only PR class that mass-touches those files,
  and it runs no GitHub Actions at all. `changesets/action` opens it with the
  repo's GITHUB_TOKEN, and GitHub does not create workflow runs from
  GITHUB_TOKEN-authored events. #3910 carries exactly one check run, from
  Vercel's own app — `ci.yml` matches that PR unconditionally and still never
  fired. So the drift gate never sees a release PR to be noisy on.
- Even if it did, `changeset version` writes `package.json` beside every
  `CHANGELOG.md` it appends to (45 against 46 on page 1 of #3910's diff), so
  dropping the CHANGELOGs would leave the derived package-root set identical.

The bump is not unverified, just verified later: `ci.yml` and `lint.yml` both run
on `push: main`, and `release.yml` gates publish on a green build — worth stating
so the absent PR checks are not read as a hole.

Recorded in the README beside the exclusion it neighbours, so the next reader
does not spend a PR rediscovering it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QoA8AV99Ss1RRkLLAYmDzq
@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectstack Ignored Ignored Jul 30, 2026 11:07am

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation tooling size/s labels Jul 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

No hand-written docs reference the 0 changed package(s). ✅

Copy link
Copy Markdown
Contributor Author

ESLint 这条红与本 PR 无关,也不需要本 PR 处理 —— 是 main 上的存量红,且修复已在飞

是什么

失败的不是 ESLint 本身,是同一个 job 里的 pnpm check:wildcard-fallthrough

✗ wildcard fall-through guard (#4116)
  packages/adapters/hono/src/index.ts:all `${prefix}/storage/*`
    DECLARED but not found by the scan. Moved, renamed or deleted? Update MOUNTS.

本 PR 的 diff 只有两个 markdown 文件。在本地对我的 HEAD(= origin/main + 一个文档 commit)跑,同样复现。

成因:两个 PR 隔 3 分半交叉合入

时间 commit 做了什么
18:41:10 4be9d99#4087 / #4112 删除 app.all(prefix + '/storage/*')
18:44:45 3df8819#4116 / #4122 新增守卫,其 MOUNTS 仍把 ${prefix}/storage/* 记为 #4117 的 ratchet

后者的账本是对着前者落地之前的树写的。守卫本身工作正常 —— 它抓到的正是一条失效声明,这就是「声明了但扫不到」那条臂存在的理由。

不由我修

#4133 已经在做,作者正是 #4122 的作者,诊断一致(其 PR body 里已把这条竞态归到自己名下),而且范围更完整:删条目 + close #4117 + 修检查器的一个假阴性。我重复修会和代码所有者在飞的更好方案撞车,所以只报不动手。

本 PR 除此之外全绿(Check Changeset / Check PR Size / Auto Label / docs-drift / Dogfood Gate 均 success)。#4133 落地后我会把 main 并进来让 CI 重跑。

顺带一条现场验证:Flag docs affected by code changes 这次跑了,并贴出 0 changed package(s) ✅。本 PR 只碰 scripts/docs-audit/**,这正是 #4091 给该工作流补触发路径时预期的良性结论 —— 守卫在改自己时也被守卫,端到端跑通了。


Generated by Claude Code

@os-zhuang
os-zhuang marked this pull request as ready for review July 30, 2026 11:10
@os-zhuang
os-zhuang merged commit 851a001 into main Jul 30, 2026
16 checks passed
@os-zhuang
os-zhuang deleted the claude/console-screen-flow-submit-jfpjy4 branch July 30, 2026 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/s tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants