ci: LLM bilingual release notes + release pipeline fixes#673
Merged
Conversation
…grity, notify webhook - Replace 400-line word-by-word translate-notes.js dictionary with summarize-release-notes.mjs: one OpenAI-compatible LLM call produces user-facing Chinese highlights + English counterparts + collapsible raw commit list; strict JSON/CJK validation with grouped plain-English fallback; never exits non-zero so notes can't block a release - release.yml: notes job moved first (kills the empty-body window left by upload steps' 'gh release create --notes ""'); final job replaced by webhook notify; Node unified to 22 - promote-dev-to-master.yml: soak now promotes the newest first-parent dev commit >= 24h old (select-promote-candidate.sh) instead of requiring dev HEAD age — active weeks no longer starve master; CI gate walks candidates newest-first - docker-publish.yml: branch pushes tag latest + sha-<short> only; ghcr.io vX.Y.Z images now build exclusively from the tag via bump-electron.yml dispatch (no more version-tag clobbering) - notify-webhook.sh: plain-text POST to NOTIFY_WEBHOOK_URL secret on release/promote success/failure; silent no-op when unset - align notes commit filter with bump SKIP_RELEASE_PATTERN
- select-promote-candidate.sh: filter candidates with merge-base --is-ancestor -- first-parent commits below a master->dev sync-back merge are not fast-forwards and would reject the promote push; validate numeric env; avoid "[ ] &&" errexit footguns - release.yml notes job: stable releases created --latest=false so an asset-less release never becomes /releases/latest during the build window (or permanently, when smokes fail); notify job flips --latest only after all platforms succeed; edit/create wrapped in a 3-attempt retry without discarding stderr - docker-publish.yml: dispatching an old tag no longer moves "latest" backwards (only tagged when HEAD == master tip); tag input validated against semver (blocks GITHUB_OUTPUT heredoc injection); interpolation moved to env vars - promote pick loop: gh api failure skips the candidate (api-error) instead of aborting the job and firing a misleading ff-failure alarm; failure webhook text genericized; notify-ff-failure gets contents:read and sends the webhook before issue creation - summarize-release-notes.mjs: stdin captured once (fatal fallback no longer double-reads EOF and prints empty); highlights must be single-line <=300 chars (prompt-injection guard); commit lines HTML-escaped in details block; feat!: / fix(scope)!: grouped correctly - generate-release-notes.sh: node crash falls back to raw commit list instead of failing the release job (pipefail path) - tests: +6 covering all of the above (60/60 in tests/unit/ci)
fd4eb70 to
7b24966
Compare
- release.yml notify: delete a zero-asset release when all builds fail (a published empty release would break beta clients resolving the newest prerelease; tag kept so re-dispatch can retry), retry the --latest flip 3x, webhook runs if always() and reports flip failures - release.yml: backstop gh release create in upload steps also passes --latest=false for stable tags; notes-job retry uses growing backoff - docker-publish.yml: tag validation switched to whole-string anchored bash regex (grep matched per-line, letting multiline payloads through) - select-promote-candidate.sh: verify MASTER_REF/DEV_REF exist up front (rev-list errors inside process substitution were swallowed and looked like a normal soak skip) - tests: +1 missing-ref loud-failure case (61/61)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CI 盘点后的第一批修复(详见各小节根因)。
P0 — Release notes 质量
translate-notes.js(机翻词盐根因:'打包打包冒烟超时'、'未捕获捕获'、介词全局替换)summarize-release-notes.mjs:单次 OpenAI-compatible LLM 调用,按 Electron 用户视角输出「✨ 本次更新」中文亮点 + 英文对照 +<details>完整 commit 清单RELEASE_NOTES_BASE_URL/RELEASE_NOTES_API_KEY/RELEASE_NOTES_MODELP0 — release.yml 空 body 窗口
notes 生成从最后一个 job 提前为第一个 job:此前 upload 步骤先
gh release create --notes "",notes job 一挂 release 永久空 body(更新弹窗显示空白)。Node 统一到 22。P1 — promote soak 饿死
旧规则要求 dev HEAD 本身 ≥24h,活跃周每个 push 重置时钟 → master 长期不晋升。新增
select-promote-candidate.sh:晋升最新的已泡满 24h 的 first-parent commit(新鲜提交留 dev 继续 soak),CI 门禁按候选从新到旧找绿。force_skip_soak行为不变。P1 — Docker 版本镜像被覆盖
docker-publish.yml此前在 master push 时用max(package.json, latest stable tag)打版本镜像 → 14:00 promote 后ghcr.io/...:vX.Y.Z被晚于 tag 的代码覆盖。现在分支 push 只打latest+sha-<short>;版本镜像仅由bump-electron.ymldispatch 带tag输入、从 tag 源码构建。P1 — 发版通知
notify-webhook.sh:release 成功/失败、promote 成功/ff 破坏时 POST 纯文本到NOTIFY_WEBHOOK_URLsecret(ntfy 开箱可用);未配置静默跳过、永不阻塞。该 secret 尚未配置,填上即生效。P2
notes 过滤规则对齐 bump 的
SKIP_RELEASE_PATTERN(排除 chore/docs/ci/test/refactor/style)。Test plan
tests/unit/ci/summarize-release-notes.test.ts(13 用例:双语渲染 / JSON 契约校验 / CJK 校验 / fence 容错 / fallback 分组 / CLI exit-0)tests/unit/ci/select-promote-candidate.test.ts(6 用例:fixture git repo 控制 commit 时间,覆盖饿死场景 / FORCE / MAX_CANDIDATES)tests/unit/ci/release-notes-script.test.ts更新(filter 对齐 + fallback 断言)npm test:2537 passed / 1 skipped