Repository navigation
test(api): cover RI-exchange scope in-scope and lookup-error paths (follow-up to #379) - #389
Conversation
Follow-up to the executeExchange session-scope fix for issue #93: - Add TestExecuteExchange_SessionAccountScopeMatchReachesConstraintsCheck, the positive-path counterpart to the existing regression test: a session restricted to an allowed_accounts list that includes the deployment's own cloud account must clear the new scope gate and reach the pre-existing SEC-01/#1141 constraints check, proving the fix does not over-deny an in-scope request. - Add TestExecuteExchange_SessionScopeLookupErrorFailsClosed: a failure resolving the session's allowed_accounts must propagate as a plain error, not collapse into a 403 that misreports a lookup failure as an out-of-scope denial. - Document, in the existing regression test, why HasPermissionForConstraintsAPI is deliberately left unstubbed rather than stubbed-and-asserted-not-called. - Note reshapeCloudAccountInScope's doc comment now lists executeExchange (via requireReshapeAccountScope) among its callers. - Trim the requireReshapeAccountScope and resolveReshapeCloudAccountIDOrUnattributed doc comments to their essentials; the issue history and gocyclo rationale live in the PR description instead.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: LeanerCloud/cloud-commitments-platform/.coderabbit.yaml Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 4 reviews per hour. 📝 WalkthroughWalkthroughComments clarify the account-scope check and its callers. Tests verify that ChangesAccount Scope Checks
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Other Merge Risk: ⚪ Minimal · up to No actionable merge-blocking issue is identified; the change is ready for normal checks. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
Independent adversarial review + local verification: MERGE at 3a0c9a8. Tests and comments only (comment-stripped diff of the source is empty); merges cleanly onto main; the in-scope and lookup-error tests each killed their targeted mutants (restricted always out of scope; lookup error swallowed to 403; lookup error fails open); internal/api race suite 2224 passed. |
Summary
Follow-up to #379 (issue #93). This commit was pushed to the #379 branch after #379 had already merged, so it never landed. It addresses the review findings on #379:
reshapeCloudAccountInScopecomment and trims the new doc comments.Covers item 4 of #384. Behavior is unchanged; this is tests and comments only.
Verification
CI on this branch, plus the independent review of the diff before merge.
Summary by CodeRabbit