Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"redux-query-react": "3.3.1"
},
"resolutions": {
Comment thread
sentry[bot] marked this conversation as resolved.
"cheerio": "1.0.0-rc.12",
"cheerio": "1.2.0",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The resolutions field forces cheerio to 1.2.0, which is incompatible with the project's enzyme version (3.11.0), causing all frontend tests to fail.
Severity: CRITICAL

Suggested Fix

The cheerio resolution should be reverted or pinned to a version compatible with enzyme@3.11.0, such as 1.0.0-rc.3 or lower. Alternatively, upgrade enzyme and its adapter to versions that are compatible with cheerio@1.2.0, if available. Downgrading the cheerio resolution is likely the safer and quicker fix.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: package.json#L19

Potential issue: The `resolutions` in the root `package.json` forces all packages to use
`cheerio@1.2.0`. However, the frontend tests rely on `enzyme@3.11.0`, which is only
compatible with `cheerio` up to version `1.0.0-rc.3`. The newer `cheerio` version has
breaking structural changes, such as removing the `lib` folder that `enzyme` expects. As
a result, the test initialization in `tests_init.js` will fail, preventing over 50 test
files that depend on `enzyme` from running. This will block the CI/CD pipeline.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Updating cheerio to 1.2.0 breaks compatibility with enzyme 3.11.0, which is used in frontend tests. Enzyme will fail to import a required internal module, causing tests to crash.
Severity: CRITICAL

Suggested Fix

Downgrade the cheerio resolution in package.json back to a version compatible with enzyme 3.11.0, such as 1.0.0-rc.12. Alternatively, upgrade enzyme to a newer version that supports cheerio 1.2.0, which may require significant test refactoring.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: package.json#L19

Potential issue: The project's frontend tests rely on `enzyme` version 3.11.0. This
version of `enzyme` has a dependency on `cheerio` and requires internal modules like
`cheerio/lib/utils` that are only available in `cheerio` versions up to `1.0.0-rc.3`.
The pull request updates `cheerio` to `1.2.0` via the `resolutions` field in
`package.json`. This newer version of `cheerio` no longer exposes the required internal
modules. As a result, when the CI pipeline executes the test suite, `enzyme` will fail
to load, causing a module resolution error and a complete failure of all frontend tests.
This will block any further code merges.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The cheerio upgrade introduces a dependency on undici v7, which requires Node.js 20+. This conflicts with the project's Docker and package.json configurations that specify Node.js 17.
Severity: CRITICAL

Suggested Fix

Align the Node.js versions across all environments. Either upgrade the Dockerfile, docker-compose.yml, and package.json engines field to use a compatible Node.js 20+ version, or find a version of the dependency that does not require undici v7.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: package.json#L19

Potential issue: The update to `cheerio` to version `1.2.0` introduces a transitive
dependency on `undici` version 7, which requires Node.js 20.18.1 or higher. The
project's production `Dockerfile` and local development environment
(`docker-compose.yml`) are configured to use `node:17.9`, and the
`frontend/public/package.json` specifies a Node version of `<18`. This version mismatch
will cause the production Docker image build to fail during `yarn install` or lead to a
runtime crash if the application is deployed, as the Node.js environment does not meet
the dependency's requirements. This issue was not detected by CI because the CI pipeline
runs on Node.js 20.

"@types/react": "^17"
}
}
103 changes: 78 additions & 25 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7722,18 +7722,22 @@ __metadata:
languageName: node
linkType: hard

"cheerio@npm:1.0.0-rc.12":
version: 1.0.0-rc.12
resolution: "cheerio@npm:1.0.0-rc.12"
"cheerio@npm:1.2.0":
version: 1.2.0
resolution: "cheerio@npm:1.2.0"
dependencies:
cheerio-select: ^2.1.0
dom-serializer: ^2.0.0
domhandler: ^5.0.3
domutils: ^3.0.1
htmlparser2: ^8.0.1
parse5: ^7.0.0
parse5-htmlparser2-tree-adapter: ^7.0.0
checksum: 5d4c1b7a53cf22d3a2eddc0aff70cf23cbb30d01a4c79013e703a012475c02461aa1fcd99127e8d83a02216386ed6942b2c8103845fd0812300dd199e6e7e054
domutils: ^3.2.2
encoding-sniffer: ^0.2.1
htmlparser2: ^10.1.0
parse5: ^7.3.0
parse5-htmlparser2-tree-adapter: ^7.1.0
parse5-parser-stream: ^7.1.2
undici: ^7.19.0
whatwg-mimetype: ^4.0.0
checksum: d0e83ebd6c6533d3604e01ab5df22c1090a7adefc3f3f1d97bb6cdd25760f5f7f842f41cede377e159b093f4ad31e8dc1669f9e3b998b69eeb2aced702efd0ba
languageName: node
linkType: hard

Expand Down Expand Up @@ -9372,7 +9376,7 @@ __metadata:
languageName: node
linkType: hard

"domutils@npm:^3.0.1, domutils@npm:^3.1.0":
"domutils@npm:^3.0.1, domutils@npm:^3.1.0, domutils@npm:^3.2.2":
version: 3.2.2
resolution: "domutils@npm:3.2.2"
dependencies:
Expand Down Expand Up @@ -9535,6 +9539,16 @@ __metadata:
languageName: node
linkType: hard

"encoding-sniffer@npm:^0.2.1":
version: 0.2.1
resolution: "encoding-sniffer@npm:0.2.1"
dependencies:
iconv-lite: ^0.6.3
whatwg-encoding: ^3.1.1
checksum: d96cc88bbab6a88f57805491fa948b7b1c30f8488939fe4397c58c79ce766a1027f4c10de1893a9b5e489c4ad8ed927f6a8a87f1d114b6f3d5cb3bbbc73601d7
languageName: node
linkType: hard

"encoding@npm:^0.1.11, encoding@npm:^0.1.13":
version: 0.1.13
resolution: "encoding@npm:0.1.13"
Expand Down Expand Up @@ -9580,7 +9594,7 @@ __metadata:
languageName: node
linkType: hard

"entities@npm:^4.2.0, entities@npm:^4.4.0, entities@npm:^4.5.0":
"entities@npm:^4.2.0, entities@npm:^4.5.0":
version: 4.5.0
resolution: "entities@npm:4.5.0"
checksum: 853f8ebd5b425d350bffa97dd6958143179a5938352ccae092c62d1267c4e392a039be1bae7d51b6e4ffad25f51f9617531fedf5237f15df302ccfb452cbf2d7
Expand All @@ -9594,6 +9608,13 @@ __metadata:
languageName: node
linkType: hard

"entities@npm:^7.0.1":
version: 7.0.1
resolution: "entities@npm:7.0.1"
checksum: 5ee49e52e64eafc63251585f74eae50f259ea2169dbbf5380843dcd97c79bfe430a58e7f34012ab67a8e258f6ef9f92d721d149ffc88c89039e155f1bcf48a53
languageName: node
linkType: hard

"env-paths@npm:^2.2.0":
version: 2.2.1
resolution: "env-paths@npm:2.2.1"
Expand Down Expand Up @@ -12107,6 +12128,18 @@ __metadata:
languageName: node
linkType: hard

"htmlparser2@npm:^10.1.0":
version: 10.1.0
resolution: "htmlparser2@npm:10.1.0"
dependencies:
domelementtype: ^2.3.0
domhandler: ^5.0.3
domutils: ^3.2.2
entities: ^7.0.1
checksum: 49b8fa62dcd833b89535523c437d04069400e618b22b8dc8cd48bf6ef820752bb026c4f1fc7309d08b6016bfcd3cc0eca4ed48d5eeff4a3e010be19027d51c70
languageName: node
linkType: hard

"htmlparser2@npm:^6.1.0":
version: 6.1.0
resolution: "htmlparser2@npm:6.1.0"
Expand All @@ -12119,18 +12152,6 @@ __metadata:
languageName: node
linkType: hard

"htmlparser2@npm:^8.0.1":
version: 8.0.2
resolution: "htmlparser2@npm:8.0.2"
dependencies:
domelementtype: ^2.3.0
domhandler: ^5.0.3
domutils: ^3.0.1
entities: ^4.4.0
checksum: 29167a0f9282f181da8a6d0311b76820c8a59bc9e3c87009e21968264c2987d2723d6fde5a964d4b7b6cba663fca96ffb373c06d8223a85f52a6089ced942700
languageName: node
linkType: hard

"htmlparser2@npm:^9.0":
version: 9.1.0
resolution: "htmlparser2@npm:9.1.0"
Expand Down Expand Up @@ -12305,7 +12326,7 @@ __metadata:
languageName: node
linkType: hard

"iconv-lite@npm:^0.6.2, iconv-lite@npm:^0.6.3":
"iconv-lite@npm:0.6.3, iconv-lite@npm:^0.6.2, iconv-lite@npm:^0.6.3":
version: 0.6.3
resolution: "iconv-lite@npm:0.6.3"
dependencies:
Expand Down Expand Up @@ -16971,7 +16992,7 @@ __metadata:
languageName: node
linkType: hard

"parse5-htmlparser2-tree-adapter@npm:^7.0.0":
"parse5-htmlparser2-tree-adapter@npm:^7.1.0":
version: 7.1.0
resolution: "parse5-htmlparser2-tree-adapter@npm:7.1.0"
dependencies:
Expand All @@ -16981,14 +17002,23 @@ __metadata:
languageName: node
linkType: hard

"parse5-parser-stream@npm:^7.1.2":
version: 7.1.2
resolution: "parse5-parser-stream@npm:7.1.2"
dependencies:
parse5: ^7.0.0
checksum: 75b232d460bce6bd0e35012750a78ef034f40ccf550b7c6cec3122395af6b4553202ad3663ad468cf537ead5a2e13b6727670395fd0ff548faccad1dc2dc93cf
languageName: node
linkType: hard

"parse5@npm:6.0.1":
version: 6.0.1
resolution: "parse5@npm:6.0.1"
checksum: 7d569a176c5460897f7c8f3377eff640d54132b9be51ae8a8fa4979af940830b2b0c296ce75e5bd8f4041520aadde13170dbdec44889975f906098ea0002f4bd
languageName: node
linkType: hard

"parse5@npm:^7.0.0":
"parse5@npm:^7.0.0, parse5@npm:^7.3.0":
version: 7.3.0
resolution: "parse5@npm:7.3.0"
dependencies:
Expand Down Expand Up @@ -22973,6 +23003,13 @@ __metadata:
languageName: node
linkType: hard

"undici@npm:^7.19.0":
version: 7.25.0
resolution: "undici@npm:7.25.0"
checksum: 502f855d69dd0f343a4b4999b995b99eab8764639983776bb5afd09b50671863244defe093e7fb97df767c948d6548c0c3d97f8dbb35fec16c1c8c1c15843f17
languageName: node
linkType: hard

"unicode-canonical-property-names-ecmascript@npm:^2.0.0":
version: 2.0.1
resolution: "unicode-canonical-property-names-ecmascript@npm:2.0.1"
Expand Down Expand Up @@ -24078,6 +24115,15 @@ __metadata:
languageName: node
linkType: hard

"whatwg-encoding@npm:^3.1.1":
version: 3.1.1
resolution: "whatwg-encoding@npm:3.1.1"
dependencies:
iconv-lite: 0.6.3
checksum: f75a61422421d991e4aec775645705beaf99a16a88294d68404866f65e92441698a4f5b9fa11dd609017b132d7b286c3c1534e2de5b3e800333856325b549e3c
languageName: node
linkType: hard

"whatwg-fetch@npm:>=0.10.0, whatwg-fetch@npm:^3.6.2":
version: 3.6.20
resolution: "whatwg-fetch@npm:3.6.20"
Expand All @@ -24092,6 +24138,13 @@ __metadata:
languageName: node
linkType: hard

"whatwg-mimetype@npm:^4.0.0":
version: 4.0.0
resolution: "whatwg-mimetype@npm:4.0.0"
checksum: f97edd4b4ee7e46a379f3fb0e745de29fe8b839307cc774300fd49059fcdd560d38cb8fe21eae5575b8f39b022f23477cc66e40b0355c2851ce84760339cef30
languageName: node
linkType: hard

"whatwg-url@npm:^5.0.0":
version: 5.0.0
resolution: "whatwg-url@npm:5.0.0"
Expand Down
Loading