8 Commits

Author SHA1 Message Date
wangdl
afb90d690b fix: Gate E2E — @Global() ReflectorModule 提供跨模块 Reflector
Some checks failed
Deploy API Server / build-and-unit (push) Successful in 34s
Deploy API Server / current-integration (push) Successful in 30s
Deploy API Server / backward-compat (push) Successful in 0s
Deploy API Server / m-ai-03-synthetic-e2e (push) Failing after 12s
Deploy API Server / deploy (push) Has been skipped
AppConfigModule 注册 AdminAuthGuard 需要 Reflector。
@Global() 装饰让 Reflector 对子模块可见——这是 NestJS 正确做法。

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-21 11:48:27 +08:00
wangdl
c4d3b8342d fix: Gate E2E — Test.createTestingModule + DiscoveryModule
Some checks failed
Deploy API Server / build-and-unit (push) Successful in 33s
Deploy API Server / current-integration (push) Successful in 30s
Deploy API Server / backward-compat (push) Successful in 0s
Deploy API Server / m-ai-03-synthetic-e2e (push) Failing after 9s
Deploy API Server / deploy (push) Has been skipped
DiscoveryModule 来自 @nestjs/core,提供 ModulesContainer 和 Reflector。
解决了 AdminAuthGuard 和 DiscoveryService 的依赖解析问题。

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-21 11:46:16 +08:00
wangdl
817b17bf9e fix: Gate E2E — NestFactory.create 替代 Test.createTestingModule
Some checks failed
Deploy API Server / build-and-unit (push) Successful in 34s
Deploy API Server / current-integration (push) Successful in 30s
Deploy API Server / backward-compat (push) Successful in 1s
Deploy API Server / m-ai-03-synthetic-e2e (push) Failing after 11s
Deploy API Server / deploy (push) Has been skipped
Test.createTestingModule 不提供全局 Reflector 给子模块 AppConfigModule,
导致 AdminAuthGuard 依赖解析失败。
NestFactory.create 正确初始化所有 @nestjs/core 全局 providers。

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-21 11:43:53 +08:00
wangdl
06e58f2ebe fix: Gate E2E — override AdminAuthGuard with mock to resolve Reflector dependency
Some checks failed
Deploy API Server / build-and-unit (push) Successful in 34s
Deploy API Server / current-integration (push) Successful in 30s
Deploy API Server / backward-compat (push) Successful in 0s
Deploy API Server / m-ai-03-synthetic-e2e (push) Failing after 10s
Deploy API Server / deploy (push) Has been skipped
Test.createTestingModule 不会将 Reflector 传播到子模块 AppConfigModule。
用 overrideGuard(MockAdminAuthGuard) 绕过 AdminAuthGuard 的 Reflector 依赖。

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-21 11:40:06 +08:00
wangdl
2f5989be49 fix: Gate E2E — Test.createTestingModule 缺少 Reflector provider
Some checks failed
Deploy API Server / build-and-unit (push) Successful in 34s
Deploy API Server / current-integration (push) Successful in 30s
Deploy API Server / backward-compat (push) Successful in 1s
Deploy API Server / m-ai-03-synthetic-e2e (push) Failing after 11s
Deploy API Server / deploy (push) Has been skipped
AdminAuthGuard 依赖 Reflector(@nestjs/core),TestingModule 不会自动导入。

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-21 11:37:41 +08:00
wangdl
dfbf91382b fix: Gate E2E 移除 TCP 端口探测,改用 AppModule 初始化验证 infra
Some checks failed
Deploy API Server / build-and-unit (push) Successful in 34s
Deploy API Server / current-integration (push) Successful in 30s
Deploy API Server / backward-compat (push) Successful in 0s
Deploy API Server / m-ai-03-synthetic-e2e (push) Failing after 10s
Deploy API Server / deploy (push) Has been skipped
- 移除 net.Socket TCP 探测(密码中特殊字符导致解析失败)
- AppModule.init() → PrismaModule/RedisModule 连接 → 失败自然抛错
- assertGateEnv() 仅检查环境变量(REQUIRE_REAL_INFRA/NODE_ENV/AI_JOB_SYNTHETIC_ENABLED)
- 前一步 prisma migrate deploy 已验证 MySQL 可达

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-21 11:25:21 +08:00
wangdl
d936bf5ce3 fix: Gate E2E URL 解析 — 区分 user:pass@host:port 和 host:port
Some checks failed
Deploy API Server / build-and-unit (push) Successful in 34s
Deploy API Server / current-integration (push) Successful in 29s
Deploy API Server / backward-compat (push) Successful in 0s
Deploy API Server / m-ai-03-synthetic-e2e (push) Failing after 10s
Deploy API Server / deploy (push) Has been skipped
正则修正:
- @([^:@]+):(\d+) — 匹配 @host:port(跳过 user:pass)
- :\/\/([^:@]+):(\d+) — 兜底无认证的 host:port

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-21 11:22:34 +08:00
wangdl
89ae30d46f feat: M-AI-03 Gate E2E fail-closed + CI health checks
Some checks failed
Deploy API Server / build-and-unit (push) Successful in 33s
Deploy API Server / current-integration (push) Successful in 29s
Deploy API Server / backward-compat (push) Successful in 17s
Deploy API Server / m-ai-03-synthetic-e2e (push) Failing after 1m6s
Deploy API Server / deploy (push) Has been skipped
- test/m-ai-03-gate.e2e-spec.ts: 6 fail-closed 核心测试
  场景 1: 完整链路 (creation→snapshot→outbox)
  场景 2: Admin Retry operationId 幂等
  场景 3: 事务回滚验证
  场景 4: Outbox 幂等
  场景 5: 生产环境保护
  场景 6: JWT 401
- REQUIRE_REAL_INFRA=true → beforeAll TCP 端口探测
  MySQL/Redis 不可达 → 测试失败(不 soft-pass)
- CI: 新增 MySQL/Redis health check(60s/30s timeout)
- jest-m-ai-03.json: 匹配 gate 和 synthetic 两种 E2E

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-21 11:15:59 +08:00