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 an extra eval cycle caused by the FETCH_FORM_CONFIG_SUCCESS action #37013

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

dvj1988
Copy link
Contributor

@dvj1988 dvj1988 commented Oct 22, 2024

Description

FETCH_FORM_CONFIG_SUCCESS is part of the EVAL trigger action list and is used to trigger evaluation in other entities such as templates, packages, and modules. This was part of the pre-consolidated API implementation, where fetching form configurations was a separate API call, and we needed to re-trigger the evaluation once the form configurations were fetched.

With the consolidated API now including form configurations, there is no longer a need to re-trigger evaluation upon the dispatch of the FETCH_FORM_CONFIG_SUCCESS action. This change ensures that FETCH_ALL_PAGE_ENTITY_COMPLETION is dispatched after the FETCH_FORM_CONFIG_SUCCESS action.

This update eliminates an unnecessary evaluation cycle during the initial page load.

Fixes #Issue Number
or
Fixes Issue URL

Warning

If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.

Automation

/ok-to-test tags="@tag.All"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/11473435022
Commit: 23ec501
Cypress dashboard.
Tags: @tag.All
Spec:


Wed, 23 Oct 2024 09:05:06 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Improved loading process for plugins and datasources, now integrated within the page themes and actions loading.
  • Bug Fixes

    • Enhanced initialization sequence for the editor setup, ensuring timely server reset after setup completion.

@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Oct 22, 2024
@dvj1988 dvj1988 added the ok-to-test Required label for CI label Oct 22, 2024
@dvj1988 dvj1988 requested a review from rajatagrawal October 22, 2024 15:20
@dvj1988
Copy link
Contributor Author

dvj1988 commented Oct 22, 2024

/build-deploy-preview skip-tests=true

Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/11463349254.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 37013.
recreate: .

@dvj1988 dvj1988 requested a review from vsvamsi1 October 22, 2024 15:27
Copy link

Deploy-Preview-URL: https://ce-37013.dp.appsmith.com

@dvj1988 dvj1988 added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Oct 23, 2024
@dvj1988 dvj1988 marked this pull request as ready for review October 23, 2024 09:21
Copy link
Contributor

coderabbitai bot commented Oct 23, 2024

Walkthrough

The changes in this pull request modify the AppEditorEngine class, specifically updating the loadAppEntities and loadPageThemesAndActions methods. The loadPluginsAndDatasources method is now integrated into loadPageThemesAndActions, altering the control flow. Additionally, the setupEngine method now includes a call to reset the Codemirror Tern service after the parent class's setup. These modifications streamline the loading process while maintaining existing error handling and method structures.

Changes

File Path Change Summary
app/client/src/entities/Engine/AppEditorEngine.ts - Updated loadAppEntities to remove call to loadPluginsAndDatasources.
- Updated loadPageThemesAndActions to include call to loadPluginsAndDatasources.
- Modified setupEngine to call CodemirrorTernService.resetServer() after parent setup.

Possibly related PRs

Suggested labels

Bug, Task, Medium

Suggested reviewers

  • vsvamsi1
  • sharat87

🎉 In the engine's heart, a change took flight,
Loading themes and plugins, all feels just right.
With a reset in place, the setup's refined,
A dance of methods, perfectly aligned.
So here's to the code, that flows like a stream,
In the world of engines, we’re living the dream! 🚀


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between a8da0e1 and 23ec501.

📒 Files selected for processing (1)
  • app/client/src/entities/Engine/AppEditorEngine.ts (1 hunks)
🧰 Additional context used
🔇 Additional comments (3)
app/client/src/entities/Engine/AppEditorEngine.ts (3)

195-201: LGTM: Improved initialization sequence

The consolidation of loadPluginsAndDatasources into this method aligns with the PR objective of removing the extra eval cycle. The sequence ensures all necessary data is loaded before dispatching fetchAllPageEntityCompletion.


Line range hint 279-289: LGTM: Simplified loadAppEntities

The method has been simplified to only handle page themes and actions loading, with plugin loading moved to a more appropriate location. This change reduces complexity and improves the initialization flow.


195-201: Verify the timing of loadPluginsAndDatasources call

The loadPluginsAndDatasources call has been moved here from loadAppEntities. This change appears to be related to removing the extra eval cycle, but we should verify that plugins and datasources are still loaded before any dependent operations.

✅ Verification successful

Let me gather more context about the dependencies and execution order by checking where these plugins and datasources are used.

The pattern will help us understand the execution flow and dependencies between page loading, plugins, and datasources to verify if the timing change could cause any issues.


Based on the code analysis, I can now provide a final response about the timing of the loadPluginsAndDatasources call.

The timing change for loadPluginsAndDatasources is safe

The move of loadPluginsAndDatasources to loadPageThemesAndActions is correct because:

  • The plugins and datasources are loaded before any page-specific actions are executed
  • The pluginFormConfigs are verified with a failFast check before proceeding
  • No direct dependencies on plugins/datasources exist in the page loading flow that would be impacted by this timing change
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for any dependencies on plugins/datasources that might be affected by this timing change
rg -A 3 "loadPluginsAndDatasources|FETCH_PLUGIN_FORM_CONFIGS_SUCCESS" --type ts

Length of output: 4546


Script:

#!/bin/bash
# Check for dependencies on plugins/datasources in the engine
ast-grep --pattern 'function* loadPage$$$($$$) {
  $$$
}'

# Check the loadPageThemesAndActions implementation
rg -B 5 -A 10 "loadPageThemesAndActions" --type ts

# Check for any direct dependencies on plugins/datasources
rg "pluginFormConfigs|mockDatasources" --type ts -B 2 -A 2

Length of output: 21777


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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

@dvj1988 dvj1988 merged commit 1702304 into release Oct 24, 2024
110 of 167 checks passed
@dvj1988 dvj1988 deleted the chore/move-plugin-form-fetch-app-engone branch October 24, 2024 11:06
@coderabbitai coderabbitai bot mentioned this pull request Oct 29, 2024
2 tasks
github-actions bot pushed a commit to Zeral-Zhang/appsmith that referenced this pull request Nov 20, 2024
…CESS action (appsmithorg#37013)

## Description
`FETCH_FORM_CONFIG_SUCCESS` is part of the EVAL trigger action list and
is used to trigger evaluation in other entities such as templates,
packages, and modules. This was part of the pre-consolidated API
implementation, where fetching form configurations was a separate API
call, and we needed to re-trigger the evaluation once the form
configurations were fetched.

With the consolidated API now including form configurations, there is no
longer a need to re-trigger evaluation upon the dispatch of the
`FETCH_FORM_CONFIG_SUCCESS` action. This change ensures that
`FETCH_ALL_PAGE_ENTITY_COMPLETION` is dispatched after the
`FETCH_FORM_CONFIG_SUCCESS` action.

This update eliminates an unnecessary evaluation cycle during the
initial page load.

Fixes #`Issue Number`  
_or_  
Fixes `Issue URL`
> [!WARNING]  
> _If no issue exists, please create an issue first, and check with the
maintainers if the issue is valid._

## Automation

/ok-to-test tags="@tag.All"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/11473435022>
> Commit: 23ec501
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11473435022&attempt=2"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Wed, 23 Oct 2024 09:05:06 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No


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

## Summary by CodeRabbit

- **New Features**
- Improved loading process for plugins and datasources, now integrated
within the page themes and actions loading.
  
- **Bug Fixes**
- Enhanced initialization sequence for the editor setup, ensuring timely
server reset after setup completion.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@coderabbitai coderabbitai bot mentioned this pull request Dec 24, 2024
2 tasks
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.

3 participants