From 3bb70f2bf725fd84e9e7f1d259f4faec33bf57f5 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 18 Nov 2026 23:28:03 +0800 Subject: [PATCH] ci: release gate gets 75 minutes, a Chromium mirror with fallback, and the runner tool self-check (BUG-2000) Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_01DbBXoyn7Hj3LCW3BUs5bZ8 --- .gitea/workflows/release-quality-gate.yml | 31 +++++++++++++++++-- docs/BUG_HISTORY.md | 12 +++++++ .../tests/staging-backend-workflows.test.ts | 4 +++ 3 files changed, 45 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/release-quality-gate.yml b/.gitea/workflows/release-quality-gate.yml index 1feba6692..30b32b965 100644 --- a/.gitea/workflows/release-quality-gate.yml +++ b/.gitea/workflows/release-quality-gate.yml @@ -6,7 +6,8 @@ on: jobs: release-quality-gate: runs-on: xiaoxin - timeout-minutes: 45 + # BUG-2000 (owner 2026-11-18): a local dry run took about 21 minutes; the runner may be slower. + timeout-minutes: 75 env: GITEA_SHA: ${{ gitea.sha }} NODE_TOOL_SOURCE_IMAGE: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/library/node:22-bookworm-slim@sha256:ef343465b6a14bbdf2ab52f6e100ec0659a792464fcf72c462370d88b3df909c @@ -72,6 +73,29 @@ jobs: - name: Verify runner toolchain run: | set -euo pipefail + # BUG-2000: same install-what-is-missing check as the staging gate, so a runner that lost + # a tool since the last release does not fail the gate on environment alone. + packages=() + venv_probe="$(mktemp -d "${RUNNER_TEMP:-/tmp}/jyotisha-venv-probe.XXXXXX")" + if ! python3 -m venv "$venv_probe/venv" >/dev/null 2>&1; then + packages+=(python3-venv) + fi + rm -rf "$venv_probe" + if ! python3 -c 'import pathlib, sysconfig; assert pathlib.Path(sysconfig.get_path("include"), "Python.h").is_file()' >/dev/null 2>&1; then + packages+=(python3-dev) + fi + if ! command -v g++ >/dev/null 2>&1; then + packages+=(g++) + fi + if ! command -v rsync >/dev/null 2>&1; then + packages+=(rsync) + fi + if [ "${#packages[@]}" -gt 0 ]; then + apt-get -o Acquire::Retries=3 -o Acquire::http::Timeout=30 \ + -o Acquire::https::Timeout=30 update + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + "${packages[@]}" + fi python3 --version node --version npm --version @@ -95,7 +119,10 @@ jobs: "pandas==2.3.3" \ "timezonefinder==8.2.5" \ -r requirements.txt -r requirements-dev.txt playwright - python -m playwright install --with-deps chromium + # BUG-2000: try a domestic mirror for the Chromium download first, then the default host. + PLAYWRIGHT_DOWNLOAD_HOST=https://npmmirror.com/mirrors/playwright \ + python -m playwright install --with-deps chromium \ + || python -m playwright install --with-deps chromium npm ci --prefix frontend # BUG-1991 (owner 2026-11-18): the invite-only beta ships without operator details or # lawyer-reviewed legal text, so the #119 item 9 check no longer runs here. Run it by diff --git a/docs/BUG_HISTORY.md b/docs/BUG_HISTORY.md index c335d1c5b..80a461a5b 100644 --- a/docs/BUG_HISTORY.md +++ b/docs/BUG_HISTORY.md @@ -26895,3 +26895,15 @@ - 已知遗留:修复前保存的自选记录没有 `chosen_lines`,要在生时纠正里再保存一次选择、再重新生成报告,说明才会带出另一侧。多条线各选一侧时,说明里的「线前 / 线后」取最后一条线的选择,可能和第一条线的选择相反,未改。 - 关联记录:BUG-1958(自选情景)、BUG-1959(报告情景说明)、BUG-1971(自选流程重做)、BUG-1993(报告判断被扣)。 - 修复版本:`claude/report-scenario-1997`,未推送。 + +## BUG-2000 | 发布检查可能卡在环境上:时间上限偏紧、Chromium 下载没有镜像、没有工具自检 + +- 状态:fixed-pending-verify(待发布检查在 Gitea 上实跑)。 +- 首次发现 / 最近更新:2026-11-18 / 2026-11-18。 +- 触发与现象:本机按发布检查的安装清单完整预演 release 档,全部步骤约 21 分钟,代码本身通过;但发布检查只能在 main 快进后触发,上一次成功是 8 月,之后换过执行机器,三处环境风险无法提前验证。 +- 触发条件:从 main 手动运行发布检查。 +- 根因:上限 45 分钟是按旧机器定的;pip 和 npm 配了国内镜像而 Chromium 下载没有;测试环境检查里「缺什么装什么」的工具自检没有同步到发布检查。 +- 修复:产品负责人 2026-11-18 同意三处都改:上限调到 75 分钟;Chromium 先走国内镜像,失败再走默认源;工具自检补上 python3-venv、python3-dev、g++、rsync。检查内容不变。 +- 验证与防复发:`frontend/tests/staging-backend-workflows.test.ts` 钉住三处。镜像地址和执行机器上的实际表现要到发布当天才能验证,失败时回退到默认源。预演记录在仓库外的上线材料里。 +- 关联记录:BUG-1998、BUG-1991。 +- 修复版本:与 BUG-1998 同批。 diff --git a/frontend/tests/staging-backend-workflows.test.ts b/frontend/tests/staging-backend-workflows.test.ts index b072cc400..18315d0cd 100644 --- a/frontend/tests/staging-backend-workflows.test.ts +++ b/frontend/tests/staging-backend-workflows.test.ts @@ -1159,6 +1159,10 @@ test("manual release gate runs where Docker Compose v2 is available", () => { // 新值: 不再跑整棵 tests/;release 档之后只剩 tests/run_all.py // 原因: BUG-1998,产品负责人 2026-11-18:整棵测试树自 8 月发布后没跑过,积了大量与产品无关的研究、审计、外部探针测试,内测发布只跑每次推送都在跑的那一套 assert.doesNotMatch(workflow, /python -m pytest -q --maxfail=1/); + // BUG-2000(产品负责人 2026-11-18):上限 45 → 75 分钟;Chromium 先走国内镜像再走默认源;补上和 staging 检查相同的工具自检 + assert.match(workflow, /timeout-minutes: 75/); + assert.match(workflow, /PLAYWRIGHT_DOWNLOAD_HOST=https:\/\/npmmirror\.com\/mirrors\/playwright[\s\S]*?\|\| python -m playwright install --with-deps chromium/); + assert.match(workflow, /Verify runner toolchain[\s\S]*?packages\+=\(python3-venv\)[\s\S]*?packages\+=\(rsync\)[\s\S]*?apt-get install -y --no-install-recommends/); assert.match(workflow, /python scripts\/run_quality_gate\.py --profile release\n(?:\s+# [^\n]*\n)+\s+python tests\/run_all\.py/); for (const dependency of [ "mcp==1.28.1",