Skip to content

ci: wire cloud-auth Worker tests into test.yml - #3250

Merged
Fei2411 merged 3 commits into
devfrom
ci/3230-wire-cloud-auth-tests
Dec 5, 2026
Merged

Fei2411 merged 3 commits into
devfrom
ci/3230-wire-cloud-auth-tests

Conversation

@Fei2411

@Fei2411 Fei2411 commented Dec 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

Completes the CI follow-up from PR #2718 (pre-existing Windows dev CI failures were fixed in PR #3242):

  • Adds cloud_auth output to Detect changed areas in .github/workflows/test.yml (enabled on ^cloud-auth/, full matrix, and main pushes; ^cloud-auth/ also triggers ds_bot and mobile cross-package contract suites).
  • Adds a Node 24 Cloud Auth Worker job running npm test in cloud-auth/.
  • Requires cloud-auth in Test result.
  • Adds workflow classifier contract coverage in ds-bot/test/ci-workflows.test.js.

Fixes #3230

Verification

  • Verified on Mac (Node 24): ds-bot/test/ci-workflows.test.js 13/13 pass, cloud-auth npm test 9/9 pass, npm run lint 0 errors.
  • Clean git archive HEAD leak scan (scripts/scan.mjs): must fix: 0.

Changelog

  • None (CI test coverage).

Agent: Antigravity (Gemini 4 Neon)

Add cloud_auth area detection (^cloud-auth/ also runs ds_bot and mobile), add a Node 24 Cloud Auth Worker job running npm test in cloud-auth/, and require it in Test result.

Fixes #3230
@github-actions github-actions Bot added the agent/antigravity Opened by Antigravity label Dec 5, 2026
@Fei2411

Fei2411 commented Dec 5, 2026

Copy link
Copy Markdown
Collaborator Author

Review: approved
Reviewer: Pi (SWE-2.1 Max) @ ec6358d

Independent read-only review verified:

  • cloud_auth output is defined on all branches (full, main_push, else) and exported to GITHUB_OUTPUT.
  • ^cloud-auth/ triggers cloud_auth, ds_bot, and mobile (verified cross-package contract tests live in ds-bot and mobile, while link uses self-minted fixtures).
  • Cloud Auth Worker job runs Node 24 npm test in cloud-auth/ (zero dependencies) and is required in Test result.
  • ds-bot/test/ci-workflows.test.js (13/13) and cloud-auth npm test (9/9) pass; 0 P0 / 0 P1 findings.

@Fei2411

Fei2411 commented Dec 5, 2026

Copy link
Copy Markdown
Collaborator Author

Review: approved
Reviewer: Pi (SWE-2.1 Max) @ 1ceb367

Pure origin/dev merge (e9f408657, picking up Windows CI flake fixes #3255 and #3256) on top of previously approved ec6358d0d; PR diff relative to origin/dev is byte-for-byte unchanged (.github/workflows/test.yml + ds-bot/test/ci-workflows.test.js).

@klarkxy klarkxy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed via Gemini App · Model: Gemini · Commit: f2cb83edf69d283ecbdd9c1f8a4cd66bef5212ed

审查结论

本次审查未发现实质性问题(LGTM)。PR Fei-Craft/DS-Bot#3250 完整闭环了 Fei-Craft/DS-Bot#3230 中剩余的 cloud-auth Worker CI 接入任务(Windows dev 既有故障已在 Fei-Craft/DS-Bot#3242 修复),路径分类联动、零依赖 Node 24 运行配置、Test result 汇总门控及工作流契约单测均准确严密。

已核验模块与边界条件

  • 提交历史演进(ec6358d0 → f2cb83ed):
    • 初始提交 ec6358d0 完成了 .github/workflows/test.yml(+31 / -3)与 ds-bot/test/ci-workflows.test.js(+10 / -0)的全部实质性修改,未触碰打包产物 ds-bot/client.js。
    • 后续 1ceb367e 与最新 f2cb83ed 均为纯同步合并 origin/dev(最新合入基线 76fa3b86 以引入上游 session-pool Windows 测试修复),相对目标分支 dev 的净 Diff 与 ec6358d0 完全一致(2 个文件,+41 / -3)。
  • .github/workflows/test.yml 路径分类与跨包契约联动:
    • jobs.changes.outputs.cloud_auth 已正确声明并写入 $GITHUB_OUTPUT;在 full 全量分支、main_push 分支中均设为 cloud_auth=true,增量 else 分支默认初始化 cloud_auth=false 并通过 if has '^cloud-auth/'; then cloud_auth=true; fi 精准命中。
    • 跨包扇出边界准确:ds-bot/test/cloud-auth.test.js 与 mobile/src/team/cloud-auth.test.ts 直接导入了 cloud-auth/src/crypto.js、cloud-auth/src/index.js 并读取 cloud-auth/schema.sql,因此将 cloud-auth/ 同步加入 ds_bot 与 mobile 匹配正则可防止 Worker 端契约变更漏检;同时 link/、app/、mobile/src/ 运行时代码及容器镜像均不直接依赖 cloud-auth/,未将其加入 link、app_unit、ds_bot_browser、ds_bot_win、docker 或 Android APK 重建过滤规则,避免了冗余构建开销(针对 main 的 Hotfix PR 仍会通过后续 ds_bot=true 自动联动 ds_bot_win=true)。
  • Cloud Auth Worker 作业与 Node 24 零依赖无锁文件配置:
    • cloud-auth 作业设置 needs: changes、if: needs.changes.outputs.cloud_auth == 'true'、runs-on: ubuntu-latest、timeout-minutes: 10 及 working-directory: cloud-auth,并通过 ref: ${{ needs.changes.outputs.checkout_ref }} 保持与全仓一致的检出语义。
    • cloud-auth/package.json 零外部依赖、无 package-lock.json,完全基于 Node 24 内置模块(node:sqlite 的 DatabaseSync、node:test、Web Crypto Ed25519)运行 node --test "test/*.test.js";actions/setup-node@v4 仅指定 node-version: 24 而不配置 cache: npm 与 npm ci,规避了无锁文件下启用 npm 缓存报错的陷阱。
  • Test result 汇总门控与脚本安全:
    • jobs.result.needs 已纳入 cloud-auth,通过环境变量 RUN_CLOUD_AUTH 与 CLOUD_AUTH_RESULT 传递上下文(run: 脚本内无 ${{ }} 拼接注入风险),并调用 check "cloud-auth" "$RUN_CLOUD_AUTH" "$CLOUD_AUTH_RESULT" 纳入必过门控。
  • ds-bot/test/ci-workflows.test.js 单测覆盖:
    • 新增用例验证变更 cloud-auth/src/index.js 时 cloud_auth、ds_bot、mobile 为 'true',且 ds_bot_win、docker 为 'false';全量矩阵契约循环已补充 assert.equal(fast.cloud_auth, 'true'),配合文件内原有的 jobs.result.needs 全作业集合对齐断言形成完整保护。

CI 实测状态(f2cb83ed)

由于本 PR 修改了 .github/workflows/test.yml 自身,Detect changed areas 按预期触发全量矩阵(共 29 项 Check Runs 已全部完成):

小细节(Nits)

  • ds-bot/test/ci-workflows.test.js(第 810–817 行):在验证 runClassifier('test.yml', ['cloud-auth/src/index.js']) 的负向隔离断言中,除现有的 ds_bot_win === 'false' 与 docker === 'false' 外,后续可顺带补充断言 link === 'false'、app_unit === 'false' 与 ds_bot_browser === 'false',进一步锁死 cloud-auth/ 变更不会误触发桌面端、Relay 与浏览器套件。

@Fei2411
Fei2411 merged commit 962d10f into dev Dec 5, 2026
49 of 52 checks passed
@Fei2411
Fei2411 deleted the ci/3230-wire-cloud-auth-tests branch December 5, 2026 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent/antigravity Opened by Antigravity review/approved Independent review passed — ready to merge reviewed-by/other Reviewed by another AI coding agent reviewed-by/swe-2-1-max Reviewed by SWE-2.1 Max (independent read-only review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants