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

fix: setting up linter engine after consolidated API is finished #33049

Merged

Conversation

ApekshaBhosale
Copy link
Contributor

@ApekshaBhosale ApekshaBhosale commented Apr 30, 2024

Description

windowMessageListener is throwing linting error saying windowMessageListener is not defined because it is missing from global data which gets created as part of linter.

windowMessageListener is added based on license_message_listener_enabled feature flag. consolidated API sends all feature flags and as we are setting up linter engine before consolidated api is finished, it takes default value of feature flag from redux store. We don't update these feature flag values again leaving linter to have stale values ie license_message_listener_enabled: false.

this fix ensures that linter set up is called after consolidated api is finished to get updated values for feature flags

Fixes # #32126
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/8908838242
Commit: c4cd0d6
Cypress dashboard url: Click here!

Communication

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

  • Yes
  • No

Copy link
Contributor

coderabbitai bot commented Apr 30, 2024

Walkthrough

Walkthrough

The changes in the codebase streamline the initialization process by adjusting the order of function calls in InitSagas.ts. This optimization involves invoking engine.setupEngine after fetching allResponses in the startAppEngine function. This reordering aims to enhance efficiency and ensure that data readiness precedes engine setup for improved performance.

Changes

File Change Summary
app/client/src/sagas/InitSagas.ts Modified startAppEngine in InitSagas.ts to call yield put({ type: ReduxActionTypes.LINT_SETUP }); after fetching allResponses. Removed the initial call to yield call(engine.setupEngine, action.payload);.
app/client/src/ce/constants/ReduxActionConstants.tsx Added LINT_SETUP constant to ActionTypes in ReduxActionConstants.tsx.
app/client/src/sagas/LintingSagas.ts Added yield takeEvery(ReduxActionTypes.LINT_SETUP, setupSaga); in lintTreeSagaWatcher to trigger setupSaga alongside START_EVALUATION.
app/client/src/sagas/__tests__/initSagas.test.ts Reordered function calls in the testSaga of initSagas by removing call(engine.setupEngine, action.payload) before getInitResponses and adding put({ type: ReduxActionTypes.LINT_SETUP }) after getInitResponses.

Recent Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between f9d40e1 and c4cd0d6.
Files selected for processing (2)
  • app/client/src/sagas/LintingSagas.ts (1 hunks)
  • app/client/src/sagas/tests/initSagas.test.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • app/client/src/sagas/LintingSagas.ts
Additional comments not posted (1)
app/client/src/sagas/__tests__/initSagas.test.ts (1)

61-61: Ensure that the new LINT_SETUP action is properly tested for its effects and integration.

Verification successful

The LINT_SETUP action is well-integrated and tested across the codebase. It is defined in ReduxActionConstants.tsx, dispatched in InitSagas.ts, handled in LintingSagas.ts, and tested in initSagas.test.ts. This confirms that the action is properly set up and utilized within the system.

  • Defined in: app/client/src/ce/constants/ReduxActionConstants.tsx
  • Dispatched in: app/client/src/sagas/InitSagas.ts
  • Handled in: app/client/src/sagas/LintingSagas.ts
  • Tested in: app/client/src/sagas/__tests__/initSagas.test.ts
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that the new `LINT_SETUP` action is integrated and tested in other parts of the codebase where it might have effects.

# Search for the `LINT_SETUP` action in the codebase to see where it's used or tested.
rg --files-with-matches --type typescript $'LINT_SETUP'

Length of output: 89



Script:

#!/bin/bash
# Description: Verify that the new `LINT_SETUP` action is integrated and tested in other parts of the codebase where it might have effects.

# Correct the file type specifier and search for the `LINT_SETUP` action in the codebase to see where it's used or tested.
rg --files-with-matches --type ts 'LINT_SETUP'

Length of output: 219


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.

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 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.

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.

@ApekshaBhosale ApekshaBhosale added the ok-to-test Required label for CI label Apr 30, 2024
@github-actions github-actions bot added the Bug Something isn't working label Apr 30, 2024
@ApekshaBhosale ApekshaBhosale added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Apr 30, 2024
@ApekshaBhosale ApekshaBhosale self-assigned this Apr 30, 2024
@brayn003 brayn003 added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Apr 30, 2024
@ApekshaBhosale ApekshaBhosale removed the ok-to-test Required label for CI label Apr 30, 2024
@ApekshaBhosale ApekshaBhosale force-pushed the fix-window-message-listener-showing-lint-error branch from 3d5435c to ea289b8 Compare April 30, 2024 12:10
@ApekshaBhosale ApekshaBhosale added the ok-to-test Required label for CI label Apr 30, 2024
@ApekshaBhosale ApekshaBhosale added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels May 1, 2024
@ApekshaBhosale ApekshaBhosale added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels May 1, 2024
@ApekshaBhosale ApekshaBhosale merged commit 841b9f9 into release May 1, 2024
82 checks passed
@ApekshaBhosale ApekshaBhosale deleted the fix-window-message-listener-showing-lint-error branch May 1, 2024 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working ok-to-test Required label for CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants