Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Remove unused ACL fields on User entity #34634

Merged
merged 2 commits into from
Jul 4, 2024

Conversation

sharat87
Copy link
Member

@sharat87 sharat87 commented Jul 2, 2024

/test sanity

Summary by CodeRabbit

  • Refactor
    • Simplified user data structure by removing unused groupIds and permissions fields, improving efficiency in user-group relationships and permissions handling.

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/9759459682
Commit: 9d42126
Cypress dashboard.
Tags: @tag.Sanity

@sharat87 sharat87 marked this pull request as draft July 2, 2024 09:32
Copy link
Contributor

coderabbitai bot commented Jul 2, 2024

Walkthrough

The changes remove the groupIds and permissions fields from the User class and modify the UsagePulseServiceCEImpl to stop updating user policies and permissions. This impacts how users are associated with groups and how permissions are managed, indicating a shift towards a different approach for handling user permissions and group memberships.

Changes

File Path Change Summary
.../appsmith-server/.../User.java Removed groupIds and permissions fields from User class, affecting user-group relationships and permission assignments.
.../appsmith-server/.../UsagePulseServiceCEImpl.java Removed the code updating policies and permissions for a user in createPulse method.

Poem

In the land where code does thrive,
Permissions took a dive.
Group IDs bid their last goodbye,
Simplifying reach, oh so high.
Pulse of usage, pure and bright,
No more tangled in the night.
Code and users, now light as air,
A rabbit's joy for all to share! 🐇


Tip

Early access features: enabled

We are currently testing the following features in early access:

  • OpenAI gpt-4o model for code reviews and chat: OpenAI claims that this model is better at understanding and generating code than the previous models. We seek your feedback over the next few weeks before making it generally available.

Note:

  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.
  • Please join our Discord Community to provide feedback and report issues.
  • OSS projects are currently opted into early access features by default.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Jul 2, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b58b1c4 and 3f80e8d.

Files selected for processing (2)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/domains/User.java (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/UsagePulseServiceCEImpl.java (1 hunks)
Additional comments not posted (2)
app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/UsagePulseServiceCEImpl.java (1)

95-95: Verify the impact of removing updateUser.setPolicies(null)

The removal of setting user policies to null might have implications on the user policy management. Ensure that this change does not lead to unintended side effects.

Verification successful

Verify indirect references or dependencies related to setting user policies to null

The removal of updateUser.setPolicies(null) appears to have no direct impact. However, ensure there are no indirect references or dependencies within UsagePulseServiceCEImpl or related classes that might be affected.


Verification successful: No unintended side effects from the removal of updateUser.setPolicies(null)

The removal of updateUser.setPolicies(null) in the UsagePulseServiceCEImpl class does not introduce any unintended side effects or impact the functionality.

  • The only occurrence of updateUser.setPolicies was in the line that was removed.
  • No other references to policies were found within the class.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the impact of removing `updateUser.setPolicies(null)` in `UsagePulseServiceCEImpl`.

# Test: Search for the usage of `updateUser.setPolicies` to ensure no unintended side effects.
rg --type java $'updateUser.setPolicies'

Length of output: 183



Script:

#!/bin/bash
# Description: Verify indirect references or dependencies related to setting user policies to null.

# Test 1: Search for all methods in the `UsagePulseServiceCEImpl` class to identify potential dependencies.
ast-grep --lang java --pattern $'class UsagePulseServiceCEImpl {
  $$$
}' > methods_in_UsagePulseServiceCEImpl.txt

# Test 2: Search for any method calls or references to user policies within the `UsagePulseServiceCEImpl` class.
rg --type java 'policies' app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/UsagePulseServiceCEImpl.java

Length of output: 241

app/server/appsmith-server/src/main/java/com/appsmith/server/domains/User.java (1)

Line range hint 1-1: Verify the impact of removing groupIds and permissions fields

The removal of the groupIds and permissions fields might have implications on user-group relationships and individual permissions management. Ensure that this change does not lead to unintended side effects.

Verification successful

Verification complete: No issues found with the removal of groupIds and permissions fields

The search results indicate that the permissions field is not used within the User class, and groupIds is not referenced elsewhere in the codebase. Therefore, their removal does not introduce any unintended side effects.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the impact of removing `groupIds` and `permissions` fields in `User.java`.

# Test: Search for the usage of `groupIds` and `permissions` fields to ensure no unintended side effects.
rg --type java $'groupIds'
rg --type java $'permissions'

Length of output: 24186



Script:

#!/bin/bash
# Description: Verify the impact of removing `groupIds` and `permissions` fields in `User.java` by narrowing down the search.

# Search for the usage of `permissions` within the User class
ast-grep --lang java --pattern $'class User {
  $$$
  $_ permissions;
  $$$
}' 

# Verify if `groupIds` is referenced in any other context outside of the `User` class
rg --type java $'groupIds'

Length of output: 105

@sharat87 sharat87 added the ok-to-test Required label for CI label Jul 2, 2024
@sharat87 sharat87 marked this pull request as ready for review July 2, 2024 11:51
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 3f80e8d and 9d42126.

Files selected for processing (1)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/domains/User.java (2 hunks)

@sharat87 sharat87 merged commit 25324f9 into release Jul 4, 2024
46 checks passed
@sharat87 sharat87 deleted the chore/remove-unused-acl-fields branch July 4, 2024 09:19
Shivam-z pushed a commit to Shivam-z/appsmith that referenced this pull request Jul 10, 2024
/test sanity


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Refactor**
- Simplified user data structure by removing unused `groupIds` and
`permissions` fields, improving efficiency in user-group relationships
and permissions handling.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/9759459682>
> Commit: 9d42126
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9759459682&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity`
<!-- end of auto-generated comment: Cypress test results  -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Required label for CI skip-changelog Adding this label to a PR prevents it from being listed in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants