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: prevent lint warnings from blocking execution in js objects #13700

Conversation

ohansFavour
Copy link
Contributor

@ohansFavour ohansFavour commented May 9, 2022

Description

This PR ensures that only parse errors prevent the execution of js functions. Parse errors/ Lint errors within a function (that don't render the entire JS Object invalid) don't cause all functions to be unrunnable.

Fixes #12012

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Cypress

Checklist:

  • 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

Test coverage results 🧪

🔴 Total coverage has decreased
// Code coverage diff between base branch:release and head branch: fix/prevent-lint-warnings-from-blocking-execution-in-js-objects 
Status File % Stmts % Branch % Funcs % Lines
🔴 total 56.58 (-0.01) 38.38 (-0.02) 35.83 (-0.01) 56.83 (-0.01)
🔴 app/client/src/ce/constants/messages.ts 77.81 (-0.02) 100 (0) 34.35 (-0.05) 81.7 (-0.07)
🔴 app/client/src/components/editorComponents/JSResponseView.tsx 51.22 (-1.94) 26.51 (-5.37) 8.33 (0) 53.16 (-2.1)
🔴 app/client/src/reducers/entityReducers/jsActionsReducer.tsx 6.54 (-0.13) 0 (0) 0 (0) 6.67 (-0.13)
🔴 app/client/src/sagas/EvaluationsSaga.ts 19.4 (-0.08) 1.94 (0) 7.41 (0) 22.17 (-0.11)
🔴 app/client/src/sagas/JSPaneSagas.ts 16.67 (0) 1.02 (-0.01) 4.55 (0) 19.31 (0)
🔴 app/client/src/selectors/entitiesSelector.ts 48.37 (-0.11) 11.43 (0) 23.95 (0) 44.1 (-0.16)

@vercel
Copy link

vercel bot commented May 9, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
appsmith ✅ Ready (Inspect) Visit Preview May 10, 2022 at 1:40AM (UTC)

@github-actions github-actions bot added Actions Pod Bug Something isn't working FE Coders Pod Issues related to users writing javascript in appsmith High This issue blocks a user from building or impacts a lot of users JS Objects Issues related to JS Objects JS Linting & Errors Issues related to JS Linting and errors labels May 9, 2022
@ohansFavour
Copy link
Contributor Author

/ok-to-test sha=4d6c34a

@github-actions
Copy link

github-actions bot commented May 9, 2022

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/2297357273.
Workflow: Appsmith External Integration Test Workflow.
Commit: 4d6c34a.
PR: 13700.

@ohansFavour ohansFavour changed the title fix:prevent lint warnings from blocking execution in js objects fix: prevent lint warnings from blocking execution in js objects May 9, 2022
@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/2297357273.
Workflow: Appsmith External Integration Test Workflow.
Commit: 4d6c34a.
PR: 13700.

@ohansFavour
Copy link
Contributor Author

/ok-to-test sha=c4ce2ea

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/2297826311.
Workflow: Appsmith External Integration Test Workflow.
Commit: c4ce2ea.
PR: 13700.

@github-actions
Copy link

UI Performance test run logs and artifacts: https://github.com/appsmithorg/appsmith/actions/runs/2297826311.
Commit: c4ce2ea.
Results:

Click to view performance test results

Run 1 Run 2 Run 3 Run 4 Run 5 Median Mean SD.Sample SD.Population
SELECT_CATEGORY
scripting 730.87 725.3 834.44 749.38 2070.3 749.38 1022.06 57.49 51.42
painting 7.53 4.83 4.88 4.26 7.35 4.88 5.77 26.86 23.92
rendering 288.8 292.68 330.34 296.09 313.62 296.09 304.31 5.71 5.11
BIND_TABLE_DATA
scripting 2254.93 2315.2 2224.27 2896.76 2310.63 2310.63 2400.36 11.67 10.44
painting 14.27 18.75 21.06 12.32 26.63 18.75 18.61 30.47 27.24
rendering 563.05 593.78 613.78 726.79 684.72 613.78 636.42 10.60 9.48
CLICK_ON_TABLE_ROW
scripting 2373.62 2003.45 2074.55 2861.03 2309.91 2309.91 2324.51 14.53 12.99
painting 15.46 17.85 17.47 25.44 23.34 17.85 19.91 21.35 19.09
rendering 299.64 288.68 290.18 405.88 305.38 299.64 317.95 15.61 13.96
UPDATE_POST_TITLE
scripting 2986.84 3246.26 3851.95 3581.68 3734.2 3581.68 3480.19 10.27 9.19
painting 27.76 17.52 22.49 28.74 24.99 24.99 24.3 18.56 16.58
rendering 371.12 408.59 390.2 476.15 465.84 408.59 422.38 11.00 9.84
OPEN_MODAL
scripting 1378.82 1378.01 1208.98 1311.09 1561.76 1378.01 1367.73 9.41 8.42
painting 14.5 10.34 18.1 13.93 12.65 13.93 13.9 20.43 18.27
rendering 424.37 468.47 426.25 462.87 499.75 462.87 456.34 6.93 6.20
CLOSE_MODAL
scripting 749.98 671.53 684 3485.6 819.47 749.98 1282.12 96.18 86.03
painting 5.03 9.74 5.84 5.41 13.03 5.84 7.81 44.56 39.82
rendering 361.18 335.08 347.02 434.08 346.03 347.02 364.68 10.94 9.78
SELECT_WIDGET_MENU_OPEN
scripting 1510.6 1586.11 1532.68 1550.3 1533.89 1533.89 1542.72 1.82 1.63
painting 6.93 5.18 15.96 5.8 6.52 6.52 8.08 55.20 49.38
rendering 524.81 504.61 527.46 524.46 531.11 524.81 522.49 1.98 1.77
SELECT_WIDGET_SELECT_OPTION
scripting 267.35 232.35 213.4 218.09 215.59 218.09 229.36 9.81 8.77
painting 11.56 3.15 6.15 5.16 4.31 5.16 6.07 53.71 48.11
rendering 16.05 16.71 15.76 16.46 19 16.46 16.8 7.68 6.85

@ohansFavour ohansFavour merged commit 876d1a1 into release May 11, 2022
@ohansFavour ohansFavour deleted the fix/prevent-lint-warnings-from-blocking-execution-in-js-objects branch May 11, 2022 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working FE Coders Pod Issues related to users writing javascript in appsmith High This issue blocks a user from building or impacts a lot of users JS Linting & Errors Issues related to JS Linting and errors JS Objects Issues related to JS Objects
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Using code with lint errors inside JS object makes all functions un-runnable on response tab
2 participants