Skip to content

[PR] fix(release): let one-click publish a merged-but-unpublished fallback bump (stuck v0.1.210) - #5375

Merged
ranxianglei merged 1 commit into
masterfrom
fix/oneclick-pending-bump
Oct 31, 2026
Merged

ranxianglei merged 1 commit into
masterfrom
fix/oneclick-pending-bump

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Why

Tonight's v0.1.210 attempt got stuck in a state NO click can escape:

  1. first one-click run hit red CI (docs-sync) → its designed fallback opened PR [PR] release v0.1.210 #5373 (bump to 0.1.210);
  2. [PR] release v0.1.210 #5373 was merged → master's package.json = 0.1.210 while npm latest stayed 0.1.209;
  3. the Drift guard in release-manual.yml then rejects every dispatch:
##[error]master package.json (0.1.210) != npm latest (0.1.209). A release must be cut from the live release: sync the base before releasing.

…so the exact version master already carries can never be published, until someone manually rewinds the tree. (Observed live: runs 41218248354 stuck at the Full CI gate on the red sha, 41220076591 refused via retired train box, 41220460402 refused by this guard at 16:36Z.)

What changes (workflow-only, release-manual.yml +29/−2)

  • Drift guard tolerates the pending-bump state only under three simultaneous conditions: tree == nextPatch(npm latest) AND resolved target equals the tree version AND v<tree> tag does not exist upstream. Every other mismatch shape still fails loudly with the same message.
  • Bump version / Verify bump diff are skipped in that state — the merged fallback bump already staged package.json, lockfile, codex plugin manifests and changelog, so re-running would double-write.
  • Commit and push reports direct=true and pushes nothing: master is the publish content, so the full CI dispatch/gate at the exact sha, tagging and npm publish all behave exactly as in the normal direct-push path; the needs_pr fallback branches stay off.

Invariants kept

  • publish still happens only after all CI lanes green at the exact publish sha (Full CI gate unchanged);
  • no double-publish possible: target must equal the unpublished pending patch, tag existence checked upstream;
  • explicit version= input above the pending patch still refused (condition (b));
  • train mode, prerelease path, 0.0.x floor guard untouched.

Verify

YAML parses clean; state matrix walked for blank/explicit inputs × (in-sync / pending / other-drift / already-tagged). After merge: re-click one-click with no inputs → it will publish v0.1.210 straight from the green master head — no rewind, no phantom 0.1.211.

