PR readiness: base ref and labels come from the bind snapshot instead of the live PR
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- github-actions, typescript
调研方向
从 scripts/pr-readiness.mjs 开始,阅读加载 PR 并选择基准引用和标签的 run()。然后找到现有的 run() 测试,并添加一个模拟 fetchFn 的用例,覆盖快照基准 dev 与实时基准 main 的对比,以及实时的 skip-changelog 标签。完成标准是比较使用 main,且该标签会影响 changeset 检查;运行相关测试。
由索引模型根据 Issue 内容生成。
描述
Found by: github-integration-dev while fixing a Copilot review finding on #2423 (the #2420 fix). This is outside that PR's scope, so it's tracked here.
Problem
scripts/pr-readiness.mjs run() takes the PR's base ref and labels from environment variables. The bind job sets them from the event snapshot:
PR_BASE_REF(line ~471) is used for the "Branch up to date" comparison (compare/<base>...<head>), the checklist text and the links in the comment footer.PR_LABELS(line ~476) feeds "Changeset present", which honours theskip-changeloglabel.
run() already reads the live PR (GET /pulls/{n}), and that response contains base.ref and labels. Neither is used.
Once #2423 lands, runs for the same PR head share one concurrency group with cancel-in-progress: true. A late delivery from before a base change (an edited event) can therefore cancel the newer run for that head and post a checklist against the old base. A label change has the same effect when it is followed by a refresh for the same head. Stale-head deliveries are not affected: #2423 makes them write nothing.
Suggested fix
In run():
- Prefer
prData.base.refandprData.labels[].namefrom the live PR read. Fall back to the environment values only when that read fails, the same way draft status already prefers API truth (prData?.draft ?? prDraft). - Add a regression test with a mocked
fetchFn: a snapshot base ofdevand a live base ofmainmust compare againstmain, and a liveskip-changeloglabel must count when the snapshot lacks it.
Notes
- The request workflow does not trigger on
labeled/unlabeled, so a label change alone doesn't refresh the checklist. This issue is only about using live values when a refresh does run. - Low impact: the checklist is advisory, and the next PR event corrects it.
- 主要语言
- TypeScript
- 星标
- 3.4k
- 派生
- 516
- 平均合并
- 1 天 15 小时
- 30 天内合并 PR
- 116
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github/squad 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
In-app coordinator/Ralph never reads .squad/ralph-instructions.md; only `squad watch --execute` does未关闭wave:2-soon
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
相似的 Issue
-
bot:ai-assisted component:platform-js status:untriaged
难度 1/5 1 小时以内 新手友好度 74/100
midnightntwrk/platform-js#38 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
ranxianglei/billion-context#7068 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
mybigday/whisper.rn#348 ·
-
enhancement severity:low
难度 2/5 1-3 小时 新手友好度 82/100
Battle-Cattle/BCUK-Bot-4#1075 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
ilan-pinto/roaring-lions#1552 ·
维护者通常 1 天内回复