Repository navigation
ci: 建立 PR 自动化验收与 Codex 修复闭环 - #2
Merged
Merged
Conversation
目标: 建立 PR 路径过滤的确定性检查 -> 隔离真实 AI 与外部环境 -> Codex 审查/修复闭环 -> merge-gate 阻断不合格合并 前端: 1. E2E 核心链路: 使用真实 Spring Boot、PostgreSQL、Redis 和 Playwright 覆盖登录、创建应用、离线生成、文件编辑、版本冲突与越权读取 2. 测试报告门禁: Vitest/Playwright 输出 JUnit;本地 295 项单测和 1 条 E2E 均为 0 失败、0 跳过 3. 静态检查基线: 新增只读 Oxlint/ESLint/Prettier 命令,统一源码格式,并用 eslint-suppressions 锁定 104 个存量违规,新增违规仍失败 后端: 1. Testcontainers 集成层: 使用 PostgreSQL 17 与 Redis,验证会话所有权、唯一约束、缓存回填/失效和完整 Spring 上下文;本地 4 项通过 2. 外部测试隔离: 真实数据库/Docker 用例标记 external,默认 PR 排除;真实模型测试移出默认 tests 目录 3. 离线安全边界: Python 测试在无外网 namespace 运行,清空模型/数据库环境变量,测试替身不调用模型;本地 677 项通过、0 跳过 4. 发布边界修复: 部署遍历按真实路径拒绝 Windows junction 与符号链接越出产物根,并保留红转绿测试;Java 885 项通过、0 跳过 其他: 1. GitHub Actions: 路径检测、Maven/npm/uv 缓存、并行 job、每周全量、固定 merge-gate 和 JUnit 结果检查 2. Codex 自动化: PR Review 只报高价值缺陷;/codex fix 经权限、保护路径与补丁上限校验后推送并重触发检查 3. 人工成本隔离: Real AI Tests 仅手动触发并使用 real-ai environment,PR 不配置模型密钥 author By glyahh
目标: 修复 Linux PR 检查暴露的路径分隔符绕过 -> 补齐 POSIX shell 语义 -> 保持安全断言真实执行 前端: 1. 无 后端: 1. 反斜杠越界: 参数先统一分隔符再检查 ..,Linux 不再把 Windows 反斜杠路径当成普通文件名 2. 路径前缀可执行文件: 按统一后的 basename 匹配白名单,.\.venv\Scripts\python.exe 在 Linux 校验也成立 3. POSIX 命令: 本地 shell 白名单补充 ls/cat,测试按平台选择 type/dir 或 cat/ls,不跳过安全检查 其他: 1. 回归结果: 定向 59 项通过,Windows 全量 Python 套件同步复跑中;Linux 结果以新的 PR Checks 为准 author By glyahh
目标: 修复真实 Linux Runner 暴露的路径与平台差异 -> 保持安全断言 -> 让 PR 检查可重复通过 前端: 1. 无 后端: 1. 路径分隔符: WorkspacePathResolver 统一反斜杠后再解析,并校验 deployKey,阻止 Linux 上绕过 Windows 风格穿越 2. Git/暂存测试: 平台相关 Git 与 Python 可执行文件、askpass wrapper 和临时真实路径按运行系统选择 3. Windows 原生 Worker: 仅依赖盘符与 WSL 的用例标记 external,避免在 Linux 伪失败 4. 测试启动配置: E2E 和集成 profile 补齐 OSS 占位凭据,公开 CI 无本地 .env 时也能启动完整上下文 其他: 1. 回归结果: Python 679 项通过,相关 Java 跨平台测试类通过;Linux 完整结果以新 PR Checks 为准 author By glyahh
目标: 统一测试临时目录 -> 解析 venv 符号链接 -> 让 Linux 安全检查针对真实受管路径 前端: 1. 无 后端: 1. 测试临时目录: Surefire 固定 java.io.tmpdir 到构建目录,避开 Runner 系统临时目录的链接祖先误判 2. venv 解释器: ImportProperties 在配置边界解析 python 符号链接,凭据与启动解析不再把正常 venv 当特殊节点 3. Git askpass: python 与 helper 先规范化为真实文件,再进入受管路径守卫,受管工作区链接检查保持不变 其他: 1. 回归结果: 相关 Java 类与 Python 59 项安全/shell 测试通过;等待新 PR Checks 验证 Linux Runner author By glyahh
Owner
Author
|
实测完成:最新提交 |
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.
摘要
建立路径过滤的 PR 必需检查、固定
merge-gate、Testcontainers 集成层和 Playwright 核心 E2E,并把真实模型/外部环境测试移出常规合并路径。当前master是旧基线,本 PR 以当前开发基线code_board为目标分支;工作流本身覆盖所有 PR。Real AI Tests手动工作流。/codex fix仅同仓库写权限用户可触发,经过保护路径、20 文件和 200 KB 补丁限制,由独立 job 推送并重触发检查。scripts/ci/check_test_results.py强制校验:报告缺失、无 case、failure、error 或 skip 都失败。Actions 实测结果
最新提交
7cf5544的 PR Checks run #40423782933 全绿:backend: 883 tests,0 failure,0 error,0 skipped。agent: 679 tests,0 failure,0 error,0 skipped。frontend: 295 tests,0 failure,0 error,0 skipped;type-check、Oxlint、ESLint、Prettier、首屏预算和构建通过。integration: 4 tests(PostgreSQL 17 + Redis),0 failure,0 error,0 skipped。e2e: 1 core workflow passed;0 failure,0 error,0 skipped。merge-gate: success。修复过程中实际发现并处理了:Linux 反斜杠路径穿越、Windows junction 公开部署越界、JUnit 临时目录/venv 符号链接、跨平台 Git/shell 测试和 CI 无本地
.env时 OSS bean 无法启动。均未通过跳过或放宽安全断言处理。工程说明
eslint-suppressions.json的存量违规预算;新增违规仍会失败。external标签保留原真实数据库/Docker/Windows 原生平台验收,显式运行,不参与默认门禁,也不记为通过。agent/live_tests/,只由手动 workflow 运行。需要人工配置
master与code_board已配置分支保护:必需状态merge-gate、严格 up-to-date、禁止 force push/删除、管理员同样受约束。OPENAI_API_KEY且变量CODEX_REVIEW_ENABLED=true;本仓库当前没有OPENAI_API_KEY,因此未做真实 Codex 调用,本次 PR 不产生 AI Review 费用。/codex fix同样依赖该 secret。Real AI Tests需要在real-aienvironment 配置AGENT_MODEL_API_KEY(可选 base URL / model ID)。验证边界
Codex Review/Fix 与真实模型调用未执行(缺 secret)。MySQL Testcontainers 未添加:当前项目迁移、方言和连接配置均为 PostgreSQL,额外起 MySQL 只会产生与实际链路无关的假集成覆盖。