…mp (#5376)

The fallback-bump design (direct push blocked -> bump PR, merge it) leaves
master exactly one patch ahead of npm latest whenever the release run dies
before publishing (e.g. docs-sync red on the bumped sha). The Drift guard
then refuses EVERY dispatch forever with:

  'master package.json (0.1.210) != npm latest (0.1.209). A release must be
   cut from the live release: sync the base before releasing.'

so the staged version can never be published and every click re-invents the
next patch number instead of shipping what master already carries.

Fix (release-manual.yml only, workflow-logic):
- Drift guard gains an id and tolerates the pending-bump state ONLY when all
  three hold: tree version == nextPatch(npm latest), the resolved target IS
  that tree version, and no v<tree> tag exists upstream yet. All other drift
  shapes keep failing loudly.
- Bump version / Verify bump diff skip in that state (package.json,
  package-lock.json, codex plugin manifests and changelog are already staged
  by the merged bump commit — re-running them would double-write).
- Commit and push reports direct=true and pushes nothing: master already IS
  the publish content, so every direct-gated step (Full CI dispatch/gate at
  the exact sha, tag creation, npm publish) applies unchanged and the
  needs_pr fallback branches stay off.
@ranxianglei
ranxianglei merged commit aeffa1a into master Oct 31, 2026
21 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: fix/oneclick-pending-bump (db06abb)

Latest build — install this exact version

npm install -g billion-context@0.0.7590-pr.5375.7f2cfbd

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
db06abb billion-context@0.0.7590-pr.5375.7f2cfbd build

Download artifact

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

Install instructions are refreshed on each push.

@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.977-master.aeffa1a (rolling master tag).

npm install -g billion-context@0.0.977-master.aeffa1a  # 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.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重:不重复——本条即 PR #5375 的跟踪单,无其他同机制在途条目。
标签:pr / scope/ci / p2(发版管道阻塞类,无终端用户运行时影响,且当时存在手动回退绕行 → p2)。

核对结论:PR #5375(head db06abbeb)代码与状态均核实无误,已合入 master(merge aeffa1a12,2026-10-31T16:42Z),CI 绿。 证据:

  • 代码:diff 全量通读(+29/−2,仅 release-manual.yml)。drift guard 新增豁免三条件同时成立才放行:(a) tree == nextPatch(npm latest)、(b) 解析出的目标版本 == tree、(c) v<tree> tag 上游不存在;该状态下 Bump version / Verify bump diff 跳过(防双写),Commit and push 直接报 direct=true 不推任何东西,下游 Full CI dispatch/gate、打 tag、npm publish 全部走既有 direct 路径;needs_pr 回退分支保持关闭。
  • CI:PR 由人在分支保护下合入(要求检查项在 PR head 必为绿);合入后流水线已在同一 sha 发布滚动构建 0.0.977-master.aeffa1a(镜像评论可见)。
  • YAML:yaml.safe_load 解析通过,jobs 结构不变。
  • 实况:当前仍处 pending-bump 态——master package.json=0.1.210、npm latest=0.1.209、v0.1.210 tag 不存在——修复已在 master 生效,下一次空输入 one-click 即可直接发 v0.1.210。

行为变更披露(旧→新):Drift guard 从「拒绝一切 mismatch」变为「拒绝一切 mismatch,除 pending-bump 三条件同时成立」;其余所有形态的错误消息一字未改。

结构化八问:

  1. 是什么问题:one-click 的 fallback bump PR 被合并后,master 版本比 npm latest 领先一个 patch,而 Drift guard 把这种「可发布」状态当成「漂移」,拒绝此后每一次 dispatch——该版本永远发不出去,除非有人手动回退树。
  2. 什么原因导致的:guard 只区分「同步」和「任意不一致」两态,缺少第三态分支(tree == nextPatch(npm latest) 且 tag 未创建,即 fallback bump 已合未发),把合法待发布钉死成漂移。
  3. 影响范围与严重程度:仅 one-click 发版动作(workflow_dispatch)被整体卡死;端用户运行时、缓存、会话均不受影响;有绕行(手动回退树 / merge-gated 车道)。属发版管道可用性缺陷 → p2。
  4. 怎么修复的:在既有 guard 上加一个受三重条件限定的豁免态(版本形状对 + 目标一致 + tag 未存在),豁免时跳过会双写的 bump 步骤,其余流程原样走 direct 路径——只放宽入口判定,不动发布链路。
  5. 是否有回归问题:状态矩阵逐一走过——blank/explicit × in-sync / pending / other-drift / already-tagged:非 pending 形态行为与错误消息完全不变;Full CI gate(exact sha 全绿才发布)未动;tag 检查 + concurrency 串行化保证无双发布;显式高于 pending patch 的版本仍被拒(条件 b)。一处纯外观观察:pending 模式下 GitHub Release notes 的范围是 v0.1.209..HEAD~1(HEAD 为 merge commit),会把 release v0.1.210 bump commit 行自身写进自己的 release notes——仅文案层面,不影响任何行为,不值得为此开 follow-up。
  6. 是否破坏缓存:不涉及(无缓存/重试/游标逻辑)。
  7. 是否改了设计方向:无——train 模式(已退役)、prerelease 路径、0.0.x floor guard、needs_pr 回退分支均未触碰。
  8. 是否引入了新的配置:无。

收工判定:验证通过,无需返工。剩余一步是**重新点一次 one-click(空输入)**→ 直接从绿色 master head 发布 v0.1.210,无回退、无幽灵 0.1.211。触发 workflow_dispatch 属于发版动作,留给你点;若你明确指示我来触发,我也可以代劳。

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant