Skip to content

Commit

Permalink
Merge pull request #6682 from opengovsg/release_v6.74.1
Browse files Browse the repository at this point in the history
build: release v6.74.1
  • Loading branch information
KenLSM authored Aug 31, 2023
2 parents ab4001f + 1c96e9e commit bcd292f
Show file tree
Hide file tree
Showing 82 changed files with 23,328 additions and 288 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/aws-deploy-scanner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: AWS Deploy Scanner

on:
workflow_call:
inputs:
environment:
description: 'Deployment environment'
required: true
type: string
provisionedConcurrency:
description: 'Provisioned concurrency'
required: true
type: number

permissions:
id-token: write
contents: read

jobs:
virus-scanner:
name: virus scanner serverless
runs-on: ubuntu-latest

steps:
- name: Checkout source code from specified branch if it is a scheduled run
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' }}

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'

- name: Cache Node.js modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.OS }}-node-scanner-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-scanner-
${{ runner.OS }}-node-
- name: Configure AWS credentials
uses: aws-actions/[email protected]
with:
role-to-assume: ${{ secrets.AWS_CI_ROLE_TO_ASSUME }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}

- name: Install node dependencies
working-directory: ./serverless/virus-scanner
run: npm ci

- name: Deploy with Serverless Framework
working-directory: ./serverless/virus-scanner
env:
ENV: ${{ inputs.environment }}
CONCURRENCY: ${{ inputs.provisionedConcurrency }}
run: npm run deploy
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
node-version: 14
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- run: npm ci
- run: npm ci && npm ci --prefix serverless/virus-scanner
- run: npm run test:backend
- name: Coveralls
uses: coverallsapp/github-action@master
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/deploy-virus-scanner-production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Deploy to production

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

permissions:
id-token: write
contents: read

on:
push:
branches:
- production
# schedule builds for 12:00AM GMT+8 everyday to get latest virus definitions
schedule:
- cron: '0 16 * * *'

jobs:
deploy-scanner:
name: Deploy Scanner
uses: ./.github/workflows/aws-deploy-scanner.yml
with:
environment: 'production'
provisionedConcurrency: 5
secrets: inherit
26 changes: 26 additions & 0 deletions .github/workflows/deploy-virus-scanner-staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Deploy to staging

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

permissions:
id-token: write
contents: read

on:
push:
branches:
- staging
# schedule builds for 12:00AM GMT+8 everyday to get latest virus definitions
schedule:
- cron: '0 16 * * *'

jobs:
deploy-scanner:
name: Deploy Scanner
uses: ./.github/workflows/aws-deploy-scanner.yml
with:
environment: 'staging'
provisionedConcurrency: 1
secrets: inherit
26 changes: 26 additions & 0 deletions .github/workflows/deploy-virus-scanner-uat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Deploy to uat

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

permissions:
id-token: write
contents: read

on:
push:
branches:
- uat
# schedule builds for 12:00AM GMT+8 everyday to get latest virus definitions
schedule:
- cron: '0 16 * * *'

jobs:
deploy-scanner:
name: Deploy Scanner
uses: ./.github/workflows/aws-deploy-scanner.yml
with:
environment: 'uat'
provisionedConcurrency: 1
secrets: inherit
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.12.1
2 changes: 2 additions & 0 deletions .template-env
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ ATTACHMENT_S3_BUCKET=
IMAGE_S3_BUCKET=
STATIC_ASSETS_S3_BUCKET=
LOGO_S3_BUCKET=
VIRUS_SCANNER_QUARANTINE_S3_BUCKET=
VIRUS_SCANNER_CLEAN_S3_BUCKET=
SES_HOST=
SES_PASS=
SES_USER=
Expand Down
40 changes: 37 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,31 @@ 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.73.0](https://github.com/opengovsg/FormSG/compare/v6.73.0...v6.73.0)

#### [v6.74.1](https://github.com/opengovsg/FormSG/compare/v6.74.0...v6.74.1)

- fix: payment quantity modal input inconsistencies [`#6681`](https://github.com/opengovsg/FormSG/pull/6681)

#### [v6.74.0](https://github.com/opengovsg/FormSG/compare/v6.73.0...v6.74.0)

> 31 August 2023

- chore: remove dangling comments [`#6676`](https://github.com/opengovsg/FormSG/pull/6676)
- chore(deps): bump mongodb from 5.1.0 to 5.8.0 in /scripts/20230317_whitespace_issue [`#6677`](https://github.com/opengovsg/FormSG/pull/6677)
- fix: platform api v1 - return appropriate status code for MissingUserError [`#6675`](https://github.com/opengovsg/FormSG/pull/6675)
- feat: payment quantity selector [`#6669`](https://github.com/opengovsg/FormSG/pull/6669)
- fix: allow submission when Myinfo child field is hidden by logic [`#6673`](https://github.com/opengovsg/FormSG/pull/6673)
- fix(deps): bump type-fest from 4.3.0 to 4.3.1 in /shared [`#6674`](https://github.com/opengovsg/FormSG/pull/6674)
- fix: Myinfo Child DOB [`#6648`](https://github.com/opengovsg/FormSG/pull/6648)
- fix(deps): bump libphonenumber-js from 1.10.41 to 1.10.43 in /shared [`#6672`](https://github.com/opengovsg/FormSG/pull/6672)
- feat: virus scanner for storage mode submissions [`#6642`](https://github.com/opengovsg/FormSG/pull/6642)
- chore: replace url with updated gogov links [`#6658`](https://github.com/opengovsg/FormSG/pull/6658)
- feat: enable myinfo child vax field [`#6652`](https://github.com/opengovsg/FormSG/pull/6652)
- fix(deps): bump type-fest from 4.2.0 to 4.3.0 in /shared [`#6668`](https://github.com/opengovsg/FormSG/pull/6668)
- build: merge v6.73.0 into develop [`#6659`](https://github.com/opengovsg/FormSG/pull/6659)
- build: release v6.73.0 [`#6657`](https://github.com/opengovsg/FormSG/pull/6657)
- fix: add specific payment descriptions logic for payment types [`#6651`](https://github.com/opengovsg/FormSG/pull/6651)
- chore: bump version to v6.73.0 [`1476fae`](https://github.com/opengovsg/FormSG/commit/1476fae0cd5685dd4fc2e23732f59547a7fb260e)
- chore: bump version to v6.74.0 [`2ce5099`](https://github.com/opengovsg/FormSG/commit/2ce5099f26ba616b516e8b5c0e9e914bbb11f65c)

#### [v6.73.0](https://github.com/opengovsg/FormSG/compare/v6.72.0...v6.73.0)

Expand Down Expand Up @@ -119,7 +141,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- build: release v6.67.0 [`#6555`](https://github.com/opengovsg/FormSG/pull/6555)
- chore: bump version to 6.67.1 [`b641094`](https://github.com/opengovsg/FormSG/commit/b641094d40a67a888e3a8ac967a43f9d1732bd49)

#### [v6.67.0](https://github.com/opengovsg/FormSG/compare/v6.66.0...v6.67.0)
#### [v6.67.0](https://github.com/opengovsg/FormSG/compare/v6.66.1...v6.67.0)

> 20 July 2023

Expand All @@ -129,8 +151,20 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- build: release v6.66.0 [`#6550`](https://github.com/opengovsg/FormSG/pull/6550)
- feat: MyInfo Children compound fields beta [`#6523`](https://github.com/opengovsg/FormSG/pull/6523)
- ci: adjust timeouts for playwright pipe [`#6551`](https://github.com/opengovsg/FormSG/pull/6551)
- fix: use proof-of-payment for payment receipt/invoice [`#6549`](https://github.com/opengovsg/FormSG/pull/6549)
- build(deps-dev): bump word-wrap from 1.2.3 to 1.2.4 in /frontend [`#6548`](https://github.com/opengovsg/FormSG/pull/6548)
- fix(deps): bump word-wrap from 1.2.3 to 1.2.4 [`#6547`](https://github.com/opengovsg/FormSG/pull/6547)
- build(deps): bump winston-cloudwatch to v6.2.0 [`#6545`](https://github.com/opengovsg/FormSG/pull/6545)
- chore: bump version to v6.66.0 [`0233ba8`](https://github.com/opengovsg/FormSG/commit/0233ba8018532d4978d13717fac065f81e2eb515)
- chore: bump version to v6.67.0 [`6ca03c6`](https://github.com/opengovsg/FormSG/commit/6ca03c68cb162a4ae3af01f172425b3305742ae0)

#### [v6.66.1](https://github.com/opengovsg/FormSG/compare/v6.66.0...v6.66.1)

> 18 July 2023

- revert: build(deps): bump winston-cloudwatch version to 6.2.0 [`#6542`](https://github.com/opengovsg/FormSG/pull/6542)
- chore: bump version to v6.66.0 [`b3a9818`](https://github.com/opengovsg/FormSG/commit/b3a9818762e334bc7126c029cdba63156bac85ed)

#### [v6.66.0](https://github.com/opengovsg/FormSG/compare/v6.65.0...v6.66.0)

> 19 July 2023
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.development
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser

# Chinese fonts
RUN echo @edge http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories && apk add wqy-zenhei@edge
RUN echo @edge http://dl-cdn.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories && apk add wqy-zenhei@edge

# Avoid using globs as there seems to be some inconsistency in the way dockerfile handles globs
# * https://github.com/moby/moby/issues/15858
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.production
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser

# This package is needed to render Chinese characters in autoreply PDFs
RUN echo @edge http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories && apk add font-wqy-zenhei@edge
RUN echo @edge http://dl-cdn.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories && apk add font-wqy-zenhei@edge
ENV CHROMIUM_BIN=/usr/bin/chromium-browser

# Run as non-privileged user
Expand Down
2 changes: 2 additions & 0 deletions __tests__/setup/.test-env
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ IMAGE_S3_BUCKET=local-image-bucket
LOGO_S3_BUCKET=local-logo-bucket
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
NODE_ENV=test
FORMSG_SDK_MODE=test

Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ services:
- IMAGE_S3_BUCKET=local-image-bucket
- LOGO_S3_BUCKET=local-logo-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
- FORMSG_SDK_MODE=development
- BOUNCE_LIFE_SPAN=86400000
- AWS_ACCESS_KEY_ID=fakeKey
Expand Down
24 changes: 13 additions & 11 deletions docs/DEPLOYMENT_SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,17 +204,19 @@ SITE_BANNER_CONTENT=hello:This is an invalid banner type, and the full text will
#### AWS services

| Variable | Description |
| :---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `AWS_REGION` | AWS region. |
| `AWS_ACCESS_KEY_ID` | AWS IAM access key ID used to access S3. |
| `AWS_SECRET_ACCESS_KEY` | AWS IAM access secret used to access S3. |
| `AWS_ENDPOINT` | AWS S3 bucket endpoint. |
| `IMAGE_S3_BUCKET` | Name of S3 bucket for image field uploads. |
| `STATIC_ASSETS_S3_BUCKET` | Name of S3 bucket for static assets. |
| `LOGO_S3_BUCKET` | Name of S3 bucket for form logo uploads. |
| `ATTACHMENT_S3_BUCKET` | Name of S3 bucket for attachment uploads on Storage Mode. |
| `CUSTOM_CLOUDWATCH_LOG_GROUP` | Name of CloudWatch log group to send custom logs. Use this if you want some logs to have custom settings, e.g. shorter expiry time. |
| Variable | Description |
| :----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `AWS_REGION` | AWS region. |
| `AWS_ACCESS_KEY_ID` | AWS IAM access key ID used to access S3. |
| `AWS_SECRET_ACCESS_KEY` | AWS IAM access secret used to access S3. |
| `AWS_ENDPOINT` | AWS S3 bucket endpoint. |
| `IMAGE_S3_BUCKET` | Name of S3 bucket for image field uploads. |
| `STATIC_ASSETS_S3_BUCKET` | Name of S3 bucket for static assets. |
| `LOGO_S3_BUCKET` | Name of S3 bucket for form logo uploads. |
| `VIRUS_SCANNER_QUARANTINE_S3_BUCKET` | Name of S3 bucket for quarantined files. |
| `VIRUS_SCANNER_CLEAN_S3_BUCKET` | Name of S3 bucket for clean files. |
| `ATTACHMENT_S3_BUCKET` | Name of S3 bucket for attachment uploads on Storage Mode. |
| `CUSTOM_CLOUDWATCH_LOG_GROUP` | Name of CloudWatch log group to send custom logs. Use this if you want some logs to have custom settings, e.g. shorter expiry time. |

#### [FormSG JavaScript SDK](https://www.npmjs.com/package/@opengovsg/formsg-sdk)

Expand Down
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.73.0",
"version": "6.74.0",
"homepage": ".",
"private": true,
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,6 @@ export const CREATE_MYINFO_CHILDREN_SUBFIELDS_OPTIONS: {
label: string
}[] = Object.values(MyInfoChildAttributes)
.filter((e) => e !== MyInfoChildAttributes.ChildName)
// TODO awaiting approval from MyInfo to get child vaccination status.
// Disabling in the frontend for now.
.filter((e) => e !== MyInfoChildAttributes.ChildVaxxStatus)
.map((value) => {
return {
value,
Expand Down
12 changes: 2 additions & 10 deletions frontend/src/features/myinfo/utils/extractPreviewValue.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
import { format, parse } from 'date-fns'

import { BasicField, MyInfoPrefilledFormField } from '~shared/types'

import { DATE_PARSE_FORMAT } from '~templates/Field/Date/DateField'
import { formatMyinfoDate } from '~shared/utils/dates'

type PrefilledMyInfoValue = string | { value: string }

const MYINFO_DATE_FORMAT = 'yyyy-MM-dd'

export const extractPreviewValue = ({
fieldType,
fieldValue,
Expand All @@ -21,10 +16,7 @@ export const extractPreviewValue = ({
value: fieldValue,
}
case BasicField.Date:
return format(
parse(fieldValue, MYINFO_DATE_FORMAT, new Date()),
DATE_PARSE_FORMAT,
)
return formatMyinfoDate(fieldValue)
default:
return fieldValue
}
Expand Down
Loading

0 comments on commit bcd292f

Please sign in to comment.