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

feature: release 4.34.0 #297

Merged
merged 30 commits into from
Sep 8, 2020
Merged

feature: release 4.34.0 #297

merged 30 commits into from
Sep 8, 2020

Conversation

arshadali172
Copy link
Contributor

@arshadali172 arshadali172 commented Sep 8, 2020

New

  • Verified sms modal

Refactor

  • Migrate /auth endpoint handling to Typescript
  • Remove form_field.isFutureOnly
  • Remove redundant feature factory
  • Use convict for configuration
  • Add try-catch block to custom logger for js files
  • Remove unused Nodemailer env vars
  • Typify webhook and migrate from middleware pattern
  • Prevent discriminated models from being created before their base model

Misc

  • Upgrade localstack version
  • Upgrade Sentry SDK
  • Various dependency version bumps
    • stylelint-config-prettier 8.0.1 to 8.0.2
    • mongoose 5.9.19 to 5.10.0
    • babel/core 7.10.2 to 7.11.5
    • testcafe 1.8.6 to 1.9.1
    • babel/preset-env 7.11.0 to 7.11.5
    • lodash 4.17.19 to 4.17.20
    • eslint 7.7.0 to 7.8.1
    • jest 26.2.2 to 26.4.2
    • prettier 2.0.5 to 2.1.1
    • typescript-eslint/parser 3.3.0 to 3.10.1
    • typescript-eslint/parser 3.10.1 to 4.0.0
    • typescript-eslint/eslint-plugin 3.9.1 to 4.0.0
    • ajv 5.5.2 to 6.12.4

liangyuanruo and others added 30 commits September 1, 2020 14:01
feat: merge Release 4.33.0 into develop
* fix(deps): bump ajv from 5.5.2 to 6.12.4

Bumps [ajv](https://github.com/ajv-validator/ajv) from 5.5.2 to 6.12.4.
- [Release notes](https://github.com/ajv-validator/ajv/releases)
- [Commits](ajv-validator/ajv@v5.5.2...v6.12.4)

Signed-off-by: dependabot[bot] <[email protected]>

* chore(deps): remove ajv as dependency

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Antariksh Mahajan <[email protected]>
…e model (#244)

* fix(FormModel): return discriminated model only after compiling base

* fix(SubmissionModel): return discriminated model after compiling base

* Fix tests

Co-authored-by: Arshad Ali <[email protected]>
* chore(deps-dev): bump prettier from 2.0.5 to 2.1.1

Bumps [prettier](https://github.com/prettier/prettier) from 2.0.5 to 2.1.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md)
- [Commits](prettier/prettier@2.0.5...2.1.1)

Signed-off-by: dependabot[bot] <[email protected]>

* chore: lint

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Antariksh Mahajan <[email protected]>
* fix: set endpoint URL to s3-only port

* refactor: use promisify instead of promise constructor

* fix: add back mock creds, throw error if not present

* docs: add docs for AWS credentials under main app env vars

* build: empty commit to restart builds
* Move webhooks service into webhook module

* Rename webhooks.service to webhook.service

* Move webhook types into webhook module folder

* Move webhook.controller into modules file

* Move webhook utils to webhook modules folder

* Convert webhook controller to typescript

* Convert webhook controller to typescript

* Move webhook controller tests into util.spec and service.spec

* Refactor webhook service to return promises for testing purposes

* Convert to arrow function

* Remove declaration of submission model as compilation is done by the discriminator model itself

* Add types to webhook service spec

* Remove extra line and add jsdoc for response

* Add comment about moving away from middleware pattern

* Add comment that pushData should not be awaited upon

* Add JSDoc to webhook service functions

* Convert to await/async for better readability

Co-authored-by: Arshad Ali <[email protected]>
Bumps [jest](https://github.com/facebook/jest) from 26.2.2 to 26.4.2.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md)
- [Commits](jestjs/jest@v26.2.2...v26.4.2)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [eslint](https://github.com/eslint/eslint) from 7.7.0 to 7.8.1.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](eslint/eslint@v7.7.0...v7.8.1)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.19 to 4.17.20.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](lodash/lodash@4.17.19...4.17.20)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* feat: uninstall raven-js

* feat: install new sentry packages

* feat: import and init new sentry module

* docs: replace Raven with Sentry
The following environment variables are deprecated by Nodemailer and no lnoger in use in production
* SES_RATE
* SES_RATELIMIT

Additionally addressed linting issues in the deployment setup Markdown
file.
* chore: remove form_field.isFutureOnly key

* chore: script to remove isFutureOnly from db

* chore: remove get

* style: shift new scripts to remove-isfutureonly-key.js

* lint: remove trailing commas in script
* refactor: remove unused factory

* refactor: use const instead of var

* feat: catch error from getfeatureStates

* refactor: capitalise f in getFeatureStates
* Move session secret to config

* Move port to config

* Move otpLifeSpan, bounceLifeSpan and submissionsTopUp to config

* Move appConfig to config

* Move formsgSdkMode to config

* Move awsConfig to config

* Move types out

* Move cspReportUri and chromiumBin to config

* Fix bugs with config loading

* Move banners and custom watch grp to config

* Move dbHost to config

* Remove deprecated env vars

* Move ses to convict and enforce that prod ses are defined

* Remove repeated code to check bucket url

* Reorganise banner env vars under banner key/header

* Add missing env var to documentation and re-organise CSP_REPORT_URI'

* Reorganise based on order in documentation

* Move nodeEnv to convict

* Move bucket urls to own convict that gets validated after

* Move schemas to separate file

* Fix format of nodeEnv

* Edit nodemailer configuration to be based on environment

* Reorganise and add comments

* Remove convict config to Vars for clarity

* Add types to convict schemas

* Fix typing issues

* Add documentation on FORMSG_LOCALSTACK_ENDPT

* Reorganise for better readability

* Fix bug with db host

* Remove test env vars that no longer need to be unset

* Use getProperties so that typing can be enforced

* Remove warn validation on dev environment

* Remove default for session secret

* Add defaults for chromium bin

* Add validation for db host

* Split schemas into option, compulsory and prodOnly

* Fix typing

* Use new schemas and load dbUri based on environment

* Update package

* Remove env vars that don't need to be defined during tests

* Move cspReportUri to sentry feature, enforce type url and only pass to Helmet if defined

* Add missing documentation

* Simplify logic

* Remove otpGenerator

* Define defaults directly in schema

* Validate aws endpoint

* Move defaults to constant file

* Fix imports for constants file

* Update default for bounceLifeSpan

* Mark the relevant env vars as being sensitive

* Add todo to clean up MyInfo env vars

* Reference issue in todo

* Move aws default endpoint to aws endpoint env var and enforce region in production
urls

* Fix rebase issues

* Remove FORMSG_LOCALSTACK_ENDPT

* Remove logger from config

* Require config in logger now that config does not use logger

* Remove aws region default

* Use config.nodeEnv instead of process.env

* Update docs/DEPLOYMENT_SETUP.md

Co-authored-by: Antariksh Mahajan <[email protected]>

* Update docs/DEPLOYMENT_SETUP.md

Co-authored-by: Antariksh Mahajan <[email protected]>

* Add AWS_ENDPOINT to docker file for dev purposes

* Add comments to specify how convict defaults work

* Add a session secret default for dev environment

* Add default for aws endpoint in docker dev file

Co-authored-by: Arshad Ali <[email protected]>
Co-authored-by: Antariksh Mahajan <[email protected]>
Bumps [testcafe](https://github.com/DevExpress/testcafe) from 1.8.6 to 1.9.1.
- [Release notes](https://github.com/DevExpress/testcafe/releases)
- [Changelog](https://github.com/DevExpress/testcafe/blob/master/CHANGELOG.md)
- [Commits](DevExpress/testcafe@v1.8.6...v1.9.1)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…#273)

* fix: fix invocations of logger that does not adhere to expected shape

* feat(UserController): update error log message to be constants
* feat: add try-catch block to custom logger for js files

JavaScript files will not throw any error when the wrong argument signature is passed into logger invocations. Add try catch block as a defensive measure at least until the application is 100% typescript, to prevent possible errors from being thrown due to the wrong type

* fix(logger): add stricter shape checks

* fix: use correct parameters in info logging

Co-authored-by: Antariksh Mahajan <[email protected]>

Co-authored-by: Antariksh Mahajan <[email protected]>
* Edit tool tips

* Configure mobile directive should open verified sms modal

* Remove unused css that prevents modal from stacking

* Only show modal when toggling on verified sms

* Ensure that supportFormLink is defined in verified sms modal

* lint

Co-authored-by: Arshad Ali <[email protected]>
…t-eslint/parser (#246)

* chore(deps-dev): bump @typescript-eslint/eslint-plugin

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 3.9.1 to 4.0.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.0.0/packages/eslint-plugin)

Signed-off-by: dependabot[bot] <[email protected]>

* chore(dev-deps): bump @typescript-eslint/parser from 3.10.1 to 4.0.0

This was causing the lint errors from the upgrade of @typescript-eslint/eslint-plugin as the parser used was still of a lower level

* chore: update eslintrc to use recommended Typescript eslint rules

* lint: run linter on Typescript codebase using new rules

* chore(deps-dev): bump @typescript-eslint/eslint-plugin to 4.0.1

* refactor(Bounce): add stricter RequestHandler typing to handleSns

* fix(MailUtils): add stricter typing to AutoreplyHtmlData typing

* refactor: set user betaFlags typing to be stricter to be empty object

* refactor(Bounce): update typing of ResBody to be never in handleSns

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kar Rui Lau <[email protected]>
…280)

Bumps [stylelint-config-prettier](https://github.com/prettier/stylelint-config-prettier) from 8.0.1 to 8.0.2.
- [Release notes](https://github.com/prettier/stylelint-config-prettier/releases)
- [Commits](prettier/stylelint-config-prettier@v8.0.1...v8.0.2)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…n Design (#215)

* refactor: introduces nested routing in TS
* doc: add better documentation for functions
* chore: add eslint for all "*.spec.ts" files
* test(jestExpress): enhance mockResponse creation - mockResponse now allows injection of other response-related keys used to setup all the middlewares that helps in testing
* test(AuthRoutes): add /checkuser integration tests
* fix: update tsconfig.build.json to exclude spec files and public
* test: add CookieStore helper class to store cookies for auth'd routes
* Introduces ApplicationError as an abstract class for extension - this prevents developers from using ApplicationError directly and are forced to extend from the class (in Typescript).
@arshadali172 arshadali172 changed the title Release 4.34.0 feature: release 4.34.0 Sep 8, 2020
@arshadali172
Copy link
Contributor Author

arshadali172 commented Sep 8, 2020

Configuration Improvements (@shuli-ogp )

  • Test unfurling of form urls on whatsapp/facebook/twitter
  • Test email submission with all fields
  • Test encrypt submission with all fields
  • Create form
  • Test SingPass/MyInfo submission
  • Test CorpPass submission

Feature Manager (@shuli-ogp) ~ test on staging alt

  • Test email submission
  • Test encrypt submission
  • Create form flow

@arshadali172
Copy link
Contributor Author

arshadali172 commented Sep 8, 2020

Auth Refactoring (@arshadali172 )

  • Sign out should work properly
  • Logging in to existing user should work properly
    • Invalid OTP should return 422 with invalid OTP message
    • Entering wrong OTP 10 times should return 422, and subsequently entering correct OTP will still return 422.
    • Requesting for new OTP should work, and login successfully
  • Attempt to login as a new user by logging in with your open.gov.sg email; e.g. <youremail>[email protected]
    • Should create new user successfully upon log in, test with creating a form, log out and log back in. Your form should still be there.

Intranet/IE (@arshadali172 )

  • Test upload image/logo (Does not work, may be whitelisting issue)
  • Download csv/attachments
  • Test email submission
  • Test encrypt submission

Verified SMS (@arshadali172 )

  • Include verified sms modal on desktop view, triggered on verified sms toggle
  • Include verified sms modal on mobile view, triggered on verified sms toggle
  • Link contact us to support form

Sentry

  • Test that sentry events are logged

@arshadali172
Copy link
Contributor Author

arshadali172 commented Sep 8, 2020

Webhook Refactoring (@mantariksh)

  • Test webhook sending and decryption using ngrok
  • Test TemperatureSG

Date (@mantariksh)
Create 5 date fields in admin view with the following options. Test that the validations work in the preview panel datepicker on the right (i.e. the popup calendar).

  • Disallow past dates
  • Disallow future dates
  • Custom date range with Min Date only
  • Custom date range with Max Date only
  • Custom date range with both Min and Max Date

Validation for date range validation option in admin view

  • Check that it is not possible for admin to save a form with a custom date range where both Min and Max date are left blank
  • Check that it is not possible for admin to save a form with a custom date range where Max date is before Min date

Able to submit forms correctly

  • Publish the form. Test that all 5 date field validations still work in the public form datepicker (i.e. the popup calendar)
  • Test that all 5 date field validations still work in the public form using manual input to the date field and manual input of date outside the validation range is rejected

Test for editing and reordering, instead of creating

  • Using the existing form fields, shuffle the form validations of the five fields by editing the validation options
  • Reorder the form fields
  • Repeat the above tests to make sure the date validations remain correct

@arshadali172 arshadali172 merged commit 59e7496 into release Sep 8, 2020
@liangyuanruo liangyuanruo deleted the release-4.34.0 branch January 6, 2021 08:25
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.

6 participants