增加 CI 质量与安全合并门禁#106
Merged
Merged
Conversation
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.
问题
仓库没有 GitHub Actions,也没有可作为合并门禁的前端质量、安全审计和后端测试检查。完整 Python 运行依赖包含 CUDA、Torch、Whisper、VoxCPM 等重型组件,直接用于普通 CI 不可维护。
根因
修复方案
质量与安全门禁workflow,在 PR 与 main push 上运行两个稳定检查:前端质量与安全、后端测试。npm ci,依次运行 9 个测试、ESLint、TypeScript、生产构建,以及显式指向 npm 官方源的生产依赖 audit;high/critical 会使检查失败。backend/requirements-test.txt,完整运行 322 个测试,不跳过任何测试。pip check和重型依赖 guard。验证结果
.env/env.txt的临时 worktree + 全新 Python 3.12 venv:322 个后端测试通过,pip check与重型依赖 guard 通过。npm audit --omit=dev --audit-level=high --registry=https://registry.npmjs.org:退出码 0,无 high/critical;报告 2 个 Next 内嵌 PostCSS moderate。当前应用不接收、解析并内嵌用户 CSS,该公告要求的可控 CSS 输入链路不可达;不使用--force降级 Next。git diff --check:通过。后续门禁配置
本 PR 的两个检查首次成功后,将为 main 启用严格必需检查:
前端质量与安全后端测试并启用管理员同样受约束、禁止 force push 与删除。只有外部保护规则落地后,本项才视为完成。
明确后置
Python 版本锁定按 Goal 要求不在本分支实施。本项只提供经干净 CPU 环境验证的轻量直接依赖列表;constraints/lock、CPU/CUDA 矩阵和生产/开发依赖拆分将在单独中文 Issue 中跟踪。
审查
两路独立审查确认代码与 workflow 无 P0–P2 阻断项;未跟踪新文件风险已通过提交
dc0925d的暂存清单核对闭环。