Repository navigation
[PR] fix(release): land the raw-publish bump as a commit before tagging/syncing (empty sync PR 422 + stale-version tag) - #5457
Conversation
…ncing Today's audit of the raw_publish emergency path (#5430/#5447) found two silent bookkeeping bugs in 'Raw emergency publish': the Bump version step stages the bumped package.json/changelog/manifests but never commits them (the commit lives in 'Commit and push to master', which the raw path skips), so in the raw workspace: 1. git tag v$VER pointed at a tree that still carried the OLD version — later bugfix-lane cuts-from-tag read the stale version from the tree and misfire their strict-newer/already-live guards; 2. git push HEAD:refs/heads/emergency-sync-... pushed a branch byte- identical to master -> empty diff -> GitHub rejects the auto sync PR with a 422 -> master never converges -> the next NORMAL one-click release aborts on the drift guard. Fix: commit the staged bump in-place right after npm publish, before any tag/branch push. The tag then points at a version-consistent tree and the sync PR carries a real mergeable diff (branch name still matches neither release.yml gate, so merging publishes nothing). On the pending_bump path the tree is already bumped, nothing stages, and the guarded commit no-ops with a notice.
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.7723-pr.5457.f6e1766This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5457.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 收到。这是 PR #5457 的镜像线程,分支 查重: 不重复——open/closed 全库检索 初步核对:diff 与 issue 描述完全一致——单文件 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.990-master.760c24c # this exact build
npm install -g billion-context@master # always the newest merged build
|
修什么
raw_publish紧急通道(今晚 #5447 合入的那套)有两个静默账目 bug,都是同一个根因:Bump version 步骤只git add、从不 commit(commit 在 raw 路径被跳过的 Commit-and-push 步骤里),于是 raw 步骤跑的时候工作区是"已暂存未提交"状态。后果(在 npm publish 之后发生,publish 本身不受影响):
git tag v$VER打在一个 tree 里 package.json 仍是旧版本的 commit 上 → 以后从该 tag 切 bugfix lane 时按树读版本 → strict-newer / already-live 守卫误判;git push origin HEAD:refs/heads/emergency-sync-...推出的分支与 master 逐字节相同(HEAD 没动过)→ 空 diff → GitHub 拒绝建 PR(422)→ master 永不收敛 → 下次走正常一键发版会卡在 drift guard。怎么修(最小改动,+12 行,只动 Raw 步骤)
npm publish 成功之后、任何 tag/branch push 之前,把已暂存的 bump 原地提交(
github-actions[bot]身份)。之后:tag 指向版本一致的树 ✓,sync 分支带真实 diff、可合并且合了不会二次发版(分支名不匹配 release.yml 两个 gate)✓。pending_bump 路径下没有暂存内容,if ! git commit守卫打印一条 warning 后继续(tag 照旧指向当前 head,行为不变)。验证
npx js-yaml release-manual.yml解析通过;bash -n语法通过;边界
不碰 skip_ci_gate、不碰 drift guard 逻辑、不碰正常路径;skip_ci_gate 在 master 受保护后价值趋零的问题(需要重设计为 master-independent)另议,不在本 PR。