Skip to content

[PR] feat(ci): patch cycles with dual-PR forwarding — replaces the patch train - #4478

Closed
ranxianglei wants to merge 3 commits into
masterfrom
2026-10-24_fixed-bugfix-dual-pr
Closed

ranxianglei wants to merge 3 commits into
masterfrom
2026-10-24_fixed-bugfix-dual-pr

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Fixes #4477

这是啥问题?

补丁火车(backport 标签+机器人 cherry-pick,#4468 上线)有发车盲区(#4474)、车名每版一换要跟变量、机器人事故面大(#4471 403)。owner 决策链(m02229→m03016):每个修复 PR 一次性开两个(修复 PR + master twin,后者机器人自动开);分支形态从「固定 bugfix」演进为每次发版自动生成新分支——patch/v<最新已发布 tag>,名即基底。

本 PR 内含两次形态迭代:第 1 commit(fixed bugfix 分支)已被第 2 commit(per-cycle)整体取代,最终以 head 树为准;两 commit 连续无冲突。

模型(最终形态)

master ──features──► ... v0.1.205(tag)
                        │ 切 patch/v0.1.205(closeout 自动切)
修复PR(base=patch/v0.1.205,CI core矩阵)─┐
   fix-dual-pr 自动开 twin PR(base=master)│
你合并两边                                │
一键发车勾 bugfix → ship PR(head=patch/v0.1.205)→ 发布 v0.1.206
   closeout 立即从 v0.1.206 切出 patch/v0.1.206 —— 下一周期就绪
master 中途正常发版 → 下次一键发车自动 recut-replay(新 tag 切新分支,git cherry 重放旧车上未到 master 的修复,冲突=fail loud)

改动(head 树 vs master)

文件 改动
.github/workflows/fix-dual-pr.yml(新,~260 行) base=patch/v* 的 PR opened/synchronize/reopened → cherry-pick 其 commit 到 master 头 → 推 twin/<fix-branch> → 开/更新 twin PR + dispatch CI(#772)+ 回评链接;closed 未合→关 twin 删分支;目标分支早于最新 tag→PR 评论过时警告(recut-replay 会救);>20 commit=master 基底拒绝
.github/workflows/patch-leak-guard.yml(新,~50 行) push 到 patch/v*:merge commit 第二亲本是 origin/master 祖先 → ::error(防 master→cycle 泄漏未发内容);twin 合并带回的是 re-pick 不同 SHA,不误报
.github/workflows/backport.yml 删(270 行,补丁火车机器人)
.github/workflows/ci.yml push/pull_request filters += patch/v*;plan job:twin/* 早退→core(ci:full 标签优先可加宽);version-guard:base=patch/v* 时 diff 基准改该 cycle,allowlist += patch/v*(ship PR 头)
.github/workflows/release-manual.yml input train→bugfix(名字保留,语义=发当前周期):Resolve 步=找 live cycle,不存在/mid-cycle 超越则自动 recut-replay;bump→push 到 cycle→ship PR(base=master)→dispatch 全量;audit 步用 git cherry -v 把「车上未上 master 的修复」渲染进 ship PR ⚠️ 段(不硬失败)
.github/workflows/release-bugfix.yml 接受 head=patch/v*(车道 ship PR)+ legacy bugfix-release/*(单发急修兜底);closeout 新增:发布后立即从新 tag 切下一周期分支,owner 永远有现成靶子
reference/release.md 「Dual-lane releases」整节重写为 per-cycle(卫生规则:禁 merge master 进 cycle/泄漏守卫/应急 force-push 重切命令);carve-out 节标注主路径已换

| scripts/live-files.mjs | 补登记 #4449 漏登的两个 process-spawning 测试(见上段) |
| AGENTS.md §4/§5 | release 分支清单 + carve-out 指针句更新 |

第三 commit(小问题直接修):rebase 到含 v0.1.206 的 master 后,CI 全部 test lane 被 #1248 tripwire 拦下——#4449(codex 桌面插件)落地时把两个 process-spawning 测试(tests/codex-mcp-shell.test.ts、tests/codex-plugin-version-sync.test.ts)漏登记进 LIVE_FILES。已按 gate 要求先审并发假设:mcp-shell 只 spawn 一个 stub entry 子进程、无任何 listener;version-sync 全 execFileSync(同步)。两者都不占真实端口,追加到表尾(slot=index)即安全;本地用同一 SPAWN_RE 复算 tripwire 通过(剩余未登记=空)。

与固定分支版的差异(为什么演进)

每次 patch 发布都必然换基底——per-cycle 把这个移动做成机制保证(closeout 自动切新分支)而不是手动仪式(固定分支靠 drift guard 红灯提醒 owner 手动重切),且分支名自带基底版本(patch/v0.1.205 不用查 npm 就知道基础);mid-cycle 的 master 发版由 recut-replay 自动消化,不再依赖人工判断时机。

自审过的边界

测试

  • 5 个 workflow YAML yaml.safe_load 全过、全部 66 个 run 块 bash -n 过;
  • 纯 CI workflow + 文档,无 TS/源码改动,typecheck 面未变;
  • 合并后迁移(我来执行,API):从 v0.1.206 tag 直接切 patch/v0.1.206(已核实:旧火车的两个待发修复都已在 v0.1.206 里——以不同 SHA 的 patch-equivalent commit 合入 master 后随正常发版发布——零重放)、删 bugfix-release/v0.1.206-train、ruleset 保护 patch/*(禁强推/删)、required checks 镜像 master、删 BACKPORT_TRAIN 变量(若仍在)。

取代关系

human-only merge(CI 编排类,§7.4)。

@ranxianglei ranxianglei changed the title feat(ci): standing bugfix lane with dual-PR forwarding — replaces the patch train [PR] feat(ci): standing bugfix lane with dual-PR forwarding — replaces the patch train Oct 24, 2026
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-24_fixed-bugfix-dual-pr (a02cce2)

Latest build — install this exact version

npm install -g billion-context@0.0.5396-pr.4478.edff548

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Recent builds (commit → version)

commit version build
a02cce2 billion-context@0.0.5396-pr.4478.edff548 build
5305d8c billion-context@0.0.5393-pr.4478.34a01fc build
ffd11fa billion-context@0.0.5383-pr.4478.9db8e6b build
1f64dd9 billion-context@0.0.5380-pr.4478.06762b9 build
18bfd61 billion-context@0.0.5379-pr.4478.b6abe7b build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr4478.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei
ranxianglei force-pushed the 2026-10-24_fixed-bugfix-dual-pr branch from 18bfd61 to 1f64dd9 Compare October 24, 2026 03:50
@ranxianglei ranxianglei changed the title [PR] feat(ci): standing bugfix lane with dual-PR forwarding — replaces the patch train feat(ci): patch cycles with dual-PR forwarding — replaces the patch train Oct 24, 2026
@ranxianglei ranxianglei changed the title feat(ci): patch cycles with dual-PR forwarding — replaces the patch train [PR] feat(ci): patch cycles with dual-PR forwarding — replaces the patch train Oct 24, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

不是我要的 关闭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant