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

build(deps): bump node from 16 to 18 #2285

Merged
merged 2 commits into from
Feb 5, 2024
Merged

Conversation

halfwhole
Copy link
Contributor

@halfwhole halfwhole commented Oct 23, 2023

Problem

Node 16 is now deprecated, its security support has ended as of 11 Sep 2023

Follows up from #2078

Solution

Upgrade our servers and GitHub actions to use Node 18, whose security support is slated to end on 30 Apr 2025

Note that serverless has yet to be upgraded to node 18. This upgrade requires us to reconfigure our lambdas, and so it should be done in one shot to minimize disruption esp. to bulk upload lambdas -- see #1858 for more details

Other upgrades

The node 18 upgrade broke our Testcafe E2E tests, so I upgraded it from v1 to v2.

Unfortunately, Testcafe v2 requires TypeScript to be upgraded from v4.3 to v4.7.4. In turn, a whole bunch of downstream changes needed to be made:

  • Dependencies:
    • Upgrade react-i18next
    • Upgrade ts-node, ts-node-dev, ts-loader (dev dependencies)
    • Upgrade @typescript-eslint/eslint-plugin and @typescript-eslint/parser (dev dependencies)
  • Code changes:
    • navigator.msSaveBlob (used for old IE support, see Fix download CSV on IE #148) no longer exists as of TypeScript v4.4 (see relevant Stackoverflow thread)
      • Ignored using @ts-ignore
    • Caught errors default to type unknown as of TypeScript v4.4 (docs), so we can't use .message on it
      • Cast it back to Error using (error as Error), lmk if doing this is problematic

Tests

  • Tested on staging

Deploy Notes

Be a bit more careful with testing pre-release

Comment on lines -96 to -97
// Close drawer
await t.click(closeButtonSnackBar)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this line is making our e2e tests fail. it's unnecessary, the drawer closes by itself after transferring the link
closeButtonSnackbar is actually something else entirely, it refers to this close button:
Screenshot 2024-01-02 at 11 57 19 AM

@halfwhole
Copy link
Contributor Author

halfwhole commented Jan 2, 2024

@gweiying would you mind helping to check why the security/snyk (gweiying) test is failing? i don't have permissions to look into that snyk organisation 🥲
suspect the failure is due to the (error as Error) changes re-triggering some code vulnerabilities that we previously ignored, but i'm not sure about this
edit: turns out it's because snyk flagged ansi-regex as a newly-introduced high-severity dependency through bcrypt@5.1.0, but this appears to be a false positive

Copy link
Contributor

@gweiying gweiying left a comment

Choose a reason for hiding this comment

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

lgtm! removed gogovsg from my personal org, was a mistake on my part!

@halfwhole halfwhole merged commit 3ef2dd0 into develop Feb 5, 2024
33 of 34 checks passed
@halfwhole halfwhole deleted the build/deps/update-node-18 branch February 5, 2024 08:04
@halfwhole halfwhole mentioned this pull request Feb 19, 2024
19 tasks
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.

None yet

2 participants