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: release v6.81.0 #6777

Merged
merged 6 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,25 @@ 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.81.0](https://github.com/opengovsg/FormSG/compare/v6.80.0...v6.81.0)

- feat(virus-scanner): frontend orchestration [`#6767`](https://github.com/opengovsg/FormSG/pull/6767)
- feat: add well-known domain [`#6774`](https://github.com/opengovsg/FormSG/pull/6774)
- build: merge release v6.80.0 into develop [`#6775`](https://github.com/opengovsg/FormSG/pull/6775)
- build: release v6.80.0 [`#6773`](https://github.com/opengovsg/FormSG/pull/6773)
- fix(deps): bump zod from 3.22.2 to 3.22.3 in /shared [`#6768`](https://github.com/opengovsg/FormSG/pull/6768)
- fix(deps): bump zod from 3.21.4 to 3.22.3 [`#6769`](https://github.com/opengovsg/FormSG/pull/6769)

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

> 4 October 2023

- feat: add index to myinfo child email response [`#6745`](https://github.com/opengovsg/FormSG/pull/6745)
- build: merge v6.79.0 into develop [`#6765`](https://github.com/opengovsg/FormSG/pull/6765)
- feat: add range validation to number field [`#6575`](https://github.com/opengovsg/FormSG/pull/6575)
- fix: missing errors in error mapper [`#6764`](https://github.com/opengovsg/FormSG/pull/6764)
- build: release v6.79.0 [`#6762`](https://github.com/opengovsg/FormSG/pull/6762)
- chore: bump version to v6.80.0 [`7777b7b`](https://github.com/opengovsg/FormSG/commit/7777b7bd0c83ef11175da712666b12c30efd1a95)

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

Expand Down Expand Up @@ -65,17 +77,20 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- feat: add logging to check for missing Myinfo field values [`#6694`](https://github.com/opengovsg/FormSG/pull/6694)
- build: merge v6.77.0 into develop [`#6711`](https://github.com/opengovsg/FormSG/pull/6711)
- build: release v6.77.0 [`#6710`](https://github.com/opengovsg/FormSG/pull/6710)
- build: merge v6.76.1 into develop [`#6708`](https://github.com/opengovsg/FormSG/pull/6708)
- build: release v6.76.1 [`#6702`](https://github.com/opengovsg/FormSG/pull/6702)
- fix: invalid mixed digit input [`#6701`](https://github.com/opengovsg/FormSG/pull/6701)
- chore: bump version to v6.78.0 [`f8fa1ec`](https://github.com/opengovsg/FormSG/commit/f8fa1ecbb3a5dfad3735ee01420f27967d174112)
- chore: bump version to 6.76.1 [`9e88567`](https://github.com/opengovsg/FormSG/commit/9e8856721af4e3a99b6c6fe0e31ac96414a46149)
- chore: bump version to v6.77.0 [`6b1b9b2`](https://github.com/opengovsg/FormSG/commit/6b1b9b2ed04e6bd0cdf632c642724c906062b3ac)

#### [v6.77.0](https://github.com/opengovsg/FormSG/compare/v6.76.1...v6.77.0)

> 12 September 2023

- build: merge v6.76.1 into develop [`#6708`](https://github.com/opengovsg/FormSG/pull/6708)
- feat: soften and fix storage submission validation [`#6696`](https://github.com/opengovsg/FormSG/pull/6696)
- build: release v6.76.1 [`#6702`](https://github.com/opengovsg/FormSG/pull/6702)
- build: merge v6.76.0 into develop [`#6700`](https://github.com/opengovsg/FormSG/pull/6700)
- chore: bump version to v6.77.0 [`6b1b9b2`](https://github.com/opengovsg/FormSG/commit/6b1b9b2ed04e6bd0cdf632c642724c906062b3ac)
- chore: bump version to v6.77.0 [`25876be`](https://github.com/opengovsg/FormSG/commit/25876be292b08d97c0fa14ca0ec07a78298d5f5a)

#### [v6.76.1](https://github.com/opengovsg/FormSG/compare/v6.76.0...v6.76.1)

Expand Down
11 changes: 10 additions & 1 deletion __tests__/e2e/encrypt-submission.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import mongoose from 'mongoose'
import { featureFlags } from 'shared/constants/feature-flags'
import { BasicField, FormResponseMode } from 'shared/types'

import { IFormModel } from 'src/types'
import { IFeatureFlagModel, IFormModel } from 'src/types'

import {
ALL_FIELDS as _ALL_FIELDS,
Expand Down Expand Up @@ -36,12 +37,20 @@ const runEncryptSubmissionTest = createSubmissionTestRunnerForResponseMode(

let db: mongoose.Connection
let Form: IFormModel
let FeatureFlags: IFeatureFlagModel

test.describe('Storage form submission', () => {
test.beforeAll(async () => {
// Create models
db = await makeMongooseFixtures()
Form = makeModel(db, 'form.server.model', 'Form')
// TODO(FRM-1232): Remove this once old storage submission endpoint (/submissions/encrypt) is removed
// Add feature flag model and set encryption boundary shift to true
FeatureFlags = makeModel(db, 'feature_flag.server.model', 'FeatureFlags')
await FeatureFlags.create({
name: featureFlags.encryptionBoundaryShift,
enabled: true,
})
})
test.afterAll(async () => {
// Clean up db
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.80.0",
"version": "6.81.0",
"homepage": ".",
"private": true,
"dependencies": {
Expand Down
88 changes: 73 additions & 15 deletions frontend/src/features/public-form/PublicFormProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
import { useNavigate } from 'react-router-dom'
import { useDisclosure } from '@chakra-ui/react'
import { datadogLogs } from '@datadog/browser-logs'
import { useFeatureIsOn, useGrowthBook } from '@growthbook/growthbook-react'
import {
useFeatureIsOn,
useFeatureValue,
useGrowthBook,
} from '@growthbook/growthbook-react'
import { differenceInMilliseconds, isPast } from 'date-fns'
import get from 'lodash/get'
import simplur from 'simplur'
Expand Down Expand Up @@ -143,8 +147,9 @@
}
}, [growthbook, formId])

const routeToNewStorageModeSubmission = useFeatureIsOn(
const enableEncryptionBoundaryShift = useFeatureValue(
featureFlags.encryptionBoundaryShift,
true,
)

// Scroll to top of page when user has finished their submission.
Expand Down Expand Up @@ -264,19 +269,20 @@
}
}, [data?.form.form_fields, toast, vfnToastIdRef])

const enableVirusScanner = useFeatureIsOn(
featureFlags.encryptionBoundaryShiftVirusScanner,
)

const {
submitEmailModeFormMutation,
submitStorageModeFormMutation,
submitEmailModeFormFetchMutation,
submitStorageModeFormFetchMutation,
submitStorageModeClearFormMutation,
submitStorageModeClearFormFetchMutation,
submitStorageModeClearFormWithVirusScanningMutation,
} = usePublicFormMutations(formId, submissionData?.id ?? '')

const submitStorageModeVnMutation = routeToNewStorageModeSubmission
? submitStorageModeClearFormMutation
: submitStorageModeFormMutation

const { handleLogoutMutation } = usePublicAuthMutations(formId)

const navigate = useNavigate()
Expand Down Expand Up @@ -478,7 +484,9 @@
: {}),
}

const submitStorageFormWithFetch = function () {
const submitStorageFormWithFetch = function (
routeToNewStorageModeSubmission: boolean,
) {
datadogLogs.logger.info(`handleSubmitForm: submitting via fetch`, {
meta: {
...logMeta,
Expand All @@ -487,12 +495,11 @@
},
})

const submitStorageModeVnFetchMutation =
return (
routeToNewStorageModeSubmission
? submitStorageModeClearFormFetchMutation
: submitStorageModeFormFetchMutation

return submitStorageModeVnFetchMutation
)
.mutateAsync(
{
...formData,
Expand Down Expand Up @@ -539,7 +546,7 @@

// TODO (#5826): Toggle to use fetch for submissions instead of axios. If enabled, this is used for testing and to use fetch instead of axios by default if testing shows fetch is more stable. Remove once network error is resolved
if (useFetchForSubmissions) {
return submitStorageFormWithFetch()
return submitStorageFormWithFetch(enableEncryptionBoundaryShift)
}
datadogLogs.logger.info(`handleSubmitForm: submitting via axios`, {
meta: {
Expand All @@ -549,8 +556,58 @@
},
})

// TODO (FRM-1413): Move to main return statement once virus scanner has been fully rolled out
if (enableEncryptionBoundaryShift && enableVirusScanner) {
return submitStorageModeClearFormWithVirusScanningMutation.mutateAsync(
formData,
{
onSuccess: ({
submissionId,
timestamp,
// payment forms will have non-empty paymentData field
paymentData,
}) => {
trackSubmitForm(form)

if (paymentData) {
navigate(getPaymentPageUrl(formId, paymentData.paymentId))
storePaymentMemory(paymentData.paymentId)
return
}
setSubmissionData({
id: submissionId,
timestamp,
})
},
onError: (error) => {
// TODO(#5826): Remove when we have resolved the Network Error
datadogLogs.logger.warn(
`handleSubmitForm: submit with virus scan`,
{
meta: {
...logMeta,
responseMode: 'storage',
method: 'axios',
error,
},
},
)

// defaults to the safest option of storage submission without virus scanning
return submitStorageFormWithFetch(
enableEncryptionBoundaryShift,
)
},
},
)
}

return (
submitStorageModeVnMutation
(
enableEncryptionBoundaryShift
? submitStorageModeClearFormMutation
: submitStorageModeFormMutation
)
.mutateAsync(
{
...formData,
Expand Down Expand Up @@ -595,7 +652,9 @@

if (/Network Error/i.test(error.message)) {
axiosDebugFlow()
return submitStorageFormWithFetch()
return submitStorageFormWithFetch(
enableEncryptionBoundaryShift,
)
}
showErrorToast(error, form)
})
Expand All @@ -603,7 +662,7 @@
}
}
},
[

Check warning on line 665 in frontend/src/features/public-form/PublicFormProvider.tsx

View workflow job for this annotation

GitHub Actions / frontend_lint

React Hook useCallback has missing dependencies: 'enableVirusScanner', 'submitStorageModeClearFormMutation', 'submitStorageModeClearFormWithVirusScanningMutation', and 'submitStorageModeFormMutation'. Either include them or remove the dependency array

Check warning on line 665 in frontend/src/features/public-form/PublicFormProvider.tsx

View workflow job for this annotation

GitHub Actions / frontend_lint

React Hook useCallback has missing dependencies: 'enableVirusScanner', 'submitStorageModeClearFormMutation', 'submitStorageModeClearFormWithVirusScanningMutation', and 'submitStorageModeFormMutation'. Either include them or remove the dependency array

Check warning on line 665 in frontend/src/features/public-form/PublicFormProvider.tsx

View workflow job for this annotation

GitHub Actions / frontend_lint

React Hook useCallback has missing dependencies: 'enableVirusScanner', 'submitStorageModeClearFormMutation', 'submitStorageModeClearFormWithVirusScanningMutation', and 'submitStorageModeFormMutation'. Either include them or remove the dependency array

Check warning on line 665 in frontend/src/features/public-form/PublicFormProvider.tsx

View workflow job for this annotation

GitHub Actions / frontend_lint

React Hook useCallback has missing dependencies: 'enableVirusScanner', 'submitStorageModeClearFormMutation', 'submitStorageModeClearFormWithVirusScanningMutation', and 'submitStorageModeFormMutation'. Either include them or remove the dependency array
data,
enableTurnstileFeatureFlag,
captchaType,
Expand All @@ -616,8 +675,7 @@
getCaptchaResponse,
submitEmailModeFormFetchMutation,
submitEmailModeFormMutation,
submitStorageModeVnMutation,
routeToNewStorageModeSubmission,
enableEncryptionBoundaryShift,
submitStorageModeClearFormFetchMutation,
submitStorageModeFormFetchMutation,
navigate,
Expand Down
Loading
Loading