Skip to content

chore: Revert "feat: Moved Tenant Information to Redis for quick access"#33512

Merged
nidhi-nair merged 1 commit intoreleasefrom
revert-33309-feature/issue-33083/tenant-config-to-redis
May 16, 2024
Merged

chore: Revert "feat: Moved Tenant Information to Redis for quick access"#33512
nidhi-nair merged 1 commit intoreleasefrom
revert-33309-feature/issue-33083/tenant-config-to-redis

Conversation

@NilanshBansal
Copy link
Contributor

@NilanshBansal NilanshBansal requested a review from trishaanand May 16, 2024 05:57
@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 16, 2024

Walkthrough

Walkthrough

The recent changes primarily involve removing the implementation of the Serializable interface from several domain classes (Tenant, TenantConfiguration, TenantConfigurationCE). Additionally, methods related to caching tenants have been removed from the repository and service layers. The constructor and methods of TenantServiceImpl and TenantServiceCEImpl have been simplified by eliminating caching logic. Corresponding test cases in TenantServiceCETest have been updated to reflect these changes.

Changes

File Path Change Summary
.../domains/Tenant.java Removed implements Serializable from the Tenant class.
.../domains/TenantConfiguration.java Removed implements Serializable from the TenantConfiguration class.
.../domains/ce/TenantConfigurationCE.java Removed implements Serializable from the TenantConfigurationCE class.
.../repositories/ce/CacheableRepositoryHelperCE.java Removed fetchDefaultTenant and evictCachedTenant methods.
.../repositories/ce/CacheableRepositoryHelperCEImpl.java Removed fetchDefaultTenant and evictCachedTenant methods.
.../repositories/ce/TenantRepositoryCE.java Removed a deprecated method related to fetching the default tenant.
.../services/TenantServiceImpl.java Removed CacheableRepositoryHelper parameter from the constructor and updated the superclass constructor call.
.../services/ce/CacheableFeatureFlagHelperCEImpl.java Added a blank line after the class declaration.
.../services/ce/TenantServiceCEImpl.java Removed CacheableRepositoryHelper dependency, caching logic, and simplified tenant update methods.
.../services/ce/TenantServiceCETest.java Updated the cleanup() method to use repository methods for updating tenant configuration.

