test: add missing control-plane integration cases - #9
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 56 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughIntegration coverage now tests attestation submission failure responses and verifies that API-key-based attestation listings remain isolated between tenants. ChangesAttestation integration coverage
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Comment |
PR Summary by QodoAdd missing control-plane integration scenarios
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
15 rules 1. TypeScript attestation tests added
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@control-plane/src/__tests__/integration/tenant-isolation.test.ts`:
- Around line 151-157: Strengthen the assertions for dataUnfiltered in the
tenant-isolation test by narrowing the item type to expose its issuer or tenant
identity, then verify the returned item belongs to issuerA and does not belong
to issuerB. Keep the existing ok, total, and item-count assertions unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: e1c223e4-fd26-4740-ab46-6e13b445ca47
📒 Files selected for processing (2)
control-plane/src/__tests__/integration/attestation-flow.test.tscontrol-plane/src/__tests__/integration/tenant-isolation.test.ts
Co-authored-by: Cursor <cursoragent@cursor.com>
Adds missing Control-plane integration scenarios:
Local verification:
▶ Attestation Flow Integration
✔ full attestation lifecycle: submit then list (295.126995ms)
{"level":50,"time":1785246197816,"service":"verilink-control-plane","err":{"type":"AppError","message":"attestation already submitted (duplicate token)","stack":"AppError: attestation already submitted (duplicate token)\n at (/srv/storage/repo/VeriLink/control-plane/src/domains/attestation/attestationService.ts:190:15)\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n at async withTransaction (/srv/storage/repo/VeriLink/control-plane/src/db/transaction.ts:17:20)\n at async Module.submitAttestation (/srv/storage/repo/VeriLink/control-plane/src/domains/attestation/attestationService.ts:186:12)\n at async Object.handler (/srv/storage/repo/VeriLink/control-plane/src/routes/attestations.ts:19:17)\n at async (/srv/storage/repo/VeriLink/control-plane/src/shared/http/defineHandler.ts:61:7)","code":"CONFLICT","status":409,"name":"AppError"},"code":"CONFLICT","msg":"attestation already submitted (duplicate token)"}
✔ duplicate submission returns 409 (191.049635ms)
{"level":50,"time":1785246197978,"service":"verilink-control-plane","err":{"type":"AppError","message":"signature verification failed: no candidate key verified the token","stack":"AppError: signature verification failed: no candidate key verified the token\n at Module.submitAttestation (/srv/storage/repo/VeriLink/control-plane/src/domains/attestation/attestationService.ts:76:11)\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n at async Object.handler (/srv/storage/repo/VeriLink/control-plane/src/routes/attestations.ts:19:17)\n at async (/srv/storage/repo/VeriLink/control-plane/src/shared/http/defineHandler.ts:61:7)","code":"BAD_REQUEST","status":400,"name":"AppError"},"code":"BAD_REQUEST","msg":"signature verification failed: no candidate key verified the token"}
✔ invalid signature rejection returns 400 (160.012702ms)
{"level":50,"time":1785246198140,"service":"verilink-control-plane","err":{"type":"AppError","message":"unknown issuer: vrl:p:87bbbd5a-da3e-4809-acd7-03c06865f2c0","stack":"AppError: unknown issuer: vrl:p:87bbbd5a-da3e-4809-acd7-03c06865f2c0\n at Module.submitAttestation (/srv/storage/repo/VeriLink/control-plane/src/domains/attestation/attestationService.ts:45:11)\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n at async Object.handler (/srv/storage/repo/VeriLink/control-plane/src/routes/attestations.ts:19:17)\n at async (/srv/storage/repo/VeriLink/control-plane/src/shared/http/defineHandler.ts:61:7)","code":"BAD_REQUEST","status":400,"name":"AppError"},"code":"BAD_REQUEST","msg":"unknown issuer: vrl:p:87bbbd5a-da3e-4809-acd7-03c06865f2c0"}
✔ unknown issuer rejection returns 400 (161.202703ms)
{"level":50,"time":1785246198296,"service":"verilink-control-plane","err":{"type":"AppError","message":"schema validation failed: Unknown attestation type: not_a_real_type","stack":"AppError: schema validation failed: Unknown attestation type: not_a_real_type\n at Module.submitAttestation (/srv/storage/repo/VeriLink/control-plane/src/domains/attestation/attestationService.ts:121:13)\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n at async Object.handler (/srv/storage/repo/VeriLink/control-plane/src/routes/attestations.ts:19:17)\n at async (/srv/storage/repo/VeriLink/control-plane/src/shared/http/defineHandler.ts:61:7)","code":"BAD_REQUEST","status":400,"name":"AppError"},"code":"BAD_REQUEST","msg":"schema validation failed: Unknown attestation type: not_a_real_type"}
✔ schema violation rejection returns 400 (156.365381ms)
{"level":50,"time":1785246198442,"service":"verilink-control-plane","err":{"type":"AppError","message":"Missing authentication","stack":"AppError: Missing authentication\n at authMiddleware (/srv/storage/repo/VeriLink/control-plane/src/middleware/auth.ts:55:10)\n at Layer.handle [as handle_request] (/srv/storage/repo/VeriLink/control-plane/node_modules/express/lib/router/layer.js:95:5)\n at trim_prefix (/srv/storage/repo/VeriLink/control-plane/node_modules/express/lib/router/index.js:328:13)\n at /srv/storage/repo/VeriLink/control-plane/node_modules/express/lib/router/index.js:286:9\n at router.process_params (/srv/storage/repo/VeriLink/control-plane/node_modules/express/lib/router/index.js:346:12)\n at next (/srv/storage/repo/VeriLink/control-plane/node_modules/express/lib/router/index.js:280:10)\n at router.handle (/srv/storage/repo/VeriLink/control-plane/node_modules/express/lib/router/index.js:175:3)\n at router (/srv/storage/repo/VeriLink/control-plane/node_modules/express/lib/router/index.js:47:12)\n at Layer.handle [as handle_request] (/srv/storage/repo/VeriLink/control-plane/node_modules/express/lib/router/layer.js:95:5)\n at trim_prefix (/srv/storage/repo/VeriLink/control-plane/node_modules/express/lib/router/index.js:328:13)","code":"UNAUTHORIZED","status":401,"name":"AppError"},"code":"UNAUTHORIZED","msg":"Missing authentication"}
✔ unauthorized request returns 401 (146.175777ms)
{"level":50,"time":1785246198599,"service":"verilink-control-plane","err":{"type":"AppError","message":"Missing required scope: attest:write","stack":"AppError: Missing required scope: attest:write\n at (/srv/storage/repo/VeriLink/control-plane/src/middleware/requireScope.ts:13:21)\n at Layer.handle [as handle_request] (/srv/storage/repo/VeriLink/control-plane/node_modules/express/lib/router/layer.js:95:5)\n at next (/srv/storage/repo/VeriLink/control-plane/node_modules/express/lib/router/route.js:149:13)\n at Route.dispatch (/srv/storage/repo/VeriLink/control-plane/node_modules/express/lib/router/route.js:119:3)\n at Layer.handle [as handle_request] (/srv/storage/repo/VeriLink/control-plane/node_modules/express/lib/router/layer.js:95:5)\n at /srv/storage/repo/VeriLink/control-plane/node_modules/express/lib/router/index.js:284:15\n at router.process_params (/srv/storage/repo/VeriLink/control-plane/node_modules/express/lib/router/index.js:346:12)\n at next (/srv/storage/repo/VeriLink/control-plane/node_modules/express/lib/router/index.js:280:10)\n at authenticateApiKey (/srv/storage/repo/VeriLink/control-plane/src/middleware/auth.ts:96:3)\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)","code":"FORBIDDEN","status":403,"name":"AppError"},"code":"FORBIDDEN","msg":"Missing required scope: attest:write"}
✔ insufficient scope returns 403 (161.398423ms)
✔ Attestation Flow Integration (1639.5218ms)
▶ Tenant Isolation Integration
✔ cross-tenant visibility: tenant B does not see tenant A participants attestations (297.623756ms)
✔ api-key tenant binding: tenant A cannot see tenant B attestations (210.920723ms)
✔ Tenant Isolation Integration (839.476248ms)
ℹ tests 9
ℹ suites 2
ℹ pass 9
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 3064.128156 (Postgres on 127.0.0.1:15432).
Summary by CodeRabbit