Skip to content

chore: testing removing deepCLone#40100

Closed
vsvamsi1 wants to merge 3 commits intoreleasefrom
test73
Closed

chore: testing removing deepCLone#40100
vsvamsi1 wants to merge 3 commits intoreleasefrom
test73

Conversation

@vsvamsi1
Copy link
Contributor

@vsvamsi1 vsvamsi1 commented Apr 4, 2025

Description

Tip

Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content, marketing, and DevRel team).

Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR.

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

Caution

🔴 🔴 🔴 Some tests have failed.
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/14307341442
Commit: dd0af5a
Cypress dashboard.
Tags: @tag.All
Spec:
The following are new failures, please fix them before merging the PR:

  1. cypress/e2e/Regression/ClientSide/ExplorerTests/Admin_settings_2_spec.js
  2. cypress/e2e/Regression/ClientSide/MobileResponsiveTests/AutoDimension_2_spec.ts
  3. cypress/e2e/Regression/ClientSide/MobileResponsiveTests/AutoHeight_Container_spec.ts
  4. cypress/e2e/Regression/ClientSide/MobileResponsiveTests/AutoHeight_Form_spec.ts
  5. cypress/e2e/Regression/ClientSide/MobileResponsiveTests/AutoHeight_Modal_spec.ts
  6. cypress/e2e/Regression/ClientSide/MobileResponsiveTests/AutoHeight_Tabs_spec.ts
  7. cypress/e2e/Regression/ClientSide/Widgets/TableV2/freeze_column_query_change_spec.js
List of identified flaky tests.
Mon, 07 Apr 2025 12:17:02 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • Refactor
    • Improved the evaluation processing by introducing a control flag to better manage state updates.
    • Enhanced state management by ensuring previous evaluation states are accurately maintained through optimized deep-copy operations.

@vsvamsi1 vsvamsi1 added the ok-to-test Required label for CI label Apr 4, 2025
@vsvamsi1 vsvamsi1 self-assigned this Apr 4, 2025
@vsvamsi1 vsvamsi1 requested a review from ApekshaBhosale as a code owner April 4, 2025 18:45
@vsvamsi1 vsvamsi1 marked this pull request as draft April 4, 2025 18:45
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 4, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The pull request updates the evaluation process within the evalTree function by introducing a new boolean variable isUpdateTree to track when the evaluation tree should be updated. This triggers a block of logic that deep copies parts of the previous state using lodash's get and set functions, and it comments out the old tree construction method with makeEntityConfigsAsObjProperties. Finally, it resets isUpdateTree to ensure it only applies during the current evaluation cycle.

Changes

File(s) Change Summary
app/client/.../evalTree.ts Added isUpdateTree boolean variable to track tree updates. Introduced logic to deep copy parts of the previous state using lodash's get and set methods, and commented out the previous tree construction logic.

Sequence Diagram(s)

sequenceDiagram
    participant ET as evalTree
    participant DS as DataTreeEvaluator
    participant LS as Lodash Functions

    ET->>ET: Initialize isUpdateTree = false
    ET->>ET: Set isUpdateTree = true
    ET->>DS: Retrieve previous state
    DS->>LS: Use get() to fetch deep copy values
    LS-->>DS: Return deep copied values
    DS->>ET: Update dataTree with copied values
    ET->>ET: Reset isUpdateTree = false
Loading

Possibly related PRs

Suggested labels

skip-changelog

Suggested reviewers

  • rajatagrawal
  • dvj1988

Poem

In the realm of code, a tree now updates,
A flag is set and deep copies create,
With lodash magic, values are preserved,
Old logic paused, while new flows are observed.
A silent dance of state in every byte!


🪧 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 plan to trigger planning for file edits and PR creation.
  • @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.

@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Apr 4, 2025
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

🧹 Nitpick comments (1)
app/client/src/workers/Evaluation/handlers/evalTree.ts (1)

250-252: Remove commented out code

Rather than keeping commented out code, it would be better to remove it entirely if it's no longer needed. If this change is confirmed to work correctly, the old implementation should be deleted.

-      // dataTree = makeEntityConfigsAsObjProperties(dataTreeEvaluator.evalTree, {
-      //   evalProps: dataTreeEvaluator.evalProps,
-      // });
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f3055fe and 4fb9094.

📒 Files selected for processing (1)
  • app/client/src/workers/Evaluation/handlers/evalTree.ts (5 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: perform-test / client-build / client-build
  • GitHub Check: perform-test / server-build / server-unit-tests
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: client-prettier / prettier-check
  • GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-build / client-build
🔇 Additional comments (5)
app/client/src/workers/Evaluation/handlers/evalTree.ts (5)

38-39: New dependencies added for object manipulation

The addition of get, set from lodash and klona for deep cloning indicates a shift in how object properties are being accessed and copied. These are appropriate utilities for the implementation.


74-74: New control flag for tree updates

A new boolean variable isUpdateTree has been introduced to track when the evaluation tree is being updated. This flag is properly initialized.


249-249: Setting update flag before tree processing

The isUpdateTree flag is set to true at the appropriate point in the evaluation cycle, right after the sub-tree evaluation.


327-357: New deep-copy implementation for updating previous state

This implementation selectively deep copies only the necessary paths from the evaluation tree instead of recreating the entire tree. A few observations:

  1. The code properly handles error objects by cloning them with klona
  2. It efficiently updates only paths in completeEvalOrder
  3. It properly sets the resulting modified state as the new dataTree

The approach should be more efficient than rebuilding the entire tree structure.


370-370: Properly reset update flag

The isUpdateTree flag is correctly reset to ensure it doesn't carry over to subsequent evaluation cycles.

@vsvamsi1
Copy link
Contributor Author

vsvamsi1 commented Apr 5, 2025

/build-deploy-preview skip-tests=true

@github-actions
Copy link

github-actions bot commented Apr 5, 2025

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

@github-actions
Copy link

github-actions bot commented Apr 5, 2025

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

@vsvamsi1 vsvamsi1 added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Apr 5, 2025
@vsvamsi1 vsvamsi1 removed the ok-to-test Required label for CI label Apr 7, 2025
@vsvamsi1 vsvamsi1 added the ok-to-test Required label for CI label Apr 7, 2025
@vsvamsi1
Copy link
Contributor Author

vsvamsi1 commented Apr 7, 2025

/build-deploy-preview skip-tests=true

@github-actions
Copy link

github-actions bot commented Apr 7, 2025

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

@github-actions
Copy link

github-actions bot commented Apr 7, 2025

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

@github-actions
Copy link

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

@github-actions github-actions bot added the Stale label Apr 14, 2025
@github-actions
Copy link

This PR has been closed because of inactivity.

@github-actions github-actions bot closed this Apr 21, 2025
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 Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant