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(DGHT-287): Fix Dependabot alerts #5463

Merged
merged 15 commits into from
Dec 9, 2024

Conversation

yyanwang
Copy link
Member

@yyanwang yyanwang commented Dec 4, 2024

What is the problem this PR is trying to solve?
Resolve Dependabot alerts in the project.
This PR will fix:
https://github.com/Talend/ui/security/dependabot/242
https://github.com/Talend/ui/security/dependabot/241
https://github.com/Talend/ui/security/dependabot/237
https://github.com/Talend/ui/security/dependabot/216
https://github.com/Talend/ui/security/dependabot/215
https://github.com/Talend/ui/security/dependabot/245

Dependencies upgraded:
"cross-spawn": "^7.0.3" => "^7.0.6"
"path-to-regexp": "^3.30" => "^8.2.0"
"msw": "^1.3.5" => "^2.6.6"
"msw-storybook-addon": "^1.10.0" => "^2.0.4"
"browser-sync": "^2.29.3" => "^3.0.3"

Changes:

  1. Adapt breaking changes of path-to-regexp in matchPath.js. Test passed after change.
  2. Adapt breaking changes of msw in AboutDialog container's story and storybook configuration. Regenerate msw service worker. Storybook of react-containers package works fine after this change.
  3. msw-storybook-addon need to be upgraded from 1.x to 2.x because we upgraded msw.

Changeset:
For packages with major dependency upgrade, I use a minor changeset.
For packages with patch dependency upgrade, I use a patch changeset.

What is the chosen solution to this problem?

Please check if the PR fulfills these requirements

  • The PR have used yarn changeset to a request a release from the CI if wanted.
  • The PR commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features) And non reg done before need review
  • Docs have been added / updated (for bug fixes / features)
  • Related design / discussions / pages (not in jira), if any, are all linked or available in the PR

[ ] This PR introduces a breaking change

@yyanwang yyanwang temporarily deployed to pull_request_unsafe December 4, 2024 03:42 — with GitHub Actions Inactive
Copy link
Contributor

github-actions bot commented Dec 4, 2024

Storybook for this PR deployed on this github page

Copy link
Contributor

github-actions bot commented Dec 4, 2024

Title Lines Statements Branches Functions
assets-api Coverage: 28%
28.4% (25/88) 30.76% (16/52) 21.42% (3/14)
cmf Coverage: 89%
89.17% (1236/1386) 80.88% (605/748) 89.28% (350/392)
cmf-cqrs Coverage: 87%
87.43% (160/183) 70.23% (59/84) 84.21% (48/57)
cmf-router Coverage: 70%
69.23% (135/195) 55.71% (78/140) 56.81% (25/44)
components Coverage: 90%
90.8% (5527/6087) 81.84% (3206/3917) 88.14% (1390/1577)
containers Coverage: 84%
83.59% (1391/1664) 74.3% (694/934) 75% (327/436)
dataviz Coverage: 85%
85.44% (323/378) 66.66% (160/240) 75.79% (119/157)
design-system Coverage: 67%
66.4% (1012/1524) 50.46% (537/1064) 53.58% (217/405)
faceted-search Coverage: 85%
85.08% (639/751) 78.63% (287/365) 81.88% (226/276)
flow-designer Coverage: 70%
70.07% (651/929) 66.72% (355/532) 70.92% (200/282)
forms Coverage: 85%
85.81% (1640/1911) 75.77% (929/1226) 84.24% (460/546)
http Coverage: 100%
100% (85/85) 98.07% (51/52) 100% (34/34)
sagas Coverage: 92%
92.3% (24/26) 66.66% (4/6) 50% (2/4)
stepper Coverage: 80%
81.52% (150/184) 59.34% (54/91) 80.85% (38/47)
utils Coverage: 100%
100% (73/73) 90.9% (10/11) 100% (24/24)

@yyanwang yyanwang temporarily deployed to pull_request_unsafe December 4, 2024 04:01 — with GitHub Actions Inactive
@@ -1,4 +1,4 @@
import { rest } from 'msw';
import { http, HttpResponse, } from 'msw';
Copy link
Member Author

Choose a reason for hiding this comment

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

rest renamed to http, and use HttpResponse to replace res parameter

Copy link
Member Author

@yyanwang yyanwang Dec 4, 2024

Choose a reason for hiding this comment

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

I ran npm script on-msw-upgrade to regenerate service worker file after msw upgraded.

'@talend/react-cmf': minor
'@talend/scripts-publish-local': patch
'@talend/scripts-locales': patch
---
Copy link
Member Author

Choose a reason for hiding this comment

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

For packages with major dependency upgrade, I use a minor changeset.
For packages with patch dependency upgrade, I use a patch changeset.

@yyanwang yyanwang temporarily deployed to pull_request_unsafe December 4, 2024 09:07 — with GitHub Actions Inactive
@@ -1,4 +1,4 @@
import { rest } from 'msw';
import { http, HttpResponse, } from 'msw';
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe remove the extra ,

"path-to-regexp": "^3.3.0",
"path-to-regexp": "^8.2.0",
Copy link
Collaborator

Choose a reason for hiding this comment

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

be sure you have tested an existing CMF application with the router 🙏
There are unit test that should be good but we never know.
By the way there are still a 6.0 in the lock file, so the security issue will stay. Do you know where it comes from ?

Copy link
Member Author

@yyanwang yyanwang Dec 5, 2024

Choose a reason for hiding this comment

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

Thanks for the comment!
I checked playground and vite-playground which works fine.
version 6 comes from multiple packages but 6.3.0 is a "safe" version :

=> Found "[email protected]"
info Has been hoisted to "path-to-regexp"
info Reasons this module exists
   - "workspace-aggregator-8113ffd5-c4b4-4412-9f5c-5bcfa979cb8e" depends on it
   - Hoisted from "_project_#@talend#ui-playground-vite#vite-plugin-mock#path-to-regexp"
   - Hoisted from "_project_#@talend#react-containers#msw#path-to-regexp"
   - Hoisted from "_project_#@talend#react-bootstrap#sinon#nise#path-to-regexp"
 

@yyanwang yyanwang temporarily deployed to pull_request_unsafe December 5, 2024 04:42 — with GitHub Actions Inactive
@yyanwang yyanwang temporarily deployed to pull_request_unsafe December 5, 2024 05:57 — with GitHub Actions Inactive
@yyanwang yyanwang temporarily deployed to pull_request_unsafe December 6, 2024 02:22 — with GitHub Actions Inactive
@yyanwang yyanwang temporarily deployed to pull_request_unsafe December 6, 2024 08:11 — with GitHub Actions Inactive
@yyanwang yyanwang temporarily deployed to pull_request_unsafe December 6, 2024 12:52 — with GitHub Actions Inactive
@yyanwang yyanwang temporarily deployed to pull_request_unsafe December 9, 2024 05:10 — with GitHub Actions Inactive
@yyanwang yyanwang merged commit ea14b87 into master Dec 9, 2024
8 checks passed
@yyanwang yyanwang deleted the DGHT-287-fe-upgrade-dependency-talend-ui branch December 9, 2024 08:11
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.

3 participants