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

Update nodejs to 22.12.0 #7592

Merged
merged 10 commits into from
Mar 12, 2025
Merged

Conversation

DeanElliott96
Copy link
Contributor

@DeanElliott96 DeanElliott96 commented Mar 6, 2025

Description of change

This will be easier to review per commit as the import attribute change required changing 40+ files.

Code changes

Import attributes
JSON file import attribute changes for Node.js v22:
Old: import blah from './some_json_file.json' assert { type: 'json' }
New: import blah from './some_json_file.json' with { type: 'json' }

Babel config also needed to be modified to allow it to parse this syntax otherwise the functional tests were failing.
https://babeljs.io/docs/babel-plugin-syntax-import-attributes

Proxyquire
Updated import to use require like the other existing unit tests as it was conflicting between commonJS and ESM.

Build/Docker changes

Docker
Docker has an image for node 22.14 but not 22.12, this conflicts with paketo build pack which only supports up to 22.12 at the moment.

Paketo build packs
The latest buildpack supported by the platform team is found here: https://github.com/uktrade/ci-image-builder/blob/main/image_builder/configuration/builder_configuration.yml

This is behind the latest buildpack available and only supports up to node v22.12. Currently the latest buildpack supports node v.22.13. The official node docker images use node v22.14. This may not cause any issues but will be good to update the build packs as soon as they release with node 22.14.

Lates buildpack uses node-engine v5.2.5: https://github.com/paketo-buildpacks/builder-jammy-full/releases/tag/v0.3.463
Buildpack node-engine supports node 22.13, not 22.14: https://github.com/paketo-buildpacks/node-engine/releases/tag/v5.2.5

Test instructions

What should I see?

No changes, everything working as before.

Checklist

  • Has the branch been rebased to main?
  • Automated tests (Any of the following when applicable: Unit, Functional or End-to-End)
  • Manual compatibility testing (Browsers: Chrome, Firefox, Edge, Safari)

@DeanElliott96 DeanElliott96 self-assigned this Mar 6, 2025
Copy link

cypress bot commented Mar 7, 2025

data-hub-frontend    Run #59651

Run Properties:  status check passed Passed #59651  •  git commit 44ce4b5ba2: Update for new docker image on GCR
Project data-hub-frontend
Branch Review chore/CPS-685-upgrade-node-to-22.14
Run status status check passed Passed #59651
Run duration 01m 39s
Commit git commit 44ce4b5ba2: Update for new docker image on GCR
Committer Dean Elliott
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 15
View all changes introduced in this branch ↗︎

Copy link

codecov bot commented Mar 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.97%. Comparing base (c59b8c5) to head (44ce4b5).
Report is 11 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7592   +/-   ##
=======================================
  Coverage   89.97%   89.97%           
=======================================
  Files        1133     1133           
  Lines       17546    17546           
  Branches     5082     5082           
=======================================
  Hits        15787    15787           
  Misses       1759     1759           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DeanElliott96 DeanElliott96 changed the title Update nodejs to 22.13.0 Update nodejs to 22.12.0 Mar 11, 2025
@DeanElliott96 DeanElliott96 force-pushed the chore/CPS-685-upgrade-node-to-22.14 branch from ab2b165 to 6920951 Compare March 11, 2025 17:23
@DeanElliott96 DeanElliott96 force-pushed the chore/CPS-685-upgrade-node-to-22.14 branch from 6920951 to 44ce4b5 Compare March 11, 2025 21:53
@DeanElliott96 DeanElliott96 removed the WIP label Mar 11, 2025
@DeanElliott96 DeanElliott96 marked this pull request as ready for review March 11, 2025 22:14
@DeanElliott96 DeanElliott96 requested a review from a team as a code owner March 11, 2025 22:14
Copy link
Contributor

@oliverjwroberts oliverjwroberts left a comment

Choose a reason for hiding this comment

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

One minor issue with bullet point numbering, but otherwise looks good. Nice work Dean!

@DeanElliott96 DeanElliott96 merged commit 95be91a into main Mar 12, 2025
16 checks passed
@DeanElliott96 DeanElliott96 deleted the chore/CPS-685-upgrade-node-to-22.14 branch March 12, 2025 13:56
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.

4 participants