chore(devex): CI 加 mac 矩阵 + version-triplet 校验 + bump-version.sh#294
Conversation
审查反馈:
1. CI 缺质量门禁 — 仅 windows-latest 1 job,mac 端 cargo check 路径
无 PR-time 验证,每次 release-tauri.yml 才暴露平台问题
2. .gitignore 不全 — promo-openless-v2/ 反复出现在 git status;
node_modules / dist / target 没全局兜底
3. 版本号同步风险 — package.json + tauri.conf.json + Cargo.toml 三处
人工改,每次发版都担心漏一处
改动:
A. .github/workflows/ci.yml
- 单一 windows-tauri job → matrix(macos-latest + windows-latest)
- mac job:cargo check + npm run build 验证跨平台编译
- Windows job:保留原 preflight + ps1 tokenize
- 新加 step:Verify version triplet stays in sync(两端都跑)—
一旦 package.json / tauri.conf.json / Cargo.toml 三处 drift 立刻
fail,给发版工程加 long-running guard
B. .gitignore
- 加 promo-openless-v2/(已实测出现在 untracked)
- 加 node_modules/ + dist/ + target/ 全局兜底(避免某子目录漏配
时 build artifact 进 PR)
- 加 .cargo/registry / .cargo/git 兜底
C. scripts/bump-version.sh(新文件)
- 1 个参数(X.Y.Z),sed 同步改 3 个文件 + cargo update -p openless
同步 Cargo.lock
- 验证三处一致后输出后续 git 操作建议
- 跨 macOS sed / GNU sed 兼容(-i.bak 后 rm)
下次发版:./scripts/bump-version.sh 1.2.21 一行搞定。
未来 PR 漏改版本号 CI 立刻 fail,不需要靠人记忆。
完整工程审计报告(系统化逐项检查): - 后端架构总评 + 5 个 P1/P2 优化点(coordinator/commands 拆分等) - 前端 4 个 UI bug(tab 切换竞态、流式滚动打断 QA 等) - 工程化水平评估 + 4 条改善(CI 门禁 / E2E / gitignore / 版本号) → 其中 3 条已在本 PR 实现(CI matrix + gitignore + bump-version 脚本) - 多端逻辑与体验一致性表(macOS vs Windows 平台差异 vs 行为一致性) - UI/后端 IPC 1:1 映射校验(全部命令前后端对齐 ✓) - 改进建议汇总:P0 无;P1 5 项;P2 6 项 - 总结:项目整体健康,建议下迭代处理 coordinator 拆分 + 前端动画竞态 把这份基线纳入 git,让 main 留下 v1.2.20→v1.2.21 这一阶段的工程现状 锚点,后续审计有 baseline 对照。
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b997f5fca2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # 仅匹配文件顶层 [package] 段下的 version = "X.Y.Z",避免误改 dependencies 里的版本。 | ||
| # OpenLess 项目 Cargo.toml 第一个出现的 version = 一定是 [package] 自己的。 | ||
| sed -E -i.bak \ | ||
| "0,/^version = \"[0-9]+\.[0-9]+\.[0-9]+\"$/s//version = \"$NEW\"/" \ |
There was a problem hiding this comment.
Avoid GNU-only sed addressing in the macOS release helper
When this helper is run on macOS, the default BSD/POSIX sed does not accept the GNU-only 0,/.../ address range (GNU sed itself rejects it under --posix), so the script aborts while updating Cargo.toml. Because this is the version-bump path developers are likely to run from a Mac, use a portable range/awk/perl/node edit instead of 0, here.
Useful? React with 👍 / 👎.
| update_cargo_toml_version "$CARGO_TOML" | ||
|
|
||
| echo "▶ 同步 Cargo.lock" | ||
| ( cd "$APP/src-tauri" && cargo update -p openless 2>&1 | grep -E 'Updating|Locking|^error' || true ) |
There was a problem hiding this comment.
Stop swallowing Cargo.lock update failures
If cargo update -p openless fails in this step, the trailing || true still lets the script continue and the later validation only checks Cargo.toml, not Cargo.lock. In that failure mode the helper prints success and suggests committing a stale lockfile version, which is exactly the release mismatch this script is meant to prevent.
Useful? React with 👍 / 👎.
| echo " git diff --stat $PKG_JSON $TAURI_CONF $CARGO_TOML \"$APP/src-tauri/Cargo.lock\"" | ||
| echo " git add $PKG_JSON $TAURI_CONF $CARGO_TOML \"$APP/src-tauri/Cargo.lock\"" |
There was a problem hiding this comment.
Include package-lock.json in version bumps
This helper updates package.json but never updates or stages openless-all/app/package-lock.json, even though the lockfile records the root package version and the repo release instructions require bumping it together with the other version fields. Running this script for a release can therefore leave package-lock.json on the previous version while the script reports the bump as complete.
Useful? React with 👍 / 👎.
PR Reviewer Guide 🔍(Review updated until commit 97fca4a)Here are some key observations to aid the review process:
|
|
Persistent review updated to latest commit 938c6a7 |
Codex 在 PR #294 上提了 3 个 P2,全部采纳: P2-A: BSD sed 不支持 GNU 行号范围 0,/.../ 原 sed -E -i.bak "0,/^version = .../s//.../" 在 macOS 默认 BSD sed 上 会 fail。换成 awk first-match 替换(mac BSD awk + GNU awk 都支持)。 P2-B: Cargo.lock 同步失败被 `|| true` 吞了 原 cargo update -p openless ... || true 会让脚本继续,validate 又只 校验 Cargo.toml 不校验 Cargo.lock。删 || true,让 set -euo pipefail 在 cargo update fail 时立刻退出;同时 validate 加 Cargo.lock 校验。 P2-C: package-lock.json 未跟着同步 npm 把 root version 也存在 package-lock.json 里(root + packages[''] 两处)。原脚本只 sed package.json 不更 lock,会让 npm ci 在 CI 出现 EUSAGE。换成 npm version --no-git-tag-version --allow-same-version 一次更两个文件。 ci.yml 的 verify step 也升级到校验 5 处一致: package.json / package-lock.json root+nested / tauri.conf.json / Cargo.toml / Cargo.lock 的 [openless] 包。 dry-run 已验证(用当前版本 1.2.20 跑一遍输出全部一致)。
|
@codex 三个 P2 已全部采纳(commit 97fca4a): P2-A 修: BSD sed 兼容性 — P2-B 修: P2-C 修:
dry-run 已验证(用当前版本 1.2.20 跑一遍输出全部一致)。 |
|
To use Codex here, create an environment for this repo. |
|
Persistent review updated to latest commit 97fca4a |
主要修复 ───────── - fix(windows): TSF DLL 静态链接 CRT,防 host 进程(QQ 等)私有 MSVCP140 劫持导致切微软拼音崩溃 0xc0000005(PR #287 + #289 + Codex P1 review)。 - fix(windows): 移除 DisableThreadLibraryCalls — /MT 下 CRT 需要 thread attach/detach 通知做 per-thread TLS 清理,禁用反而触发崩溃。 - fix(recording): 录音条出现时 mic 已 capture,按 Option 不再吞开头 字。emit Recording 加 race 检查避免短按时覆盖 stop/cancel UI 信号。 - fix(startup): splash 透明背景 + 卡片化,避免长启动时左半白屏。 - fix(vault): keyring chunks 用稳定 account name —— macOS Keychain Always-Allow 不再因 UUID 轮换失效;不再每次 load 都尝试删 9 个 legacy entries 触发 ACL 弹窗(与 PR #277 一起)。 新功能 ───────── - feat(security): 凭据从 plaintext JSON 迁移到平台 credential vault (macOS Keychain / Windows Credential Manager / Linux libsecret)。 Windows 2560 byte 限制下用 chunked storage;partial-write safe。 legacy 多源迁移完成后自动清理(PR #277)。 工程 ───────── - chore(ci): 暂时搁置 macos-13(Intel mac)matrix —— GH Actions runner pool 紧张到每次 dispatch queue 1-2h(已观测 4 次)。Apple Silicon 用户 dmg 仍发;Intel mac 用户保留 v1.2.20 dmg + Rosetta 说明(issue #299)。 - chore(devex): CI 加 macOS 矩阵 + 5-way 版本号一致性校验 + scripts/bump-version.sh 一行同步 5 处版本号。.gitignore 加 promo-openless-v2 / node_modules / dist / target 全局兜底(PR #294)。 - docs: docs/audit-2026-05-06.md 工程审计基线,覆盖架构 / UI bug / 多端一致性 / IPC 1:1 校验 / P0/P1/P2 改进路径。 - chore: 9 个改进 issue (#295-#303) 跟踪 audit 列出的所有 P1/P2/P3 问题。
User description
针对审查反馈 #1 / #3 / #4 的工程基建改进。
A. CI 加 mac 矩阵 + version 校验
`.github/workflows/ci.yml` 从单一 `windows-tauri` 1 job 改成 matrix:
B. .gitignore 兜底
C. `scripts/bump-version.sh`(新文件)
1 个参数(X.Y.Z),sed 同步 3 处版本号 + cargo update -p openless 同步 Cargo.lock。已 dry-run 测试过,输出三处版本号一致 + 后续 git 操作建议。
```
./scripts/bump-version.sh 1.2.21
```
跨 macOS sed / GNU sed 兼容(-i.bak 然后 rm)。
E2E 测试(审查反馈 #2)
单独立 issue,本 PR 不动。E2E 工程量大(Playwright + Tauri WebView2/WebKit driver + CI mock mic/hotkey),需要单独 sprint。
Test plan
PR Type
Enhancement, Documentation
Description
Add GitHub Actions matrix for macOS and Windows CI
Introduce version consistency check across five files
Add
scripts/bump-version.shfor safe version synchronizationAdd comprehensive engineering audit report (
docs/audit-2026-05-06.md)Diagram Walkthrough
File Walkthrough
bump-version.sh
Add bump-version.sh for synchronized version bumpsscripts/bump-version.sh
package.json,package-lock.json,tauri.conf.json,Cargo.toml,and
Cargo.lockcompatibility
ci.yml
Expand CI to macOS matrix with version sync check.github/workflows/ci.yml
Windows
tsc + vitebuild and backendcargo checkstepsaudit-2026-05-06.md
Add comprehensive engineering audit reportdocs/audit-2026-05-06.md
and platform consistency
command‑layer business logic
improvements