feat: add e2e test for insights access without insights.read permission#23948
Closed
eunjae-lee wants to merge 1 commit intomainfrom
Closed
feat: add e2e test for insights access without insights.read permission#23948eunjae-lee wants to merge 1 commit intomainfrom
eunjae-lee wants to merge 1 commit intomainfrom
Conversation
- Add helper functions for PBAC setup in e2e fixtures - Add test verifying users with custom roles lacking insights.read can access /insights - Test validates that PR #23945 correctly removes page-level permission checks - Fix existing lint violations in users.ts fixture file Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR adds an end-to-end test to validate the changes in PR #23945, which removed page-level permission checks for the
/insightspage. The test verifies that users with custom roles lacking theinsights.readpermission can still access the insights page without being redirected.Key changes:
insights.readpermission, and verifies they can access/insightsinclude: { AnyPropertyName: true }patterns with explicit select statementsHow should this be tested?
Environment setup:
showOptimizedSlotscolumn issues)Test execution:
Expected behavior:
insights.read) should successfully access/insightspage/or/event-typesMandatory Tasks (DO NOT REMOVE)
Critical Review Points
Test environment compatibility: Local testing failed due to database schema issues. Please verify the test runs successfully in CI.
Lint fixes scope: This PR includes fixes to existing lint violations in
users.tsthat change Prisma queries frominclude: { field: true }to explicit select statements. Please verify these changes don't break existing functionality.PBAC setup validation: The test creates a complex PBAC setup with organizations, custom roles, and feature flags. Please verify the setup correctly represents the intended test scenario.
Unused helper functions: The PR includes helper functions
createCustomRoleWithoutInsightsandenablePBACForTeamthat aren't used in the final test. Consider if these should be removed or if the test should use them.Requested by: @eunjae-lee
Devin session: https://app.devin.ai/sessions/a3a4948c7ffa4420b7dd312de455da2e