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(#7143): add eslint-plugin-no-sanitize and fix errors #7144

Merged
merged 12 commits into from Oct 16, 2023

Conversation

ozyx
Copy link
Member

@ozyx ozyx commented Oct 12, 2023

Closes #7143

Describe your changes:

  • Applies a number of eslint rules from eslint-plugin-no-unsanitized to catch bad usage of .innerHTML.
  • Refactors all bad usage of innerHTML out of our codebase.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Is this change backwards compatible? For example, developers won't need to change how they are calling the API or how they've extended core plugins such as Tables or Plots.

Author Checklist

  • Changes address original issue?
  • Tests included and/or updated with changes?
  • Command line build passes?
  • Has this been smoke tested?
  • Testing instructions included in associated issue OR is this a dependency/testcase change?

Reviewer Checklist

  • Changes appear to address issue?
  • Reviewer has tested changes by following the provided instructions?
  • Changes appear not to be breaking changes?
  • Appropriate automated tests included?
  • Code style and in-line documentation are appropriate?
  • Has associated issue been labelled unverified? (only applicable if this PR closes the issue)
  • Has associated issue been labelled bug? (only applicable if this PR is for a bug fix)

@ozyx ozyx requested review from davetsay and akhenry October 12, 2023 21:55
@deploysentinel
Copy link

deploysentinel bot commented Oct 12, 2023

Current Playwright Test Results Summary

✅ 14 Passing

Run may still be in progress, this comment will be updated as current testing workflow or job completes...

(Last updated on 10/14/2023 12:11:22am UTC)

Run Details

Running Workflow e2e-couchdb on Github Actions

Commit: f59737b

Started: 10/14/2023 12:09:04am UTC

View Detailed Build Results


Current Playwright Test Results Summary

✅ 143 Passing - ⚠️ 5 Flaky

Run may still be in progress, this comment will be updated as current testing workflow or job completes...

(Last updated on 10/14/2023 12:11:22am UTC)

Run Details

Running Job e2e-stable on CircleCI

Commit: f59737b

Started: 10/13/2023 04:46:31pm UTC

⚠️ Flakes

📄   functional/plugins/timer/timer.e2e.spec.js • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Timer Can perform actions on the Timer
Retry 1Initial Attempt
0% (0) 0 / 54 runs
failed over last 7 days
11.11% (6) 6 / 54 runs
flaked over last 7 days

📄   functional/plugins/plot/logPlot.e2e.spec.js • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Log plot tests Log Plot ticks are functionally correct in regular and log mode and after refresh
Retry 1Initial Attempt
-1.89% (-1) -1 / 53 runs
failed over last 7 days
37.74% (20) 20 / 53 runs
flaked over last 7 days

📄   functional/plugins/telemetryTable/telemetryTable.e2e.spec.js • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Telemetry Table unpauses and filters data when paused by button and user changes bounds
Retry 1Initial Attempt
1.85% (1) 1 / 54 run
failed over last 7 days
25.93% (14) 14 / 54 runs
flaked over last 7 days

📄   functional/plugins/notebook/restrictedNotebook.e2e.spec.js • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Restricted Notebook with a page locked and with an embed @addinit Disallows embeds to be deleted if page locked @addinit
Retry 1Initial Attempt
0% (0) 0 / 51 runs
failed over last 7 days
50.98% (26) 26 / 51 runs
flaked over last 7 days

📄   functional/plugins/notebook/notebookSnapshots.e2e.spec.js • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Snapshot image tests Can drop an image onto a notebook and create a new entry
Retry 1Initial Attempt
5.77% (3) 3 / 52 runs
failed over last 7 days
67.31% (35) 35 / 52 runs
flaked over last 7 days

View Detailed Build Results


@codecov
Copy link

codecov bot commented Oct 12, 2023

Codecov Report

Merging #7144 (f59737b) into master (76889cf) will increase coverage by 0.16%.
The diff coverage is 44.00%.

@@            Coverage Diff             @@
##           master    #7144      +/-   ##
==========================================
+ Coverage   55.23%   55.40%   +0.16%     
==========================================
  Files         651      651              
  Lines       26170    26187      +17     
  Branches     2535     2535              
==========================================
+ Hits        14456    14508      +52     
+ Misses      11013    10987      -26     
+ Partials      701      692       -9     
Flag Coverage Δ *Carryforward flag
e2e-full 41.96% <ø> (+0.01%) ⬆️ Carriedforward from 76889cf
e2e-stable 57.23% <15.90%> (+3.95%) ⬆️
unit 48.80% <44.00%> (-0.44%) ⬇️

*This pull request uses carry forward flags. Click here to find out more.

Files Coverage Δ
...ugins/flexibleLayout/components/FrameComponent.vue 0.00% <ø> (ø)
src/plugins/summaryWidget/src/SummaryWidget.js 87.26% <100.00%> (ø)
src/plugins/summaryWidget/src/input/Palette.js 87.67% <100.00%> (ø)
src/utils/template/templateHelpers.js 100.00% <100.00%> (ø)
src/plugins/plot/chart/MctChart.vue 43.55% <83.33%> (+0.13%) ⬆️
src/plugins/summaryWidget/src/Rule.js 87.44% <66.66%> (-0.39%) ⬇️
src/plugins/summaryWidget/src/Condition.js 85.55% <0.00%> (-2.96%) ⬇️
...ugins/summaryWidget/src/views/SummaryWidgetView.js 1.63% <5.26%> (-12.91%) ⬇️

... and 36 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 76889cf...f59737b. Read the comment docs.

Copy link
Contributor

@davetsay davetsay left a comment

Choose a reason for hiding this comment

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

Looks good. I have one comment you can address or shoo away.

src/plugins/plot/chart/MctChart.vue Show resolved Hide resolved
@ozyx ozyx added the pr:e2e:couchdb npm run test:e2e:couchdb label Oct 14, 2023
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Oct 14, 2023
@ozyx ozyx merged commit 9849e03 into master Oct 16, 2023
13 of 15 checks passed
@ozyx ozyx deleted the add-innerHtml-eslint-rule branch October 16, 2023 16:26
ozyx added a commit that referenced this pull request Oct 18, 2023
ozyx added a commit that referenced this pull request Oct 23, 2023
@unlikelyzero unlikelyzero added this to the Target:3.2.0 milestone Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement eslint rule to catch bad use of innerHTML
3 participants