Skip to content

Commit

Permalink
Merge pull request #6762 from opengovsg/release_v6.79.0
Browse files Browse the repository at this point in the history
build: release v6.79.0
  • Loading branch information
LinHuiqing authored Oct 3, 2023
2 parents 1e366d0 + 5ff86cd commit 9153ccb
Show file tree
Hide file tree
Showing 57 changed files with 22,581 additions and 17,493 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/aws-deploy-scanner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
description: 'Provisioned concurrency'
required: true
type: number
checkoutBranch:
description: 'Branch to checkout code from'
required: true
type: string

permissions:
id-token: write
Expand All @@ -22,15 +26,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout source code from specified branch if it is a scheduled run
- name: Checkout source code from specified checkout branch
uses: actions/checkout@v3
if: ${{ github.event_name == 'schedule' }}
with:
ref: ${{ inputs.environment }}

- name: Checkout source code
uses: actions/checkout@v3
if: ${{ github.event_name != 'schedule' }}
ref: ${{ inputs.checkoutBranch }}

- name: Setup Node.js
uses: actions/setup-node@v3
Expand Down
73 changes: 60 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,14 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 14
node-version: 18
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: Cache Node modules
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.OS }}-node-modules-${{ hashFiles('**/package-lock.json') }}
- run: npm ci

build:
Expand All @@ -51,13 +56,18 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 14
node-version: 18
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- run: npm ci
# Load cached node_modules
- name: Cache Node modules
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.OS }}-node-modules-${{ hashFiles('**/package-lock.json') }}
- run: npm run build
env:
NODE_OPTIONS: '--max-old-space-size=4096'
NODE_OPTIONS: '--max-old-space-size=4096 --openssl-legacy-provider'
- name: Upload build files
uses: actions/upload-artifact@v2
if: always()
Expand All @@ -76,11 +86,19 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 14
node-version: 18
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- run: npm ci
- run: npm run test:frontend
# Load cached node_modules
- name: Cache Node modules
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.OS }}-node-modules-${{ hashFiles('**/package-lock.json') }}
- name: Run frontend test
env:
NODE_OPTIONS: --max-old-space-size=4096
run: npm run test:frontend

frontend_lint:
needs: [changes, install]
Expand All @@ -91,17 +109,33 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 14
node-version: 18
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- run: npm ci
# Load cached node_modules
- name: Cache Node modules
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.OS }}-node-modules-${{ hashFiles('**/package-lock.json') }}
- run: npm run lint:frontend

backend_test:
needs: [changes, install, build]
if: ${{ needs.changes.outputs.backend == 'true' }}
runs-on: ubuntu-latest
steps:
# prevent CI from failing when worker runs out of memory
# https://github.com/actions/runner-images/discussions/7188#discussioncomment-6750749
- name: Increase swapfile
run: |
df -h
sudo swapoff -a
sudo fallocate -l 15G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon --show
- uses: actions/checkout@v2
- uses: actions/download-artifact@v3
if: always()
Expand All @@ -110,11 +144,19 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 14
node-version: 18
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- run: npm ci && npm ci --prefix serverless/virus-scanner
# Load cached node_modules
- name: Cache Node modules
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.OS }}-node-modules-${{ hashFiles('**/package-lock.json') }}
- run: npm ci --prefix serverless/virus-scanner
- run: npm run test:backend
env:
NODE_OPTIONS: '--max-old-space-size=4096'
- name: Coveralls
uses: coverallsapp/github-action@master
with:
Expand All @@ -129,9 +171,14 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 14
node-version: 18
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- run: npm ci
# Load cached node_modules
- name: Cache Node modules
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.OS }}-node-modules-${{ hashFiles('**/package-lock.json') }}
- run: npm run lint-ci
- run: npm_config_mode=yes npx lockfile-lint --type npm --path package.json --validate-https --allowed-hosts npm
1 change: 1 addition & 0 deletions .github/workflows/deploy-virus-scanner-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ jobs:
with:
environment: 'production'
provisionedConcurrency: 5
checkoutBranch: 'release-al2'
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/deploy-virus-scanner-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ jobs:
with:
environment: 'staging'
provisionedConcurrency: 1
checkoutBranch: 'staging'
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/deploy-virus-scanner-uat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ jobs:
with:
environment: 'uat'
provisionedConcurrency: 1
checkoutBranch: 'uat'
secrets: inherit
1 change: 1 addition & 0 deletions .template-env
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ DB_HOST=

## AWS Config
ATTACHMENT_S3_BUCKET=
PAYMENT_PROOF_S3_BUCKET=
IMAGE_S3_BUCKET=
STATIC_ASSETS_S3_BUCKET=
LOGO_S3_BUCKET=
Expand Down
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,32 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [v6.79.0](https://github.com/opengovsg/FormSG/compare/v6.78.2...v6.79.0)

- feat: rename NRIC field to NRIC/FIN [`#6759`](https://github.com/opengovsg/FormSG/pull/6759)
- chore: fix snyk vulnerabilities [`#6728`](https://github.com/opengovsg/FormSG/pull/6728)
- chore: update hydrogen alpine [`#6752`](https://github.com/opengovsg/FormSG/pull/6752)
- fix(deps): bump libphonenumber-js from 1.10.43 to 1.10.45 in /shared [`#6753`](https://github.com/opengovsg/FormSG/pull/6753)
- feat(payment): invoice through s3 [`#6733`](https://github.com/opengovsg/FormSG/pull/6733)
- fix: reinstate MyInfo verified field indicator for MyInfo child DOB [`#6751`](https://github.com/opengovsg/FormSG/pull/6751)
- feat(virus-scanner): download clean file [`#6747`](https://github.com/opengovsg/FormSG/pull/6747)
- fix: rm growthbook legacy streaming prop [`#6744`](https://github.com/opengovsg/FormSG/pull/6744)
- chore: use correct branch for scanner cron job [`#6746`](https://github.com/opengovsg/FormSG/pull/6746)
- revert: "chore: update hydrogen-alpine version (#6720)" [`#6748`](https://github.com/opengovsg/FormSG/pull/6748)
- feat(virus-scanner): invoke lambda to scan file [`#6734`](https://github.com/opengovsg/FormSG/pull/6734)
- fix: redirect to frontend app after myinfo log in (for local dev environment) [`#6743`](https://github.com/opengovsg/FormSG/pull/6743)
- chore: update hydrogen-alpine version [`#6720`](https://github.com/opengovsg/FormSG/pull/6720)
- fix: display error message when myinfo child fields are not filled in [`#6735`](https://github.com/opengovsg/FormSG/pull/6735)
- build: merge v6.78.2 back into develop [`#6742`](https://github.com/opengovsg/FormSG/pull/6742)
- fix: hotfix for 500 errors thrown on email bounce notification endpoint [`#6741`](https://github.com/opengovsg/FormSG/pull/6741)
- build: merge v6.78.1 into develop [`#6738`](https://github.com/opengovsg/FormSG/pull/6738)

#### [v6.78.2](https://github.com/opengovsg/FormSG/compare/v6.78.1...v6.78.2)

> 21 September 2023

- build: release v6.78.0 [`#6736`](https://github.com/opengovsg/FormSG/pull/6736)
- chore: bump version to 6.78.2 [`c15f993`](https://github.com/opengovsg/FormSG/commit/c15f9932295d994a93fc28cc0ee294cd3961972e)
- fix: correctly parse bounce notification commonHeaders.to [`849efad`](https://github.com/opengovsg/FormSG/commit/849efad49a5d7da23239c2c3a8a7275ad8415fa5)

#### [v6.78.1](https://github.com/opengovsg/FormSG/compare/v6.78.0...v6.78.1)
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.development
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:hydrogen-alpine3.16
FROM node:hydrogen-alpine3.18
LABEL maintainer=FormSG<[email protected]>

WORKDIR /opt/formsg
Expand Down Expand Up @@ -28,7 +28,7 @@ RUN apk update && apk upgrade && \
# that is guaranteed to work. Upgrades must be done in lockstep.
# https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md#running-on-alpine
# https://www.npmjs.com/package/puppeteer-core?activeTab=versions for corresponding versions
chromium=102.0.5005.182-r0 \
chromium=117.0.5938.62-r0 \
nss \
freetype \
freetype-dev \
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile.production
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

FROM node:hydrogen-alpine3.16 as build
FROM node:hydrogen-alpine3.18 as build

# node-modules-builder stage installs/compiles the node_modules folder
# Python version must be specified starting in alpine3.12
Expand Down Expand Up @@ -60,7 +60,7 @@ RUN --mount=type=secret,id=dd_api_key \
RUN npm prune --production --legacy-peer-deps

# This stage builds the final container
FROM node:hydrogen-alpine3.16
FROM node:hydrogen-alpine3.18
LABEL maintainer=FormSG<[email protected]>
WORKDIR /opt/formsg

Expand All @@ -81,7 +81,7 @@ RUN mv /opt/formsg/dist/backend/shared /opt/formsg/
# https://www.npmjs.com/package/puppeteer-core?activeTab=versions for corresponding versions

RUN apk add --no-cache \
chromium=102.0.5005.182-r0 \
chromium=117.0.5938.62-r0 \
nss \
freetype \
freetype-dev \
Expand Down
1 change: 1 addition & 0 deletions __tests__/setup/.test-env
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ ATTACHMENT_S3_BUCKET=local-attachment-bucket
STATIC_ASSETS_S3_BUCKET=local-static-assets-bucket
VIRUS_SCANNER_QUARANTINE_S3_BUCKET=local-virus-scanner-quarantine-bucket
VIRUS_SCANNER_CLEAN_S3_BUCKET=local-virus-scanner-clean-bucket
PAYMENT_PROOF_S3_BUCKET=local-payment-proof-bucket
NODE_ENV=test
FORMSG_SDK_MODE=test

Expand Down
5 changes: 5 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ services:
- DB_HOST=mongodb://database:27017/formsg
- APP_NAME=FormSG
- APP_URL=http://localhost:5001
- FE_APP_URL=http://localhost:3000
- ATTACHMENT_S3_BUCKET=local-attachment-bucket
- PAYMENT_PROOF_S3_BUCKET=local-payment-proof-bucket
- IMAGE_S3_BUCKET=local-image-bucket
- LOGO_S3_BUCKET=local-logo-bucket
- STATIC_ASSETS_S3_BUCKET=local-static-assets-bucket
Expand Down Expand Up @@ -115,6 +117,7 @@ services:
- PAYMENT_MIN_PAYMENT_AMOUNT_CENTS=50
- SSM_ENV_SITE_NAME=development
- PAYMENT_GUIDE_LINK
- PAYMENT_LANDING_GUIDE_LINK
# Cron secrets
- CRON_PAYMENT_API_SECRET=secretKey
# env vars for go integration
Expand All @@ -123,6 +126,8 @@ services:
- API_KEY_VERSION=v1
# env vars for growthbook
- GROWTHBOOK_CLIENT_KEY
# env vars for virus scanner
- VIRUS_SCANNER_LAMBDA_FUNCTION_NAME=function

mockpass:
build: https://github.com/opengovsg/mockpass.git#v4.0.4
Expand Down
1 change: 1 addition & 0 deletions frontend/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ const esModules = ['react-markdown'].join('|')

module.exports = {
transformIgnorePatterns: [`node_modules/(?!${esModules})/`],
testTimeout: 5000,
}
4 changes: 2 additions & 2 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "form-frontend",
"version": "6.78.0",
"version": "6.79.0",
"homepage": ".",
"private": true,
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/AppRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const AppRouter = (): JSX.Element => {
useEffect(() => {
if (growthbook) {
// Load features from the GrowthBook API
growthbook.loadFeatures({ autoRefresh: true })
growthbook.loadFeatures()
}
}, [growthbook])

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/features/admin-form/create/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export const BASICFIELD_TO_DRAWER_META: {
},

[BasicField.Nric]: {
label: 'NRIC',
label: 'NRIC/FIN',
icon: BiUser,
isSubmitted: true,
},
Expand Down
Loading

0 comments on commit 9153ccb

Please sign in to comment.