Repository navigation
ci(release-notes): PR-time payload guard — hold the 400-char cap BEFORE merge - #2820
ranxianglei wants to merge 4 commits into
Conversation
…RE merge The Publish Release Notes validator only runs after merge (push to master + paths filter), so it can never hold a PR; over-cap entries failed one step too late — runs 38040163381 (0.1.191: 401 chars) and 38152721758 (0.1.192: 520 chars), fixed in #2818. - scripts/release-notes-guard.mjs: zero-dep validator (same rules, same verbatim error messages), callable from both workflows - ci.yml release-notes-guard job (config-surface-guard posture: plain node, no install step) — the actual PR-time interceptor - release-notes.yml now calls the script; the inline copy is gone - tests/release-notes-guard.test.ts: unit teeth — planted violations (over-cap, inclusive-400, bilingual shape, bad tier, dup, bad semver, bad date, >20 entries, schema) must turn the guard red, not vacuous
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.3128-pr.2820.63e1198This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2820.tgz
npm install -g packageInstall instructions are refreshed on each push. |
…nused-exports gate)
[bot] 🏷 Review 进行中(中间报告) 方向已核实:400-char cap 此前只在 merge 后的 Publish Release Notes workflow 强制(run 38040163381 / 38152721758 两次实锤),PR-time 拦截是真实缺口。本地已定向验证:脚本对当前 payload 输出 CI 在 head 三处都是 PR 引入文件内的小修,按「小问题直接修」正在 PR 分支上补 commit(独立标注),push 后等 CI 转绿再给八问结论。 |
…tion main() ran on module load, so importing validateReleaseNotesPayload in tests printed the ok-line (and would process.exit(1) at import time if the payload were invalid, killing the test child before any test ran). Gate main() behind a direct-invocation check; CLI behavior unchanged.
The comment claimed '400 exactly' but 196+3+200 = 399. Bump to 197 so the test actually exercises the inclusive boundary in the bilingual 丨 shape.
[bot] 🏷 Review 完成 — 结论:可合并(head ① 是什么问题:release-notes payload 的 400-char cap(及整份契约)只在 Publish Release Notes workflow 强制,而该 workflow 由 push-to-master + paths filter 触发,结构上拦不住 PR——超限条目只能 merge 后在发布步骤失败(run 38040163381 / 38152721758 两次实锤)。 ② 什么原因导致的:不是代码 bug,是守卫放置位置缺失——ci.yml(PR-time)侧没有对应校验,唯一一份校验器内联在 post-merge workflow 里。因果分层:根因=契约执行点晚于拦截点;表象=merge 后发布步骤红、需要追加修复 commit(#2818)。 ③ 影响范围与严重程度:所有改 ④ 怎么修复的:把内联校验器抽成零依赖脚本 ⑤ 是否回归问题:逐条比对了旧内联校验器 vs 新脚本的全部规则,有效 payload 的接受/拒绝行为不变。有意的诊断性变更(披露旧→新):a) 报错从 fail-fast 第一条 → 收集全部错误仍 exit 1; b) semver 校验从 npm ⑥ 是否破坏缓存:不涉及(CI/workflow 文件,无缓存/重试/游标/去重键)。 ⑦ 是否改了设计方向:不涉及架构转向;只是把同一契约的执行点前移到 PR-time 并去重为单拷贝。 ⑧ 是否引入新配置:无——没有新 env/config/flag;CI job 名 本地定向验证: |
Why
The 400-char summary cap (and the rest of the payload contract) is only enforced by the Publish Release Notes workflow — which runs after merge (push to master +
release-notes/**paths filter). It can never hold a PR, so over-cap entries could only fail one step too late:0.1.191 : summary too long (401 chars, cap 400)0.1.192 : summary too long (520 chars, cap 400)— bilingual backfill from f24e3e8, fixed in fix(release-notes): trim 0.1.192/0.1.191 summaries under the 400-char cap #2818What
scripts/release-notes-guard.mjs.github/workflows/ci.ymlrelease-notes-guardjob (config-surface-guardposture: checkout + node, no install step) — the PR-time interceptor.github/workflows/release-notes.ymltests/release-notes-guard.test.tsscripts/release-notes-guard.d.mtsVerification
node scripts/release-notes-guard.mjs→14 entries ok; planted 520-char summary → exit 1 with the exact original messagenode --import tsx --test tests/release-notes-guard.test.ts→ 10/10 passnpm run typecheck→ clean; both workflow YAMLs parseRisk
Zero runtime surface touched — CI/workflow/doc files only.