-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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: cache templates data #33439
chore: cache templates data #33439
Conversation
WalkthroughThe recent updates introduce caching mechanisms for application templates and data within the Appsmith server. Key additions include new data transfer objects (DTOs) for caching, a helper class for cache management, and modifications to the application template service to utilize the new caching functionalities. Additionally, test cases were added to ensure the accuracy and reliability of the caching system. Changes
Sequence Diagram(s) (Beta)sequenceDiagram
participant Client
participant ApplicationTemplateServiceCEImpl
participant CacheableTemplateHelper
participant Cache
participant Server
Client->>ApplicationTemplateServiceCEImpl: Request template details
ApplicationTemplateServiceCEImpl->>CacheableTemplateHelper: getTemplateDetails(templateId, baseUrl)
CacheableTemplateHelper->>Cache: Check cache for templateId
alt Cache hit
Cache-->>CacheableTemplateHelper: Return cached template
else Cache miss
CacheableTemplateHelper->>Server: Fetch template details from server
Server-->>CacheableTemplateHelper: Return template details
CacheableTemplateHelper->>Cache: Store template details in cache
end
CacheableTemplateHelper-->>ApplicationTemplateServiceCEImpl: Return template details
ApplicationTemplateServiceCEImpl-->>Client: Return template details
Poem
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configration File (
|
/build-deploy-preview skip-tests=true |
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/9080612987. |
Deploy-Preview-URL: https://ce-33439.dp.appsmith.com |
/build-deploy-preview skip-tests=true |
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/9083537520. |
Deploy-Preview-URL: https://ce-33439.dp.appsmith.com |
...erver/appsmith-server/src/main/java/com/appsmith/server/helpers/CacheableTemplateHelper.java
Outdated
Show resolved
Hide resolved
…o perf/block-drag-and-drop
...erver/appsmith-server/src/main/java/com/appsmith/server/helpers/CacheableTemplateHelper.java
Outdated
Show resolved
Hide resolved
...erver/appsmith-server/src/main/java/com/appsmith/server/helpers/CacheableTemplateHelper.java
Outdated
Show resolved
Hide resolved
...h-server/src/main/java/com/appsmith/server/services/ce/ApplicationTemplateServiceCEImpl.java
Outdated
Show resolved
Hide resolved
...h-server/src/main/java/com/appsmith/server/services/ce/ApplicationTemplateServiceCEImpl.java
Outdated
Show resolved
Hide resolved
...h-server/src/main/java/com/appsmith/server/services/ce/ApplicationTemplateServiceCEImpl.java
Outdated
Show resolved
Hide resolved
…o perf/block-drag-and-drop
/build-deploy-preview skip-tests=true |
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/9212140934. |
...r/src/test/java/com/appsmith/server/helpers/CacheableTemplateHelperTemplateJsonDataTest.java
Outdated
Show resolved
Hide resolved
...r/src/test/java/com/appsmith/server/helpers/CacheableTemplateHelperTemplateMetadataTest.java
Show resolved
Hide resolved
Failed server tests
|
@AnaghHegde Please resolve the failing tests here. Apart from that, the code LGTM. |
…o perf/block-drag-and-drop
There was a problem hiding this 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
Files selected for processing (1)
- app/server/appsmith-server/src/main/java/com/appsmith/server/exceptions/AppsmithError.java (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- app/server/appsmith-server/src/main/java/com/appsmith/server/exceptions/AppsmithError.java
There was a problem hiding this 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
Files selected for processing (1)
- app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/CacheableTemplateHelper.java (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/CacheableTemplateHelper.java
Tests have been added. Review is complete.
Description
Cache the templates data to improve the turn around time
Fixes #33440
Automation
/ok-to-test tags="@tag.Templates"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/9368135903
Commit: 5cbcbd3
Cypress dashboard url: Click here!
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
Bug Fixes
Tests