Skip to content

Commit 5f225a5

Browse files
committed
fix(release): 发版准备工作流可重入——已有 PR 不动分支,只覆盖机器产出
两次在真实 main 上跑 v0.9.1 的 Release Prep,八步里前七步都成功, 每次都卡在最后一步,但原因不同: 1. 第一次(run 39123249758)gh pr create 被拒: GraphQL: GitHub Actions is not permitted to create or approve pull requests。 工作流 job 里的 pull-requests: write 只是声明式权限,总开关在仓库 Settings → Actions → General;组织默认关闭时仓库层改不动(gh api PUT 返回 409)。 代码这边能做的只有把失败说清楚,报错要点名去哪个页面、开哪个开关。 2. 第二次(run 39126751114)更早就挂:release-prep/0.9.1 已存在, push 被 fetch first 拒——这条工作流原本不可重入。 不可重入的代价不是重跑失败这么轻:人会以为流程坏了,转去手工发版, 整套自动化就此被绕开。 修法:推分支前加三档守卫—— · 分支上有进行中的 PR:什么都不动、静默退出(分支上可能已有人补条目) · 没有 PR 且顶端是上次机器产出:按重跑处理,用 --force-with-lease 覆盖 (不是 --force:远端在 fetch 之后被推过就拒) · 其余:停下,要人先确认那条分支是谁的 回归锁加在 test/workflow-guards.test.js 两条,五处变异验证全部变红。 其中报错文案那条第一版是 GREEN——对全文 grep 会被注释里解释这件事的 文字骗过,改用 codeOnly() 剥注释后才真正锁住;同理,判定那条断言的是 if 本身而不是变量名,否则变量名留在 case 里、判定删掉照样绿。 车道内 npm test: 2173 tests / 2172 pass / 0 fail / 1 skip check-sync: 72 个文件一致
1 parent 6db884b commit 5f225a5

5 files changed

Lines changed: 92 additions & 10 deletions

File tree

‎.github/workflows/release-prep.yml‎

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,39 @@ jobs:
8181
echo "::warning::无改动(版本号/占位行已存在)——跳过提交与 PR"
8282
exit 0
8383
fi
84-
git checkout -b "release-prep/$VERSION"
84+
BRANCH="release-prep/$VERSION"
85+
REMOTE_HEAD=$(git ls-remote --heads origin "$BRANCH" | cut -f1)
86+
FORCE=""
87+
if [ -n "$REMOTE_HEAD" ]; then
88+
OPEN_PR=$(gh pr list --head "$BRANCH" --state open --json number --jq ".[0].number" || true)
89+
if [ -n "$OPEN_PR" ]; then
90+
echo "::warning::分支 $BRANCH 上已有进行中的 PR #$OPEN_PR——重跑会盖掉人在 PR 里补的条目,本次不动任何分支。"
91+
echo "去补 #$OPEN_PR 里的三处人写内容,或关掉它之后重跑。"
92+
exit 0
93+
fi
94+
git fetch --depth=1 origin "$BRANCH" >/dev/null 2>&1
95+
HEAD_SUBJECT=$(git log -1 --format=%s FETCH_HEAD)
96+
HEAD_AUTHOR=$(git log -1 --format="%an <%ae>" FETCH_HEAD)
97+
# 只在「顶端是上次机器产出」时才当作重跑覆盖:人工推过东西的分支一律停下。
98+
# case 的模式里 $VERSION 会展开,用 case 而不是 ${var#pat} 免得模式里的
99+
# 空格与全角括号在转义上出岔子。
100+
MACHINE_TAIL=no
101+
case "$HEAD_SUBJECT" in
102+
"chore: v$VERSION 发布准备"*)
103+
if [ "$HEAD_AUTHOR" = "modusensus <[email protected]>" ]; then
104+
MACHINE_TAIL=yes
105+
fi
106+
;;
107+
esac
108+
if [ "$MACHINE_TAIL" != "yes" ]; then
109+
echo "::error::分支 $BRANCH 已存在、没有进行中的 PR,但它的顶端提交不是本工作流生成的($HEAD_AUTHOR / $HEAD_SUBJECT)。"
110+
echo "先人工确认那条分支上的内容——合并或删掉它——再重跑,避免覆盖掉别人的提交。"
111+
exit 1
112+
fi
113+
echo "分支 $BRANCH 已存在,顶端是上次机器产出、且没有 PR(多半卡在开 PR 那一步):按重跑处理,覆盖它。"
114+
FORCE="--force-with-lease=refs/heads/$BRANCH:$REMOTE_HEAD"
115+
fi
116+
git checkout -b "$BRANCH"
85117
git add dsh-mneme/package.json dsh-mneme/package-lock.json dsh-mneme/CHANGELOG.md README.md dsh-mneme/README.md
86118
{ echo "chore: v$VERSION 发布准备(版本号 + 测试徽章 + CHANGELOG/版本表占位行)"
87119
echo
@@ -94,7 +126,7 @@ jobs:
94126
echo "- [ ] 跨 minor 时把 SECURITY.md 中英两张支持版本表挪一格(活跃开发 / 尽力维护 / 不支持三段一起挪,含停止维护那段通知)"
95127
} > commit-msg.txt
96128
git commit -F commit-msg.txt
97-
git push origin "release-prep/$VERSION"
129+
git push origin "HEAD:refs/heads/$BRANCH" $FORCE
98130
# PR 正文走 --body-file:多行中文塞进 --body 需要一堆 $'\n' 转义,
99131
# 读的人看不懂、改的人不敢动。写成文件既好读也不受 shell 引号规则摆布。
100132
{
@@ -110,6 +142,13 @@ jobs:
110142
echo
111143
echo "合并后推 v$VERSION tag 即自动发布(release.yml 会核对 tag / package.json / CHANGELOG 三方一致)。"
112144
} > pr-body.md
113-
gh pr create --base main --head "release-prep/$VERSION" \
145+
# GITHUB_TOKEN 能不能开 PR 取决于仓库级开关(Settings → Actions → General →
146+
# "Allow GitHub Actions to create and approve pull requests"),job 里写
147+
# `pull-requests: write` 覆盖不了它——2026-10-18 实测这两个开关是反的,
148+
# 整条工作流的最后一步因此每次都失败,而前面七步全是好的。
149+
if ! gh pr create --base main --head "$BRANCH" \
114150
--title "release: v$VERSION 发布准备" \
115-
--body-file pr-body.md
151+
--body-file pr-body.md; then
152+
echo "::error::分支 $BRANCH 已推上去,但开 PR 失败。若报 'GitHub Actions is not permitted to create or approve pull requests',去仓库 Settings → Actions → General 打开 'Allow GitHub Actions to create and approve pull requests',然后重跑本工作流——此时还没有 PR,重跑守卫会覆盖上次的机器产出,不会丢任何人的改动。"
153+
exit 1
154+
fi

‎README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-3E63DD?style=flat-square" alt="license"></a>
1111
<a href="https://github.com/slow-stack/mneme/actions"><img src="https://img.shields.io/github/actions/workflow/status/slow-stack/mneme/ci.yml?style=flat-square&label=CI" alt="CI"></a>
1212
<a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-22%2B-3E63DD?style=flat-square&logo=nodedotjs&logoColor=white" alt="node"></a>
13-
<a href="https://github.com/slow-stack/mneme"><img src="https://img.shields.io/badge/tests-2171%20passed-3E63DD?style=flat-square" alt="tests"></a>
13+
<a href="https://github.com/slow-stack/mneme"><img src="https://img.shields.io/badge/tests-2173%20passed-3E63DD?style=flat-square" alt="tests"></a>
1414
<a href="https://codecov.io/gh/slow-stack/mneme"><img src="https://img.shields.io/codecov/c/github/slow-stack/mneme/main?style=flat-square" alt="coverage"></a>
1515
<a href="https://github.com/awesome-dsh-plugin/awesome-dsh-plugin"><img src="https://awesome-dsh-plugin.com/badge.svg" alt="Awesome"></a>
1616
</p>
@@ -268,7 +268,7 @@ dsh-mneme-serve # 默认 ~/.dsh/memory + 127.0.0.1:8790
268268

269269
```bash
270270
cd dsh-mneme && npm install
271-
npm test # 2171 个测试
271+
npm test # 2173 个测试
272272
npm run stress # 三轴线压测
273273
npm run sync # src → lib 同步
274274
```
@@ -546,7 +546,7 @@ Community projects that wire mneme into more platforms — not part of this repo
546546

547547
```bash
548548
cd dsh-mneme && npm install
549-
npm test # 2171 tests
549+
npm test # 2173 tests
550550
npm run stress # three-axis stress test
551551
npm run sync # src → lib sync
552552
```

‎dsh-mneme/CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
- **Release 正文从「CHANGELOG 逐字搬运」改成「标题 + 一句导语 + 折叠细节」(新增 `dsh-mneme/scripts/release-notes.mjs`)**:此前 `release.yml` 用内联 `node -e` 把 CHANGELOG 该节原样写进 Release 说明,于是 v0.9.0 的 Release 页有 29921 字符、单条子弹最长 3318 字符——正文里全是决策理由与变异验证,读者要点开一屏才知道这条在说什么。抽取搬到独立模块并改成**分层渲染**:每条子弹保留粗体标题与一句导语(默认可见),其余正文折进 `<details>`,**CHANGELOG 本体一个字不动**(那是含决策理由与审计线索的完整记录,压缩只发生在对外渲染这一步)。导语切分规则全由真实语料逼出:句末标点只认 `。!?` 而**刻意不认半角句号**(版本号里的点是同一字符,认了会切在版本号中间);软标点断点必须**括号平衡**(v0.9.0 实测切出过「GET /external-api(明文回吐 Bearer,」这种把从句切断的收尾);导语不得短于 24 字符(有条首句只有 8 个字的「两处水源在说谎。」,离开上下文没有信息量);正文本身比上限还短时整段就是导语、不再加省略号(否则凭空说「后面还有」)。回归锁 17 条进新增的 `test/release-notes.test.js`(含真进程端到端:渲染后 CHANGELOG 字节不变、找不到小节必须非零退出且报出是哪一版),`test/release-workflow.test.js` 补一条「正文抽取必须调模块、不许退回内联脚本」。**两条评审意见都是真 bug,各补一条锁**:一是「短正文保护」原先守在 `lede()` 末尾、排在软断点搜索之后,短正文里只要有逗号就会被加省略号,逗号恰是末字时省略号后面什么都没有、折叠块是空的——这条保护必须最先执行;二是渲染单位错成了「行」,而 CHANGELOG 里有 **179 行缩进续行**(0.8.6 / 0.8.7 / 0.8.12 等老版本集中出现,另有 59 行缩进子列表),逐行 trim 会把续行甩到条目的 `<details>` 外面并丢掉缩进,读者看到的是「正文只有一句,剩下的莫名其妙散在下面」——改为先 `splitBlocks()` 切出「一条子弹 + 它的全部续行」再按**条目**渲染,且**导语只从条目首行取**(把续行拼回正文再切,换行会混进可见行,续行又被推回 details 外面)。变异验证三轮共十处全部变红(删短正文保护 / 去掉括号平衡 / 导语上限归零 / 软断点 `consumed` 少记一位 / details 与正文之间去掉空行 / 删入口守卫 / 删版本格式校验 / 短正文保护挪回末尾 / 退回逐行渲染 / 导语改从整段取)。
2828

2929
- **发版准备把新版本节插在了 `[Unreleased]` 之上,且把攒着的条目留在原地(第一次实跑暴露,随后按评审意见补两处)**:改造后的 Release Prep 工作流第一次在真实 main 上跑 v0.9.1,`gh pr create` 因组织策略失败(GitHub Actions 不允许开 PR,属合理默认,不改),但脚本已经跑完并推了分支——于是它的产出能被直接审。产出是错的,两个位置错误:新版本节被插在 `# Changelog` 之后、也就是 `## [Unreleased]` **之上**,得到「`[0.9.1]` 排在 `[Unreleased]` 前面」的颠倒顺序;`[Unreleased]` 里攒的 9 条条目**原地不动**,新节里只有一条「🐛 修复 /(待填)」。两处都有同一个历史痕迹作证:v0.9.0 那次发版(`a9f8e35`)之后靠一笔人工提交 `77df0fb`「v0.9.0 版本节补上内容——把 [Unreleased] 攒的 27 条搬进来」才掰回来——**机器算得对的事不该留给人补**。现在先切出 `[Unreleased]` 到下一个 `## [` 之间的正文:非空则整段搬进新版本节、`[Unreleased]` 留空;为空才插占位节。搬位置不搬内容,一个字不改,所以「新节里该写什么」仍然只由往 `[Unreleased]` 写条目的人做。**两条评审意见都是真问题,各补一条锁**:一是用 `moved`(`- ` 条目数)当「有没有搬」的判据是错的——正文非空但一条 `- ` 都没有时 `moved` 是 0,入口会打印「占位节(`[Unreleased]` 本来是空的)」,而它显然不空;改为独立字段 `movedContent` 决定日志分支、`moved` 只用来把话说得更具体。二是 `body.trim()` 会吃掉首行的前导空格,`[Unreleased]` 首行若是四空格缩进代码块就会降级成普通段落,与「原样搬」矛盾;改为只剥节边界空行(并以原文行尾拼回,免得 CRLF 文件退化成混合行尾)。回归测试 8 条 → 10 条。
30+
- **发版准备工作流真正跑通:重跑不再撞分支,开 PR 失败会告诉人该去开哪个开关(两次实跑暴露的两个独立真因)**:2026-10-18 把 v0.9.1 在真实 main 上跑了两遍,**八步里前七步全成功,每次都卡在最后一步**,但两次的原因完全不同。①第一次(run 39123249758)报 `GitHub Actions is not permitted to create or approve pull requests`——工作流 job 里写着 `pull-requests: write`,可它只是声明式权限,真正的总开关在仓库设置(Settings → Actions → General → *Allow GitHub Actions to create and approve pull requests*),实测 `gh api repos/slow-stack/mneme/actions/permissions/workflow` 返回 `can_approve_pull_request_reviews: false`;更麻烦的是**这个开关在组织层默认关闭时仓库层根本改不动**(`gh api -X PUT` 直接 409 Conflict:*The organization does not allow GitHub Actions to create or approve pull requests*),所以除了给报错补上「去哪个页面、打开叫什么名字的开关」,代码这边能做的只有把失败说清楚。②第二次(run 39126751114)在**更早的位置**就挂了:`! [rejected] release-prep/0.9.1 -> release-prep/0.9.1 (fetch first)`——上一次运行已经把同名分支推上去了,这条工作流原本**不可重入**。不可重入的代价不是「重跑失败」这么轻:人会以为流程坏了,转去手工发版,整套自动化就此被绕开,而那正是这套流程想避免的结果。修法是把推分支那一步改成三档守卫:分支上有**进行中的 PR** → 什么都不动、静默退出(分支上可能已经有人补了 CHANGELOG 条目,那正是留给人的那部分工作,覆盖掉比不能重跑更糟);**没有 PR 且顶端是上次机器产出**(提交者是 `modusensus`、标题以 `chore: v<版本> 发布准备` 开头)→ 按重跑处理,用 `--force-with-lease=refs/heads/<分支>:<fetch 到的 SHA>` 覆盖(不是 `--force`:远端在我们 fetch 之后被推过就拒绝);**其余情况** → 停下并要人先确认那条分支。回归锁加在 `test/workflow-guards.test.js` 两条,五处变异验证(去掉 PR 查询 / `--force` 退回无条件 / 删掉「顶端不是机器产出就停」的判定 / 报错文案去开关名 / 报错文案去具体报错)全部变红;其中后两条第一次是 GREEN——因为对全文 grep 会被注释里解释这件事的文字骗过,改用 `codeOnly()` 剥注释后才真正锁住。
3031
## [0.9.0] - 2026-10-17
3132

3233
## 🆕 新增

‎dsh-mneme/README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![npm version](https://img.shields.io/npm/v/@modusensus/dsh-mneme?color=blue&label=npm)](https://www.npmjs.com/package/@modusensus/dsh-mneme)
66
[![license](https://img.shields.io/badge/license-MIT-green)](LICENSE)
77
[![Awesome](https://awesome-dsh-plugin.com/badge.svg)](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin)
8-
[![tests](https://img.shields.io/badge/tests-2171%20passed-success)](https://github.com/slow-stack/mneme)
8+
[![tests](https://img.shields.io/badge/tests-2173%20passed-success)](https://github.com/slow-stack/mneme)
99
[![CI](https://img.shields.io/github/actions/workflow/status/slow-stack/mneme/ci.yml)](https://github.com/slow-stack/mneme/actions)
1010
[![node](https://img.shields.io/badge/node-22%2B-blue)](https://nodejs.org)
1111
[![npm downloads](https://img.shields.io/npm/d18m/@modusensus/dsh-mneme.svg?color=blue&label=downloads)](https://www.npmjs.com/package/@modusensus/dsh-mneme)
@@ -673,7 +673,7 @@ src/
673673
├── api.js # HTTP 路由(Web 面板数据通道,含 /conflicts 冲突队列)
674674
└── index.js # 插件接线
675675
lib/ # src 的同步分发产物(npm run sync,prepack 钩子在发布时自动跑;一致性由 scripts/check-sync.js 在 CI 与 release.yml 校验——它只查不同步;唯一手写例外 lib/client.js——Web 面板 bundle,sync 不覆盖)
676-
test/ # 2171 个 node:test 测试(审计与三轴线压测不变量;src↔lib 一致性由 scripts/check-sync.js 发布闸门校验)
676+
test/ # 2173 个 node:test 测试(审计与三轴线压测不变量;src↔lib 一致性由 scripts/check-sync.js 发布闸门校验)
677677
scripts/ # e2e-dsh.js 端到端演示 · stress-dsh.js 三轴线压测 · sync-lib.js 同步 · check-sync.js 发布闸门 · benchmark-recall.js / benchmark-embed.js / benchmark-rerank.js 基准 · sync-test-badge.mjs 测试徽章 · build-runtime-manifest.mjs 运行时清单
678678
```
679679
@@ -682,7 +682,7 @@ scripts/ # e2e-dsh.js 端到端演示 · stress-dsh.js 三轴线压
682682
```bash
683683
cd dsh-mneme
684684
npm install # 安装 peer 依赖(以 devDependencies 形式,用于本地测试)
685-
npm test # 运行 2171 个测试
685+
npm test # 运行 2173 个测试
686686
npm run stress # 三轴线压测:长会话检索 / 冲突仲裁 / 多 Agent 并发(离线 mock LLM)
687687
npm run sync # 把 src/ 同步到 lib/(发布时由 prepack 钩子自动执行)
688688
```

‎dsh-mneme/test/workflow-guards.test.js‎

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,45 @@ test("发版准备的两份人写清单都点出跨 minor 要挪 SECURITY.md 支
112112
const hits = yml.match(/SECURITY\.md 中英两张支持版本表/g) || [];
113113
assert.equal(hits.length, 2, "commit message 与 PR 正文各要有一条,实际 " + hits.length);
114114
});
115+
116+
test("release-prep.yml 的重跑守卫:已有 PR 不动分支,只覆盖机器产出", () => {
117+
// 2026-10-18 实测:工作流 8 步里前 7 步全成功,最后一步 git push 被
118+
// "! [rejected] release-prep/0.9.1 -> release-prep/0.9.1 (fetch first)" 打回——
119+
// 上一次运行已经把同名分支推上去了。不可重入的代价不是「重跑失败」这么轻:
120+
// 人会以为流程坏了,转去手工发版,整套自动化就此被绕开。
121+
//
122+
// 但「能重跑」不能退化成「无条件 force push」:分支上可能已经有人补过 CHANGELOG
123+
// 条目,那正是这套流程留给人的那部分工作,覆盖掉比不能重跑更糟。所以守卫分三档:
124+
// 有进行中的 PR → 什么都不动;顶端是机器产出且没有 PR → 按重跑覆盖;其他 → 停下要人看。
125+
const yml = readFileSync(path.join(repoRoot, ".github", "workflows", "release-prep.yml"), "utf8");
126+
const blocks = runBlocks(yml);
127+
const pushBlock = blocks.find((b) => /git push/.test(b));
128+
assert.ok(pushBlock, "应当能切出含 git push 的那个 run 块");
129+
130+
const prLookup = pushBlock.indexOf('--state open');
131+
const pushAt = pushBlock.indexOf("git push");
132+
assert.ok(prLookup > 0, "重跑前必须查有没有进行中的 PR(gh pr list --state open)");
133+
assert.ok(prLookup < pushAt, "查 PR 必须发生在 push 之前");
134+
135+
// 三档判定:没有 PR 才继续;继续时顶端提交必须是本工作流生成的。
136+
assert.ok(pushBlock.includes("--force-with-lease="), "重跑覆盖必须用 --force-with-lease(锁住 fetch 到的 SHA)");
137+
assert.ok(!/git push[^\n]*--force(?!-with-lease)/.test(pushBlock), "不得退回无条件 --force");
138+
// 断言的是那个 if 本身,不是变量名:变量名留在 case 里、判定被删掉,
139+
// 只查 includes("MACHINE_TAIL") 照样绿(第一版就是这么漏的)。
140+
assert.match(pushBlock, /if \[ "\$MACHINE_TAIL" != "yes" \]; then/, "必须有「顶端不是机器产出就停下」的那道判定");
141+
});
142+
143+
test("release-prep.yml 开 PR 失败时给的是可行动的报错,不是裸 GraphQL 报错", () => {
144+
// 第二个真因(2026-10-18 实测):仓库级开关 can_approve_pull_request_reviews=false,
145+
// job 里写 pull-requests: write 覆盖不了它,最后一步报
146+
// "GitHub Actions is not permitted to create or approve pull requests"。
147+
// 这个开关在**组织层**默认关着时仓库层根本改不动(gh api 返回 409 Conflict),
148+
// 所以要让人一眼看出该去哪里开、开完能不能直接重跑。
149+
const yml = readFileSync(path.join(repoRoot, ".github", "workflows", "release-prep.yml"), "utf8");
150+
// 只在**可执行部分**里找:这几句话在注释里也出现过(注释是在解释为什么),
151+
// 对全文 grep 会被自己写的说明文字骗过——报错文案被删干净了照样绿。
152+
const code = codeOnly(yml);
153+
assert.match(code, /not permitted to create or approve pull requests/, "报错文案要点名这个具体的 GitHub 报错,人才搜得到");
154+
assert.match(code, /Settings → Actions → General/, "必须写清去哪个设置页开");
155+
assert.match(code, /Allow GitHub Actions to create and approve pull requests/, "必须写清要打开的那个开关叫什么");
156+
});

0 commit comments

Comments
 (0)