test: Add _Installation non-master access control regression tests#10578
test: Add _Installation non-master access control regression tests#10578mtrezza wants to merge 2 commits into
Conversation
|
🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review. Tip
Note Please respond to review comments from AI agents just like you would to comments from a human reviewer. Let the reviewer resolve their own comments, unless they have reviewed and accepted your commit, or agreed with your explanation for why the feedback was incorrect. Caution Pull requests must be written using an AI agent with human supervision. Pull requests written entirely by a human will likely be rejected, because of lower code quality, higher review effort and the higher risk of introducing bugs. Please note that AI review comments on this pull request alone do not satisfy this requirement. Our CI and AI review are safeguards, not development tools. If many issues are flagged, rethink your development approach. Invest more effort in planning and design rather than using review cycles to fix low-quality code. |
|
Important Review skippedNo new commits to review since the last review. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughAdded four tests verifying that unauthenticated and authenticated non-master clients receive forbidden errors for installation queries and deletion, with deletion confirmed not to remove the installation record. ChangesInstallation access control
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error)
✅ Passed checks (6 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
spec/ParseInstallation.spec.js (1)
1301-1375: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCoverage gap: no test for authenticated non-master delete.
The suite covers unauthenticated find, unauthenticated delete, and authenticated non-master find — but not authenticated non-master delete. Given the PR's goal is comprehensive non-master installation access-control regression coverage, consider adding a fourth test mirroring "blocks the find operation for an authenticated non-master user" but for the delete endpoint, following the same row-preservation check used in the unauthenticated delete test.
🤖 Prompt for 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. In `@spec/ParseInstallation.spec.js` around lines 1301 - 1375, Add a test in the access-control describe block covering DELETE on _Installation for an authenticated non-master user, mirroring the setup and session-token headers from “blocks the find operation for an authenticated non-master user.” Assert the request returns OPERATION_FORBIDDEN with “Permission denied,” then verify via a master-key query that the installation row remains present.
🤖 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 `@spec/ParseInstallation.spec.js`:
- Around line 1307-1325: Update the three rejection tests around the request
try/catch blocks so each fail('... should have been rejected') immediately
returns (or throws), preventing execution from dereferencing an undefined error
when the request unexpectedly succeeds.
---
Nitpick comments:
In `@spec/ParseInstallation.spec.js`:
- Around line 1301-1375: Add a test in the access-control describe block
covering DELETE on _Installation for an authenticated non-master user, mirroring
the setup and session-token headers from “blocks the find operation for an
authenticated non-master user.” Assert the request returns OPERATION_FORBIDDEN
with “Permission denied,” then verify via a master-key query that the
installation row remains present.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ea810e75-461c-4062-8d6e-5cd4ec24dbad
📒 Files selected for processing (1)
spec/ParseInstallation.spec.js
|
@coderabbitai review |
✅ Action performedReview finished.
|
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## alpha #10578 +/- ##
==========================================
- Coverage 92.68% 84.72% -7.96%
==========================================
Files 193 193
Lines 17025 17025
Branches 248 248
==========================================
- Hits 15779 14425 -1354
- Misses 1225 2579 +1354
Partials 21 21 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary by CodeRabbit