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 unevalTree #34605

Merged
merged 1 commit into from
Jul 8, 2024
Merged

chore: remove unevalTree #34605

merged 1 commit into from
Jul 8, 2024

Conversation

vsvamsi1
Copy link
Contributor

@vsvamsi1 vsvamsi1 commented Jul 1, 2024

Description

evalTreeWithChanges is sending a redundant property unevalTree in the payload, we should remove this property to reduce the serialisation cost of including this property in the payload.

Fixes #34766

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/9807127090
Commit: 73e226d
Cypress dashboard.
Tags: @tag.All
The following are new failures, please fix them before merging the PR:

  1. cypress/e2e/Regression/ClientSide/PartialImportExport/PartialExport_spec.ts
  2. cypress/e2e/Regression/ClientSide/Workspace/MemberRoles_Spec.ts
  3. cypress/e2e/Regression/ClientSide/Workspace/ShareAppTests_Spec.ts
List of identified flaky tests.
Fri, 05 Jul 2024 11:46:05 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • Refactor

    • Improved the handling of unevalTree by accessing it from unEvalAndConfigTree instead of directly from the message data in message handling logic.
  • Tests

    • Updated tests to reflect the removal of the unevalTree property and related assertions.

@vsvamsi1 vsvamsi1 added the ok-to-test Required label for CI label Jul 1, 2024
@vsvamsi1 vsvamsi1 self-assigned this Jul 1, 2024
Copy link
Contributor

coderabbitai bot commented Jul 1, 2024

Walkthrough

The recent changes focus on refactoring how unevalTree is handled across several files, specifically removing it from message data interfaces and adjusting its access and assignment within functions. The update ensures unevalTree is derived from dataTreeEvaluator, leading to cleaner and more efficient data management.

Changes

Files Change Summary
app/client/src/sagas/EvalWorkerActionSagas.ts Removed unevalTree from UpdateDataTreeMessageData interface; access it via unEvalAndConfigTree in handleEvalWorkerMessage.
app/client/src/workers/Evaluation/evalTreeWithChanges.test.ts Eliminated unevalTree from webworkerResponse; removed updateTreeResponse and related assertions in tests.
app/client/src/workers/Evaluation/evalTreeWithChanges.ts Changed evaluateAndGenerateResponse function to use dataTreeEvaluator.getOldUnevalTree() for unevalTree.

Sequence Diagram(s)

sequenceDiagram
  participant UI
  participant Worker
  participant DataTreeEvaluator

  UI->>+Worker: Send eval request
  Worker->>+DataTreeEvaluator: Get old unevalTree
  DataTreeEvaluator-->>Worker: Return unevalTree
  Worker-->>UI: Send eval response
Loading

Poem

In the code where trees uneval,
We fixed where data seemed to dwell,
From the worker to the tree's old tale,
Our changes ensure it will prevail.
🌳✨


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.

@vsvamsi1 vsvamsi1 marked this pull request as draft July 1, 2024 09:08
@vsvamsi1 vsvamsi1 removed the request for review from ApekshaBhosale July 1, 2024 09:09
@vsvamsi1 vsvamsi1 changed the title remove unevalTree chore: remove unevalTree Jul 1, 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 Jul 1, 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: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f25cae0 and c48a98e.

Files selected for processing (2)
  • app/client/src/sagas/EvalWorkerActionSagas.ts (2 hunks)
  • app/client/src/workers/Evaluation/evalTreeWithChanges.ts (3 hunks)
Files not summarized due to errors (2)
  • app/client/src/sagas/EvalWorkerActionSagas.ts: Error: Server error. Please try again later.
  • app/client/src/workers/Evaluation/evalTreeWithChanges.ts: Error: Server error. Please try again later.

Comment on lines 142 to 147
const { workerResponse } = data as UpdateDataTreeMessageData;
const unEvalAndConfigTree: ReturnType<typeof getUnevaluatedDataTree> =
yield select(getUnevaluatedDataTree);
yield call(updateDataTreeHandler, {
evalTreeResponse: workerResponse as EvalTreeResponseData,
unevalTree,
unevalTree: unEvalAndConfigTree.unEvalTree,
Copy link
Contributor

Choose a reason for hiding this comment

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

Ensure consistency in the removal of unevalTree.

The PR aims to remove the unevalTree feature, but this segment still references unevalTree. This may lead to inconsistencies or errors if the feature is indeed removed elsewhere.

-        unevalTree: unEvalAndConfigTree.unEvalTree,
+        // Removed the unevalTree reference as part of the feature removal

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 f25cae0 and c48a98e.

Files selected for processing (2)
  • app/client/src/sagas/EvalWorkerActionSagas.ts (2 hunks)
  • app/client/src/workers/Evaluation/evalTreeWithChanges.ts (3 hunks)
Files not summarized due to errors (2)
  • app/client/src/workers/Evaluation/evalTreeWithChanges.ts: Error: Server error. Please try again later.
  • app/client/src/sagas/EvalWorkerActionSagas.ts: Error: Server error. Please try again later.
Additional comments not posted (2)
app/client/src/sagas/EvalWorkerActionSagas.ts (1)

142-147: Ensure proper error handling for getUnevaluatedDataTree selector.

The getUnevaluatedDataTree selector is used without error handling. Ensure it always returns the expected structure.

#!/bin/bash
# Description: Verify the `getUnevaluatedDataTree` selector always returns the expected structure.

# Test: Search for the `getUnevaluatedDataTree` selector implementation. Expect: Proper error handling and return structure.
ast-grep --lang typescript --pattern $'export const getUnevaluatedDataTree = $_ => {
  $$$
}'
app/client/src/workers/Evaluation/evalTreeWithChanges.ts (1)

Line range hint 142-147: Ensure UpdateDataTreeMessageData structure is correctly populated.

The function now returns an UpdateDataTreeMessageData object. Ensure all required fields are correctly populated.

#!/bin/bash
# Description: Verify the `UpdateDataTreeMessageData` structure is correctly populated.

# Test: Search for the `UpdateDataTreeMessageData` type definition. Expect: Proper field definitions and population.
ast-grep --lang typescript --pattern $'export type UpdateDataTreeMessageData = {
  workerResponse: EvalTreeResponseData;
}'

