diff --git a/.gitea/workflows/ci-cd.yml b/.gitea/workflows/ci-cd.yml index 2ff4dc612..b15782ed6 100644 --- a/.gitea/workflows/ci-cd.yml +++ b/.gitea/workflows/ci-cd.yml @@ -15,8 +15,8 @@ on: - develop jobs: - code-quality: - name: Code Quality Check + validate: + name: Validate Code Quality And Tests runs-on: ubuntu-latest container: catthehacker/ubuntu:act-latest @@ -26,57 +26,33 @@ jobs: git clone --depth=1 --branch=${GITHUB_REF_NAME} https://api.xiaoxiajianji.com/git/${GITHUB_REPOSITORY}.git . git checkout ${GITHUB_SHA} - - name: Prepare quality environment + - name: Prepare environment run: | python3 --version python3 -m venv .venv . .venv/bin/activate python -m pip install --index-url https://pypi.org/simple --upgrade pip python -m pip install --index-url https://pypi.org/simple -r requirements-quality.txt + python -m pip install --index-url https://pypi.org/simple -r requirements-dev.txt - - name: Run checks + - name: Run code quality checks run: | . .venv/bin/activate python -m black --version python -m isort --version-number python -m flake8 --version python -m mypy --version - python -m bandit --version + bandit --version echo "✅ Code quality environment is ready" - test: - name: Run Tests - runs-on: ubuntu-latest - container: catthehacker/ubuntu:act-latest - if: ${{ success() }} - - steps: - - name: Checkout code - run: | - git clone --depth=1 --branch=${GITHUB_REF_NAME} https://api.xiaoxiajianji.com/git/${GITHUB_REPOSITORY}.git . - git checkout ${GITHUB_SHA} - - - name: Prepare test environment - run: | - python3 --version - python3 -m venv .venv - . .venv/bin/activate - python -m pip install --index-url https://pypi.org/simple --upgrade pip - python -m pip install --index-url https://pypi.org/simple -r requirements-dev.txt - - name: Run tests run: | . .venv/bin/activate pytest --version echo "✅ Test environment is ready" - build-summary: - name: Build Summary - runs-on: ubuntu-latest - if: ${{ success() && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main') }} - - steps: - - name: Summary + - name: Build summary + if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main' run: | echo "✅ Build completed successfully!" echo "Branch: ${GITHUB_REF_NAME}" diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 2ff4dc612..b15782ed6 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -15,8 +15,8 @@ on: - develop jobs: - code-quality: - name: Code Quality Check + validate: + name: Validate Code Quality And Tests runs-on: ubuntu-latest container: catthehacker/ubuntu:act-latest @@ -26,57 +26,33 @@ jobs: git clone --depth=1 --branch=${GITHUB_REF_NAME} https://api.xiaoxiajianji.com/git/${GITHUB_REPOSITORY}.git . git checkout ${GITHUB_SHA} - - name: Prepare quality environment + - name: Prepare environment run: | python3 --version python3 -m venv .venv . .venv/bin/activate python -m pip install --index-url https://pypi.org/simple --upgrade pip python -m pip install --index-url https://pypi.org/simple -r requirements-quality.txt + python -m pip install --index-url https://pypi.org/simple -r requirements-dev.txt - - name: Run checks + - name: Run code quality checks run: | . .venv/bin/activate python -m black --version python -m isort --version-number python -m flake8 --version python -m mypy --version - python -m bandit --version + bandit --version echo "✅ Code quality environment is ready" - test: - name: Run Tests - runs-on: ubuntu-latest - container: catthehacker/ubuntu:act-latest - if: ${{ success() }} - - steps: - - name: Checkout code - run: | - git clone --depth=1 --branch=${GITHUB_REF_NAME} https://api.xiaoxiajianji.com/git/${GITHUB_REPOSITORY}.git . - git checkout ${GITHUB_SHA} - - - name: Prepare test environment - run: | - python3 --version - python3 -m venv .venv - . .venv/bin/activate - python -m pip install --index-url https://pypi.org/simple --upgrade pip - python -m pip install --index-url https://pypi.org/simple -r requirements-dev.txt - - name: Run tests run: | . .venv/bin/activate pytest --version echo "✅ Test environment is ready" - build-summary: - name: Build Summary - runs-on: ubuntu-latest - if: ${{ success() && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main') }} - - steps: - - name: Summary + - name: Build summary + if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main' run: | echo "✅ Build completed successfully!" echo "Branch: ${GITHUB_REF_NAME}" diff --git a/docs/PHASE7-PROGRESS.md b/docs/PHASE7-PROGRESS.md index 3d6c05908..4e56cfb23 100644 --- a/docs/PHASE7-PROGRESS.md +++ b/docs/PHASE7-PROGRESS.md @@ -2,7 +2,7 @@ **Phase**: Phase 7 - 核心视频剪辑业务 **状态**: 🔄 进行中 -**最后更新**: 2026-06-19 06:49 GMT+8 +**最后更新**: 2026-06-19 07:18 GMT+8 --- @@ -129,8 +129,9 @@ - [x] 已完成 `#239` 失败链路复盘与第一轮根因确认 - [x] 已完成质量检查依赖与测试依赖拆分收敛 - [x] 已确认 workflow 触发范围漏掉 `bugfix/**` -- [x] 已确认 `needs` 后续调度在当前 Gitea run 上存在异常 -- [ ] 推送兼容性修复并等待新一轮 CI 验证 +- [x] 已确认当前 Gitea 平台上的多 job/依赖编排不稳定 +- [x] 已确认 `Code Quality Check` 的直接失败根因是 `python -m bandit` 调用方式错误 +- [ ] 推送根因修复并等待新一轮 CI 验证 ### Step 5:全局质量审计与专项治理计划落档 - [x] 已完成一次面向整个 SaaS 仓库的全面质量审计 @@ -189,4 +190,4 @@ --- -**状态结论**:Phase 7 未跑偏,已暂停 Agent 实跑并切回主会话直开;当前素材前半主链已打通,生成链已进入最小可运行闭环且结果查询/下载可用(预签名优先),输出路径结构与前端主链联调均已完成,前端构建链也已恢复可用。CI/CD 专项已确认三层根因:其一是 `Code Quality Check` 使用 `requirements-dev.txt` 拉起整套运行时/测试依赖,导致质量工具链安装链过重且不稳定;其二是 workflow 的 push 触发范围未覆盖 `bugfix/**`,导致专项分支提交根本未触发 CI;其三是当前 Gitea run 中 `needs` 后续 job 调度异常,导致 `Code Quality Check` 成功后 `Run Tests` 仍被阻塞。当前已转为更兼容的 job 触发写法,现进入新一轮 CI 验证阶段。 +**状态结论**:Phase 7 未跑偏,已暂停 Agent 实跑并切回主会话直开;当前素材前半主链已打通,生成链已进入最小可运行闭环且结果查询/下载可用(预签名优先),输出路径结构与前端主链联调均已完成,前端构建链也已恢复可用。CI/CD 专项已确认根因应落在平台与流程结构层,而不只是单个命令:其一是 `Code Quality Check` 使用 `requirements-dev.txt` 拉起整套运行时/测试依赖,导致质量工具链安装链过重且不稳定;其二是 workflow 的 push 触发范围未覆盖 `bugfix/**`,导致专项分支提交根本未触发 CI;其三是当前 Gitea 平台上的多 job/依赖编排不稳定,表现为依赖链下游 job 阻塞或并发行为异常;其四是质量检查步骤中将 `bandit` 误写为 `python -m bandit --version`,但 `bandit` 包本身并不提供该 `__main__` 入口,导致 job 在工具已安装的情况下仍直接失败。基于这些根因判断,当前已将 CI 收敛为单主验证 job,并把 `bandit` 调用修正为稳定的 console-script 入口,现进入新一轮 CI 验证阶段。