Skip to content

[PR] feat(ci): label-driven backport carry PRs onto patch lanes (bugfix-v<latest tag>) - #4503

Merged
ranxianglei merged 3 commits into
masterfrom
2026-10-24_backport-carry
Oct 24, 2026
Merged

ranxianglei merged 3 commits into
masterfrom
2026-10-24_backport-carry

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

(ai: zai/glm-5.3)

Fixes #4500

这是啥问题?

补丁火车只认已合并进 master 的 PR(临时急修想先上车必须等 master);cherry-pick 冲突时机器人只贴一条手动命令评论就放弃——没有分支承载冲突内容,没人看评论 = 修复静默丢失;车名每版一换、靠分支名排序推导。

owner 定案的模型:在 OPEN 的 fix PR 上打 backport 标签的瞬间,机器人开一个 carry PR——该 PR 自己的 commit cherry-pick 到当前补丁车道 bugfix-v<最新 tag>(不存在则当场从 tag 切),回执贴回源 PR。源 PR 合并与否独立(临时急修可永不上 master)。发布后版本号前进 → 下次打标自动切新车道,零存储状态。

改动(8 files)

文件 内容
.github/workflows/backport.yml 重写为 carry-bot:pull_request[labeled](backport) + workflow_dispatch 修复路;目标车道纯 refs 推导(bugfix-v<git tag 最新 v*>,缺则从 tag 切并 push);pick range = merge-base(origin/master, head)..head --no-merges(synced-master 内容永不泄漏);逐 commit cherry-pick -x,冲突→abort+记录+继续,结果全量写进 carry PR 正文表格(逐条重放命令)+源 PR 回执(HTML marker pin,重复打标 no-op、源动了再打标自动重建强推)
.github/workflows/lane-leak-guard.yml(新) push 到 bugfix-v*:扫 ..HEAD 的 merge commits,M^2 是 origin/master 祖先 → ::error(防 master merge 进车道;合法 carry 合并不误报)
.github/workflows/release-manual.yml train 步改车道推导(缺车从 tag 切;空车拒发→提示 untick 走普通发布);reconcile 步新增第 3 类审计:open 着的 carry PR(可能还挂冲突)大声列进 ship PR ⚠️ 段
.github/workflows/ci.yml push/pull_request branches += bugfix-v*(carry PR 走 core 矩阵);version-guard allowlist += bugfix-v*(lane ship PR 合法携带 bump)
.github/workflows/release-bugfix.yml case 接受 bugfix-v* 头(legacy bugfix-release/* 保留兜底);closeout 措辞改为「tag 即闭环、下周期新 tag 自动切新车道」
reference/release.md Dual-lane 节整节重写为 carry 模型(含为何不用 merge-range 语义:squash/rebase 形态会静默出半截 fix)
AGENTS.md §5 Batch form 指针句更新

测试证据

  • 5 个 workflow YAML yaml.safe_load 通过;全部 run 块(69 个)bash -n 通过;
  • 本地假仓仿真双向验证:①range 正确排除 synced-master 内容(NO LEAK)②干净 pick 落盘且 trailer 可见(审计依赖它)③冲突记录不丢后续 pick ④泄漏守卫:真泄漏(merge master 进车道)ALARM、合法 carry 合并 PASS;
  • 仿真期间抓到并修复两个真 bug:a) 守卫原基线 --not --tags 在特定调用形态下把待扫 commit 全滤掉(git 行为坑)→ 改 <base tag>..HEAD 窗口;b) 源 PR json 落工作区会被 checkout clean 掉 → $RUNNER_TEMP。

边界与自审

合并后迁移(我在 issue 跟踪,API 执行)

  1. 从 tag v0.1.206 切 bugfix-v0.1.206(v0.1.206 已含旧火车全部待发修复——patch-equivalent 已逐一核实,零重放);
  2. 删 bugfix-release/v0.1.206-train;
  3. (可选)ruleset 禁对 bugfix-v* 强推/删除。

human-only merge(CI 编排类,§7.4 不适用 auto-merge)。

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-24_backport-carry (8956fb1)

Latest build — install this exact version

npm install -g billion-context@0.0.5426-pr.4503.b17db65

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
8956fb1 billion-context@0.0.5426-pr.4503.b17db65 build
4435714 billion-context@0.0.5417-pr.4503.ec8a207 build

Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

(ai: zai/glm-5.3)

红道来源说明(与本草稿无关):本 PR 只改 .github/workflows/* + 文档,未触碰任何 TS。失败的 5 条 test 车道在 master 自己的 CI(run 40073163544,head 02f544d,07:11;及更早 05:53)上以逐字节相同签名失败:not ok 1275 - #3250: a configured cap flows open() → journal_size_limit(WAL 断言 left 1095952 / cap 1048576)。master 最后一次绿是 f161c51(今晨 04:17),红始于其后合入的存储层改动(嫌疑窗口:#4316 seq-ledger a6d7b3c/05dc6831、#4390 row-identity-historian f013414 + 两个 fix)。另见 windows 上偶发的 media CAS 失败。已按仓库纪律单独立 issue 跟踪(见下条评论);master 修好后本 PR 的 CI 重跑即为最终判定——其余 30 项检查(含 version-guard/gate 全家桶)全部通过。

@ranxianglei

Copy link
Copy Markdown
Owner Author

(ai: zai/glm-5.3)

上游回归已立案:#4506(CI 全红:#3250 WAL cap 断言,嫌疑窗口 f161c51..02f544d 的存储层改动)。master 转绿后本 PR 重跑即为最终判定。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

状态复核(~09:05Z),与上条结论无变化:

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

这条(红道来源说明)即上轮已复核的 Floor 2,刚再次核实结论不变:master head 仍 02f544da、core CI 仍红(run 40073163544),本 PR 仅 5 条 test 分片同签名红。无新信息,等 #4506 修复、master 转绿后 rebase + 重跑即为最终判定。

ci-check added 2 commits October 24, 2026 17:28
- The workflow_dispatch repair path was dead: github.event.pull_request.*
  is EMPTY under dispatch, so the fork gate misfired (false FORK comment)
  and the lane-base guard was bypassed. All PR facts are now read live
  from the API in the gate step; the dead event-context env vars are gone.
- Label-after-merge was a silent no-op for merge-commit merges: the head
  is reachable from master, so merge-base..head is empty. Fall back to the
  merge shape itself (M^1..M^2 --no-merges, the pre-lane bot's proven
  range) when the PR is merged and its merge commit has two parents.
- Fetch falls back to refs/pull/N/head when the exact-sha fetch fails
  (closed PR / deleted branch), with a FETCH_HEAD == API-sha equality check.
- Refuse to guess a range when no common ancestor exists (empty merge-base
  would otherwise carry the ENTIRE history).
- pick.txt moves to $RUNNER_TEMP, same discipline as pr.json.
The open-PR audit lists EVERY open PR targeting the lane (carries AND
manual fix PRs), but rendered them as 'carry PR ... left open'. Wording
now says what the mechanism actually flags.
@ranxianglei
ranxianglei merged commit 41481b6 into master Oct 24, 2026
42 of 47 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.795-master.41481b6 (rolling master tag).

npm install -g billion-context@0.0.795-master.41481b6  # this exact build
npm install -g billion-context@master  # always the newest merged build

npm view billion-context@master prints the current version at any time.

@github-actions

Copy link
Copy Markdown
Contributor

(ai: zai/glm-5.3) backport carry: every pick conflicted — nothing clean to push yet.

Conflicting picks (resolve manually on a fresh branch off bugfix-v0.1.206):

git checkout -b <fix-branch> origin/bugfix-v0.1.206
git cherry-pick -x 4435714e 653a0c48 8956fb1c   # resolve the <<<<<<< markers, then continue
git push origin HEAD:<fix-branch>   # open a PR against bugfix-v0.1.206, label it backport-carry

@github-actions github-actions Bot mentioned this pull request Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport merge onto the patch train (bugfix-release/**) via the backport bot — set BEFORE merging

Projects

None yet

1 participant