Recent Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 98dc16d and adcb201.
Files selected for processing (10)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/domains/Tenant.java (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/domains/TenantConfiguration.java (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/domains/ce/TenantConfigurationCE.java (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/CacheableRepositoryHelperCE.java (2 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/CacheableRepositoryHelperCEImpl.java (2 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/TenantRepositoryCE.java (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/services/TenantServiceImpl.java (2 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/CacheableFeatureFlagHelperCEImpl.java (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/TenantServiceCEImpl.java (8 hunks)
  • app/server/appsmith-server/src/test/java/com/appsmith/server/services/ce/TenantServiceCETest.java (1 hunks)
Files skipped from review due to trivial changes (5)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/domains/Tenant.java
  • app/server/appsmith-server/src/main/java/com/appsmith/server/domains/TenantConfiguration.java
  • app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/CacheableRepositoryHelperCE.java
  • app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/TenantRepositoryCE.java
  • app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/CacheableFeatureFlagHelperCEImpl.java
Additional comments not posted (16)
app/server/appsmith-server/src/main/java/com/appsmith/server/services/TenantServiceImpl.java (1)

22-23: Constructor update aligns with the removal of caching logic.

app/server/appsmith-server/src/main/java/com/appsmith/server/domains/ce/TenantConfigurationCE.java (2)

18-18: Removing Serializable simplifies the class.


Line range hint 50-78: The copyNonSensitiveValues method is well-implemented and aligns with the class's purpose.

app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/CacheableRepositoryHelperCEImpl.java (5)

Line range hint 22-47: The getPermissionGroupsOfUser method is well-implemented and aligns with the class's purpose.


Line range hint 49-61: The preFillAnonymousUserPermissionGroupIdsCache method is well-implemented and aligns with the class's purpose.


Line range hint 63-72: The getPermissionGroupsOfAnonymousUser method is well-implemented and aligns with the class's purpose.


Line range hint 74-76: The evictPermissionGroupsUser method is well-implemented and aligns with the class's purpose.


Line range hint 78-92: The getDefaultTenantId method is well-implemented and aligns with the class's purpose.

app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/TenantServiceCEImpl.java (7)

Line range hint 1-48: The class declaration is well-implemented and aligns with the class's purpose.


Line range hint 62-69: The getDefaultTenantId method is well-implemented and aligns with the class's purpose.


Line range hint 71-99: The updateTenantConfiguration method is well-implemented and aligns with the class's purpose.


154-163: The getDefaultTenant method is well-implemented and aligns with the class's purpose.


197-197: The save method is well-implemented and aligns with the class's purpose.


Line range hint 199-234: The checkAndExecuteMigrationsForTenantFeatureFlags method is well-implemented and aligns with the class's purpose.


Line range hint 256-276: The restartTenant method is well-implemented and aligns with the class's purpose.

app/server/appsmith-server/src/test/java/com/appsmith/server/services/ce/TenantServiceCETest.java (1)

92-96: Ensure the correctness of the updated cleanup logic.

The changes in the cleanup method look good. However, please verify that the new logic aligns with the intended behavior and that the Bridge.update() method is correctly updating the tenant configuration.

Verification successful

The changes in the cleanup method look good. The Bridge.update() method correctly creates an update operation, and the tenantRepository.updateAndReturn method properly applies it using mongoOperations.findAndModify.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the usage of `Bridge.update()` method in the codebase.

# Test: Search for the `Bridge.update()` method usage. Expect: Correct usage in the context of tenant configuration updates.
rg --type java $'Bridge.update()'

Length of output: 3345



Script:

#!/bin/bash
# Description: Retrieve the implementation of the `Bridge.update()` method.

# Search for the definition of the `Bridge.update()` method.
ast-grep --lang java --pattern 'class Bridge { $$$ update() { $$$ } $$$ }'

Length of output: 76


Script:

#!/bin/bash
# Description: Verify the implementation of the `tenantRepository.updateAndReturn` method.

# Search for the definition of the `updateAndReturn` method in the tenant repository.
ast-grep --lang java --pattern 'class $_ { $$$ updateAndReturn($_, $_, $_) { $$$ } $$$ }'

Length of output: 91



Script:

#!/bin/bash
# Description: Retrieve the implementation of the `Bridge.update()` method.

# Search for the definition of the `Bridge.update()` method using a more general pattern.
rg --type java 'Bridge.update()'

Length of output: 3345


Script:

#!/bin/bash
# Description: Verify the implementation of the `tenantRepository.updateAndReturn` method.

# Search for the definition of the `updateAndReturn` method in the tenant repository using a more general pattern.
rg --type java 'updateAndReturn'

Length of output: 756



Script:

#!/bin/bash
# Description: Locate the implementation of the `Bridge.update()` method.

# Search for the definition of the `Bridge` class to find the `update` method.
rg --type java 'class Bridge'

Length of output: 471


Script:

#!/bin/bash
# Description: Retrieve the implementation details of the `updateAndReturn` method in `BaseAppsmithRepositoryCEImpl`.

# Display the implementation of the `updateAndReturn` method in `BaseAppsmithRepositoryCEImpl`.
rg --type java -A 10 'public Mono<T> updateAndReturn' app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/BaseAppsmithRepositoryCEImpl.java

Length of output: 727



Script:

#!/bin/bash
# Description: Retrieve the full implementation of the `Bridge.update()` method.

# Display the implementation of the `update` method in the `Bridge` class.
rg --type java -A 10 'update()' app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/bridge/Bridge.java

Length of output: 436


Script:

#!/bin/bash
# Description: Retrieve the complete implementation of the `updateAndReturn` method in `BaseAppsmithRepositoryCEImpl`.

# Display the complete implementation of the `updateAndReturn` method in `BaseAppsmithRepositoryCEImpl`.
rg --type java -A 20 'public Mono<T> updateAndReturn' app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/BaseAppsmithRepositoryCEImpl.java

Length of output: 1124


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.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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.

@nidhi-nair nidhi-nair changed the title Revert "feat: Moved Tenant Information to Redis for quick access" chore: Revert "feat: Moved Tenant Information to Redis for quick access" May 16, 2024
@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label May 16, 2024
@nidhi-nair nidhi-nair merged commit 744e4ef into release May 16, 2024
@nidhi-nair nidhi-nair deleted the revert-33309-feature/issue-33083/tenant-config-to-redis branch May 16, 2024 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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