Repository navigation
fix: CI 凭据与产物名加固/健康报告/SQL控制台性能与护栏 - #22
Merged
Merged
Conversation
Wojusensei
force-pushed
the
fix/ci-secrets-and-query-limits
branch
from
October 17, 2026 18:57
8650105 to
b35ac9f
Compare
- build-macos 的 6 个 APPLE_* 改为仅非 pull_request 运行注入:同仓库分支的 PR 会带着这些凭据跑 PR 改过的 npm scripts / build.rs,等于把 Developer ID 证书 交出去;PR 上取空值后脚本自动降级为 ad-hoc 签名,构建仍然照常验证 - 两个工作流补 permissions: contents: read(此前缺省继承仓库默认令牌权限) - publish-* 的产物文件名改为经 env 传值 + 白名单校验:文件名里含 package.json 的 version,直接插值进 run 会被 shell 二次解析,文件名带引号即可逃逸执行命令 - release.yml 新增 verify job:tag 与 package.json / tauri.conf.json 版本必须一致 - 缺签名凭据默认只告警不失败:仓库当前没有配置 Apple 凭据,硬失败会让每次 tag 发布直接变红。改为由仓库变量 REQUIRE_MACOS_SIGNING=1 显式打开强制, 配好证书后再置 1,那时缺凭据会让发布失败而不是静默产出未公证的 DMG - if-no-files-found 由 warn 改 error,避免空构建变绿 - 第三方 action(rust-toolchain / rust-cache)固定到 commit
健康报告与时间机器原先用 repo.find_blob(..).size() 取文件大小,libgit2 的 对象查找会把 blob 完整解压进内存,遍历一棵树等于把仓库内容全读一遍。 同一份 64MB 仓库实测:旧写法仅walk一次 361ms,改用 odb.read_header 后 get_health_report 654µs、get_time_machine_snapshot 744µs,RSS 不再增长; 时间机器滑块每次 input 事件都会调用一次,代价被放大得更明显。 git_query 此前对结果集完全没有约束:行数无上限、无超时、单值长度无上限。 - 行数上限 5000,命中时用 truncated 字段告知前端(QueryConsole 显示提示), 否则用户会以为截断后的结果就是全部 - 10 秒超时用 progress_handler 中断,覆盖「不产出结果行但一直在算」的查询 (如 count 套无限递归 CTE),行数上限拦不住这类 - 单值上限 16MB(SQLITE_LIMIT_LENGTH),挡掉 hex(zeroblob(1e8)) 这类 一次产出几百 MB 字符串的函数 - 查询入口拆出 git_query_impl,超时与行数上限可注入,便于测试 新增 3 个回归测试(行数截断、超时中断、超大值拒绝),并把时间机器的大小 断言补上,避免取值路径改回解压后仍能通过。
Wojusensei
force-pushed
the
fix/ci-secrets-and-query-limits
branch
from
October 17, 2026 18:58
b35ac9f to
c7cc66c
Compare
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.
CI(commit 1)
性能(commit 2)
pass