@vsvamsi1 vsvamsi1 added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Jul 1, 2024
@vsvamsi1 vsvamsi1 added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Jul 3, 2024
@vsvamsi1 vsvamsi1 added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Jul 3, 2024
@vsvamsi1 vsvamsi1 added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Jul 4, 2024
@vsvamsi1 vsvamsi1 added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Jul 5, 2024
@vsvamsi1 vsvamsi1 marked this pull request as ready for review July 5, 2024 03:39
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 c48a98e and 39e38c602393a819d3248ab49e4309cec4bc22bc.

Files selected for processing (3)
  • app/client/src/sagas/EvalWorkerActionSagas.ts (2 hunks)
  • app/client/src/workers/Evaluation/evalTreeWithChanges.test.ts (2 hunks)
  • app/client/src/workers/Evaluation/evalTreeWithChanges.ts (3 hunks)
Files skipped from review due to trivial changes (1)
  • app/client/src/workers/Evaluation/evalTreeWithChanges.test.ts
Additional comments not posted (3)
app/client/src/sagas/EvalWorkerActionSagas.ts (2)

26-27: LGTM! The unevalTree property has been successfully removed.

The removal aligns with the PR objective to eliminate unevalTree from the codebase.


142-147: LGTM! The handleEvalWorkerMessage function has been updated correctly.

The function now retrieves unevalTree from unEvalAndConfigTree, which centralizes the source and simplifies the message data structure.

app/client/src/workers/Evaluation/evalTreeWithChanges.ts (1)

Line range hint 59-61:
LGTM! The evaluateAndGenerateResponse function has been updated correctly.

The function now assigns the result of dataTreeEvaluator.getOldUnevalTree() to unevalTree, ensuring that it uses the existing unevaluated tree data from the evaluator.

rishabhrathod01
rishabhrathod01 previously approved these changes Jul 5, 2024
@vsvamsi1 vsvamsi1 added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Jul 5, 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 39e38c602393a819d3248ab49e4309cec4bc22bc and 00483a9e225d9e518c7b92accf0eba3fc9410cc7.

Files selected for processing (3)
  • app/client/src/sagas/EvalWorkerActionSagas.ts (2 hunks)
  • app/client/src/workers/Evaluation/evalTreeWithChanges.test.ts (2 hunks)
  • app/client/src/workers/Evaluation/evalTreeWithChanges.ts (3 hunks)
Files skipped from review due to trivial changes (1)
  • app/client/src/workers/Evaluation/evalTreeWithChanges.test.ts
Files skipped from review as they are similar to previous changes (2)
  • app/client/src/sagas/EvalWorkerActionSagas.ts
  • app/client/src/workers/Evaluation/evalTreeWithChanges.ts

@vsvamsi1 vsvamsi1 added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Jul 5, 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 00483a9e225d9e518c7b92accf0eba3fc9410cc7 and 73e226d.

Files selected for processing (3)
  • app/client/src/sagas/EvalWorkerActionSagas.ts (2 hunks)
  • app/client/src/workers/Evaluation/evalTreeWithChanges.test.ts (2 hunks)
  • app/client/src/workers/Evaluation/evalTreeWithChanges.ts (3 hunks)
Files skipped from review as they are similar to previous changes (3)
  • app/client/src/sagas/EvalWorkerActionSagas.ts
  • app/client/src/workers/Evaluation/evalTreeWithChanges.test.ts
  • app/client/src/workers/Evaluation/evalTreeWithChanges.ts

@github-actions github-actions bot added the Task A simple Todo label Jul 6, 2024
@yatinappsmith yatinappsmith merged commit 2edfd6c into release Jul 8, 2024
84 of 88 checks passed
@yatinappsmith yatinappsmith deleted the test11 branch July 8, 2024 05:56
Shivam-z pushed a commit to Shivam-z/appsmith that referenced this pull request Jul 10, 2024
## Description
evalTreeWithChanges is sending a redundant property unevalTree in the
payload, we should remove this property to reduce the serialisation cost
of including this property in the payload.

Fixes appsmithorg#34766

> [!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  -->
> [!CAUTION]
> 🔴 🔴 🔴 Some tests have failed.
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/9807127090>
> Commit: 73e226d
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9807127090&attempt=1&selectiontype=test&testsstatus=failed&specsstatus=fail"
target="_blank">Cypress dashboard</a>.
> Tags: @tag.All
> The following are new failures, please fix them before merging the PR:
<ol>
>
<li>cypress/e2e/Regression/ClientSide/PartialImportExport/PartialExport_spec.ts
> <li>cypress/e2e/Regression/ClientSide/Workspace/MemberRoles_Spec.ts
>
<li>cypress/e2e/Regression/ClientSide/Workspace/ShareAppTests_Spec.ts</ol>
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master"
target="_blank">List of identified flaky tests</a>.
> <hr>Fri, 05 Jul 2024 11:46:05 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

- **Refactor**
- Improved the handling of `unevalTree` by accessing it from
`unEvalAndConfigTree` instead of directly from the message data in
message handling logic.

- **Tests**
- Updated tests to reflect the removal of the `unevalTree` property and
related assertions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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 Task A simple Todo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Removed unevalTree from payload of evalTreeWithChanges
3 participants