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: update hydrogen alpine #6752

Merged
merged 19 commits into from
Sep 29, 2023
Merged

Conversation

sebastianwzq
Copy link
Contributor

@sebastianwzq sebastianwzq commented Sep 27, 2023

Problem

Resolve node vulnerabilities raised by Snyk

Closes FRM-1320

Solution

Update docker images to use hydrogen-alpine3.16 to hydrogen-alpine3.18
Node version for hydrogen-alpine3.16 is 18.12.1 and node version for hydrogen-alpine3.18 is 18.17.1
Node version changelog

Updating Chromium as the Chromium version currently available on alpine3.18 is 115.0.5790.170-r0

[Update] Updating Chromium as the Chromium version currently available on alpine3.18 is 117.0.5938.62-r0

From the puppeteer issue discussion thread, there are tight version requirements between Chromium and puppeteer. We can check for the version mapping between Chromium and puppeteer by looking at the puppeteer's release notes.

[Update] From the puppeteer issue discussion thread, there are tight version requirements between Chromium and puppeteer. We can check for the version mapping between Chromium and puppeteer by looking at the puppeteer's release notes.

Upgraded our CI from node 14 to node 18. Had to make some changes to our CI due to the higher memory consumption causing tests to exit before completion. Concretely,

  • Cache node modules so that we only run npm ci once instead of running it on every step
  • Increasing the swapfile to prevent CI from failing when the worker runs out of memory.

Breaking Changes

  • Yes - this PR contains breaking changes
    • Details ...
  • No - this PR is backwards compatible

Tests

  • Email and storage mode submissions should work
  • Email responses should be receivable
  • Storage mode responses should be retrievable
  • PDF response for email mode should be generated correctly
  • Payment invoice should be generated correctly

@linear
Copy link

linear bot commented Sep 27, 2023

FRM-1320 Triage, investigate “High” vulnerabilities as listed in Snyk

Description

Remediate if deemed necessary.

Find all the listed vulnerabilities through https://app.snyk.io/.

Link FormSG to your account if you have not.

Problem

opengovsg/FormSG:Dockerfile.development + .production

package.json

Solution

Determine if we can follow recommendation proposed above

Additional context

This has been something that we keep saying that we want to do for a few sprints, but have not had time to handle this.

@sebastianwzq sebastianwzq temporarily deployed to staging-alt2 September 27, 2023 09:50 — with GitHub Actions Inactive
@sebastianwzq sebastianwzq temporarily deployed to staging September 28, 2023 05:27 — with GitHub Actions Inactive
Copy link
Contributor

@LinHuiqing LinHuiqing left a comment

Choose a reason for hiding this comment

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

lgtm!

@@ -26,7 +26,7 @@
"scripts": {
"postinstall": "npm run postinstall:frontend && npm run postinstall:shared",
"test": "npm run test:backend && npm run test:frontend",
"test:backend": "env-cmd -f __tests__/setup/.test-env jest --coverage --maxWorkers=4",
"test:backend": "env-cmd -f __tests__/setup/.test-env jest --coverage --maxWorkers=4 --testTimeout=90000",
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this needed to reduce BE test flakiness? 😮 This timeout is for individual tests, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, timeout is for individual test, Jest performance declined with newer node versions so I increased the timeout until a fix is available

Copy link
Contributor

Choose a reason for hiding this comment

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

/suggestion: there is already existing config in jest.config.js, suggestion to update there instead of passing in as cli arg (or passing in CLI is fine too, but we should then remove from jest.config)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, will move over in the second part of the MR

Copy link
Contributor

@tshuli tshuli left a comment

Choose a reason for hiding this comment

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

lgtm!

@sebastianwzq sebastianwzq merged commit 283bc47 into develop Sep 29, 2023
15 checks passed
@sebastianwzq sebastianwzq deleted the chore/update-hydrogen-alpine branch September 29, 2023 05:07
@KenLSM KenLSM mentioned this pull request Oct 3, 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.

4 participants