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: Action execution changes for modules #29357

Merged
merged 4 commits into from
Dec 6, 2023

Conversation

rishabhrathod01
Copy link
Contributor

@rishabhrathod01 rishabhrathod01 commented Dec 5, 2023

Description

CE changes for confirm before calling of query and js module

PR fixes following issue(s)

Fixes # (issue number)

Type of change

  • Chore (housekeeping or task changes that don't impact user perception)

Testing

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Also list any relevant details for your test configuration.
Delete anything that is not relevant

  • Manual
  • JUnit
  • Jest
  • Cypress

Test Plan

Add Testsmith test cases links that relate to this PR

Issues raised during DP testing

Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR)

Checklist:

Dev activity

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • PR is being merged under a feature flag

QA activity:

  • Speedbreak features have been covered
  • Test plan covers all impacted features and areas of interest
  • Test plan has been peer reviewed by project stakeholders and other QA members
  • Manually tested functionality on DP
  • We had an implementation alignment call with stakeholders post QA Round 2
  • Cypress test cases have been added and approved by SDET/manual QA
  • Added Test Plan Approved label after Cypress tests were reviewed
  • Added Test Plan Approved label after JUnit tests were reviewed

Summary by CodeRabbit

  • Refactor

    • Simplified the execution of JavaScript functions by consolidating parameters into a single collection object.
    • Streamlined the retrieval and display of JavaScript function and collection names across the application.
  • New Features

    • Introduced new utility functions to enhance the display of action and collection names.
  • Bug Fixes

    • Adjusted the logic for error handling and success messaging to align with the refactored JavaScript function execution process.
  • Documentation

    • Updated function signatures and import statements to reflect the new changes in JavaScript function execution.
  • Style

    • Ensured consistent naming conventions for JavaScript actions and collections throughout the codebase.

@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Dec 5, 2023
@rishabhrathod01
Copy link
Contributor Author

/ok-to-test

Copy link

github-actions bot commented Dec 5, 2023

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/7106785385.
Workflow: Appsmith External Integration Test Workflow.
Tags: ``.

@rishabhrathod01
Copy link
Contributor Author

/ok-to-test

Copy link

github-actions bot commented Dec 5, 2023

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/7107028099.
Workflow: Appsmith External Integration Test Workflow.
Tags: ``.

Copy link

github-actions bot commented Dec 5, 2023

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/7106785385.
Commit: ``.
Cypress dashboard url: Click here!
It seems like there are some failures 😔. We are not able to recognize it, please check this manually here.

Copy link

github-actions bot commented Dec 5, 2023

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/7107028099.
Commit: ``.
Cypress dashboard: Click here!
The following are new failures, please fix them before merging the PR:

  1. cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad1_Spec.ts

  2. cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad2_Spec.ts
  3. cypress/e2e/Regression/ServerSide/OnLoadTests/JsOnLoad3_Spec.ts
To know the list of identified flaky tests - Refer here

Copy link

github-actions bot commented Dec 6, 2023

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/7107028099.
Commit: ``.
Cypress dashboard: Click here!
The following are new failures, please fix them before merging the PR:

  1. cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad1_Spec.ts

  2. cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad2_Spec.ts
  3. cypress/e2e/Regression/ServerSide/OnLoadTests/JsOnLoad3_Spec.ts
To know the list of identified flaky tests - Refer here

@rishabhrathod01
Copy link
Contributor Author

/ok-to-test

Copy link

github-actions bot commented Dec 6, 2023

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/7112572865.
Workflow: Appsmith External Integration Test Workflow.
Tags: ``.

Copy link
Contributor

coderabbitai bot commented Dec 6, 2023

Walkthrough

Walkthrough

The changes across the codebase reflect a significant refactoring effort, primarily focusing on streamlining the handling of JavaScript collections and actions. The collectionName and collectionId parameters have been consolidated into a single collection object parameter in various functions, reducing redundancy and simplifying function signatures. Additionally, new utility functions have been introduced to aid in displaying action and collection names, and existing functions have been updated to accommodate these changes. The refactoring also includes updates to import statements and error handling logic to align with the new parameter structures.

Changes

File Path Change Summary
.../actions/jsPaneActions.ts
.../reducers/entityReducers/jsActionsReducer.tsx
Refactored functions to use collection object instead of separate collectionName and collectionId parameters.
.../selectors/entitiesSelector.ts
.../sagas/EvaluationsSaga.ts
.../sagas/PostEvaluationSagas.ts
Modified function signatures and imports to accommodate changes in parameter structures.
.../utils/actionExecutionUtils.ts
.../ce/utils/actionExecutionUtils.ts
Added new functions for displaying action and collection names; introduced export statement for all entities from the "ce/utils/actionExecutionUtils" module.
.../sagas/ActionExecution/PluginActionSaga.ts
.../sagas/JSPaneSagas.ts
Updated imports and logic to align with the refactored parameter structures and introduced utility functions.
.../pages/Editor/JSEditor/Form.tsx Updated dispatch call to use currentJSCollection object.

Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

Comment on lines 290 to 301
[ReduxActionTypes.EXECUTE_JS_FUNCTION_INIT]: (
state: JSCollectionDataState,
action: ReduxAction<{
collectionName: string;
collectionId: string;
collection: JSCollection;
action: JSAction;
}>,
): JSCollectionDataState =>
state.map((a) => {
if (a.config.id === action.payload.collectionId) {
if (a.config.id === action.payload.collection.id) {
const newData = { ...a.data };
const newIsDirty = { ...a.isDirty };
unset(newData, action.payload.action.id);
Copy link
Contributor

Choose a reason for hiding this comment

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

The use of unset from lodash to remove properties from newData and newIsDirty may be unnecessary since the spread operator is used to create new objects immediately after. This could be simplified by not copying these properties in the first place if they are not needed.

Copy link

github-actions bot commented Dec 6, 2023

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/7112572865.
Commit: ``.
Cypress dashboard: Click here!
The following are new failures, please fix them before merging the PR:

  1. cypress/e2e/Regression/ClientSide/Widgets/Others/IconButton_2_spec.ts

  2. cypress/e2e/Regression/ClientSide/Workspace/ShareAppTests_Spec.ts
  3. cypress/e2e/Regression/ServerSide/OnLoadTests/JsOnLoad3_Spec.ts
To know the list of identified flaky tests - Refer here

Copy link

github-actions bot commented Dec 6, 2023

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/7112572865.
Commit: ``.
Cypress dashboard: Click here!
The following are new failures, please fix them before merging the PR:

  1. cypress/e2e/Regression/ServerSide/OnLoadTests/JsOnLoad3_Spec.ts

To know the list of identified flaky tests - Refer here

@rishabhrathod01
Copy link
Contributor Author

/ok-to-test

Copy link

github-actions bot commented Dec 6, 2023

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/7114659727.
Workflow: Appsmith External Integration Test Workflow.
Tags: ``.

Copy link

github-actions bot commented Dec 6, 2023

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/7114659727.
Commit: ``.
Cypress dashboard url: Click here!
It seems like there are some failures 😔. We are not able to recognize it, please check this manually here.

Copy link

github-actions bot commented Dec 6, 2023

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/7114659727.
Commit: ``.
Cypress dashboard url: Click here!
All cypress tests have passed 🎉🎉🎉

@rishabhrathod01 rishabhrathod01 merged commit 6580c60 into release Dec 6, 2023
19 checks passed
@rishabhrathod01 rishabhrathod01 deleted the chore/ModuleconfirmBeforeExecute branch December 6, 2023 19:18
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 skip-docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants