Skip to content

Commit

Permalink
Merge pull request #6698 from opengovsg/release_v6.76.0
Browse files Browse the repository at this point in the history
build: release v6.76.0
  • Loading branch information
wanlingt authored Sep 7, 2023
2 parents 34d6bba + 389d2aa commit 7552c09
Show file tree
Hide file tree
Showing 10 changed files with 8,117 additions and 837 deletions.
4 changes: 2 additions & 2 deletions .ebextensions/efs-mount.config
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ files:

mountpoint -q ${EFS_MOUNT_DIR}
if [ $? -ne 0 ]; then
echo "mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 ${EFS_FILE_SYSTEM_ID}.efs.${EFS_REGION}.amazonaws.com:/ ${EFS_MOUNT_DIR}"
mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 ${EFS_FILE_SYSTEM_ID}.efs.${EFS_REGION}.amazonaws.com:/ ${EFS_MOUNT_DIR}
echo "mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport ${EFS_FILE_SYSTEM_ID}.efs.${EFS_REGION}.amazonaws.com:/ ${EFS_MOUNT_DIR}"
mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport ${EFS_FILE_SYSTEM_ID}.efs.${EFS_REGION}.amazonaws.com:/ ${EFS_MOUNT_DIR}
if [ $? -ne 0 ] ; then
echo 'ERROR: Mount command failed!'
exit 1
Expand Down
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,10 @@
},
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"typescript.tsdk": "node_modules/typescript/lib"
"typescript.tsdk": "node_modules/typescript/lib",
"markdown.extension.toc.omittedFromToc": {
"README.md": [
"## Table of Contents"
]
}
}
26 changes: 17 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,21 @@ 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.76.0](https://github.com/opengovsg/FormSG/compare/v6.75.1...v6.76.0)

- fix: remove index from myinfo child question name [`#6697`](https://github.com/opengovsg/FormSG/pull/6697)
- feat: update config for efs uninterrupted availability [`#6691`](https://github.com/opengovsg/FormSG/pull/6691)
- docs(undp): add steps to migrate from mongodb in README [`#6695`](https://github.com/opengovsg/FormSG/pull/6695)
- fix: update Myinfo occupation list [`#6684`](https://github.com/opengovsg/FormSG/pull/6684)
- build: merge v6.75.1 into develop [`#6690`](https://github.com/opengovsg/FormSG/pull/6690)
- * feat: % rollout of new storage submission endpoint (#6665) [`#6688`](https://github.com/opengovsg/FormSG/pull/6688)

#### [v6.75.1](https://github.com/opengovsg/FormSG/compare/v6.75.0...v6.75.1)

> 4 September 2023

- fix: payments params in new storage submission endpoint [`#6689`](https://github.com/opengovsg/FormSG/pull/6689)
- chore: bump version to 6.75.1 [`af06ba3`](https://github.com/opengovsg/FormSG/commit/af06ba371fee38a26f1b27125e382521a0748dbe)

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

Expand Down Expand Up @@ -181,16 +193,11 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
> 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
> 18 July 2023

- 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)
- fix(deps): [Snyk] Security upgrade mongoose from 5.13.15 to 5.13.20 [`#6541`](https://github.com/opengovsg/FormSG/pull/6541)
- feat: indicate if GST has been applied to a payment transaction [`#6538`](https://github.com/opengovsg/FormSG/pull/6538)
- chore: reduce max payment limit [`#6543`](https://github.com/opengovsg/FormSG/pull/6543)
Expand All @@ -202,7 +209,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- build: merge v6.65.0 into develop [`#6531`](https://github.com/opengovsg/FormSG/pull/6531)
- build: release v6.65.0 [`#6528`](https://github.com/opengovsg/FormSG/pull/6528)
- fix: add FE validation rule that email domains must be non empty [`#6529`](https://github.com/opengovsg/FormSG/pull/6529)
- chore: bump version to v6.66.0 [`0233ba8`](https://github.com/opengovsg/FormSG/commit/0233ba8018532d4978d13717fac065f81e2eb515)
- chore: bump version to v6.66.0 [`b3a9818`](https://github.com/opengovsg/FormSG/commit/b3a9818762e334bc7126c029cdba63156bac85ed)

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

Expand Down Expand Up @@ -702,13 +709,13 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- fix: add staging-alt2 to deployment script [`#6019`](https://github.com/opengovsg/FormSG/pull/6019)
- build: merge release 6.38.0 to develop [`#6017`](https://github.com/opengovsg/FormSG/pull/6017)
- build: release v6.38.0 [`#6004`](https://github.com/opengovsg/FormSG/pull/6004)
- feat: more logging on fetch fallback [`#6008`](https://github.com/opengovsg/FormSG/pull/6008)
- chore: bump version to v6.39.0 [`081515a`](https://github.com/opengovsg/FormSG/commit/081515a2521c950dac7261f4b6c1b1b423c3af16)

#### [v6.38.0](https://github.com/opengovsg/FormSG/compare/v6.37.0...v6.38.0)

> 30 March 2023
> 29 March 2023

- feat: more logging on fetch fallback [`#6008`](https://github.com/opengovsg/FormSG/pull/6008)
- feat: implement fetch API fallback for network error [`#5948`](https://github.com/opengovsg/FormSG/pull/5948)
- fix: lowercase collaborator endpoint emails [`#5992`](https://github.com/opengovsg/FormSG/pull/5992)
- chore(deps-dev): bump @typescript-eslint/parser from 5.56.0 to 5.57.0 in /shared [`#5995`](https://github.com/opengovsg/FormSG/pull/5995)
Expand All @@ -717,6 +724,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- fix(deps): bump type-fest from 3.7.0 to 3.7.1 in /shared [`#5991`](https://github.com/opengovsg/FormSG/pull/5991)
- build: merge v6.37.0 into develop [`#5989`](https://github.com/opengovsg/FormSG/pull/5989)
- build: release v6.37.0 [`#5988`](https://github.com/opengovsg/FormSG/pull/5988)
- chore: bump version to v6.38.0 [`d199213`](https://github.com/opengovsg/FormSG/commit/d19921314cae6b79920cf5ec3fb4f396794816d6)

#### [v6.37.0](https://github.com/opengovsg/FormSG/compare/v6.36.0...v6.37.0)

Expand Down
92 changes: 71 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,32 @@
[![Coverage Status](https://coveralls.io/repos/github/opengovsg/FormSG/badge.svg?branch=develop)](https://coveralls.io/github/opengovsg/FormSG?branch=develop)

## Table of Contents

- [FormSG](#formsg)
- [Table of Contents](#table-of-contents)
- [Contributing](#contributing)
- [Features](#features)
- [Local Development (Docker)](#local-development-docker)
- [Prerequisites](#prerequisites)
- [First Setup](#first-setup)
- [Running Locally](#running-locally)
- [Accessing email locally](#accessing-email-locally)
- [Environment variables](#environment-variables)
- [Trouble-shooting](#trouble-shooting)
- [Testing](#testing)
- [Testing Prerequisites](#testing-prerequisites)
- [Running tests](#running-tests)
- [Unit tests](#unit-tests)
- [End-to-end tests](#end-to-end-tests)
- [Architecture](#architecture)
- [MongoDB Scripts](#mongodb-scripts)
- [Support](#support)
- [Acknowledgements](#acknowledgements)
- [Contributing](#contributing)
- [IMPORTANT NOTE TO ALL CONTRIBUTORS](#important-note-to-all-contributors)
- [Features](#features)
- [Local Development (Docker)](#local-development-docker)
- [Prerequisites](#prerequisites)
- [First Setup](#first-setup)
- [Running Locally](#running-locally)
- [Adding dependencies](#adding-dependencies)
- [Accessing email locally](#accessing-email-locally)
- [Environment variables](#environment-variables)
- [Trouble-shooting](#trouble-shooting)
- [Testing](#testing)
- [Testing Prerequisites](#testing-prerequisites)
- [Running tests](#running-tests)
- [Unit tests](#unit-tests)
- [End-to-end tests](#end-to-end-tests)
- [Cross-browser testing](#cross-browser-testing)
- [Architecture](#architecture)
- [MongoDB Scripts](#mongodb-scripts)
- [Support](#support)
- [Database Alternatives](#database-alternatives)
- [Migrating from Mongoose ODM to Prisma ORM](#migrating-from-mongoose-odm-to-prisma-orm)
- [Replacing MongoDB with CockroachDB](#replacing-mongodb-with-cockroachdb)
- [Other Prisma supported DBs](#other-prisma-supported-dbs)
- [Other potential DB migrations](#other-potential-db-migrations)
- [Acknowledgements](#acknowledgements)

## Contributing

Expand Down Expand Up @@ -217,6 +222,51 @@ Scripts for common tasks in MongoDB can be found [here](docs/MONGODB.md).

Please contact FormSG ([email protected]) for any details.

## Database Alternatives

### Migrating from Mongoose ODM to Prisma ORM

FormSG uses Mongoose as the Object-Document Mapping (ODM) to MongoDB. This means that our code is strongly coupled with MongoDB as Mongoose solely supports it.

In order to use a different database with FormSG you will have to first migrate from Mongoose to other object modelling libraries. One of which is Prisma.

Prisma is an Object-Relational Mapping (ORM) library that can also be used as the object model for MongoDB. Prisma is compatible with various other relational databases like Cockroach DB.

Follow this [guide](https://www.prisma.io/docs/guides/migrate-to-prisma/migrate-from-mongoose#overview-of-the-migration-process) by Prisma to migrate from Mongoose.

The guide has 4 primary steps:
1. Install Prisma CLI
2. Introspect the current MongoDB for the data model
1. For this section, Prisma’s introspection should be able to create prisma models that will replace your `server.model.ts` for each collection
2. Additionally, as Prisma is relational, you could add relations between the various documents. One good relation to add will be `form` many to one `user` on the `[form.email](http://form.email)` field.
3. Install Prisma Client
4. Replace Mongoose Queries with Prisma Client
1. This step will likely take the most refactoring efforts
2. This will include most files in `formsg/src` ending with `service.ts`
3. Including test files ending with `service.spec.ts`

#### Replacing MongoDB with CockroachDB

Thereafter, you could set up CockroachDB which is a distributed SQL DB. Follow the quick start guide by [CockroachDB](https://www.cockroachlabs.com/docs/cockroachcloud/quickstart) to create a CockroachDB Serverless cluster.

To replace the local development instance, you can follow this [guide](https://www.cockroachlabs.com/docs/stable/start-a-local-cluster-in-docker-mac). As FormSG uses Docker for local development, you will have to replace the `mongoDB` container from `docker-compose.yml` to the `cockroachDB` version.

Then connect to [CockroachDB](https://www.prisma.io/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/connect-your-database-typescript-postgresql) by changing the DB url in `.env` to the one from your CockroachDB `DATABASE_URL="YOUR_COCKROACH_DB_URL"`.

For local development, if the DB is replaced as above, you should not need to modify the ports as it will still be hosted on `localhost:27017`.

#### Other Prisma supported DBs

MongoDB can be replaced with other various relational databases supported by Prisma in this [list](https://www.prisma.io/docs/reference/database-reference/supported-databases).

### Other potential DB migrations

It is also possible to migrate from Mongoose to [Ottoman](https://ottomanjs.com/), which is another ODM.

The process will be simpler than migrating to Prisma, but Ottoman is more restrictive and can only be used together with Couchbase, which is also a noSQL DB like MongoDB.

Refer to this [guide](https://www.couchbase.com/blog/migrate-mongodb-mongoose-couchbase-ottoman/) to migrate from Mongoose to Ottoman and then replace MongoDB with Couchbase.

## Acknowledgements

FormSG acknowledges the work done by [Arielle Baldwynn](https://github.com/whitef0x0) to build and maintain [TellForm](https://github.com/tellform), on which FormSG is based.
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.75.0",
"version": "6.76.0",
"homepage": ".",
"private": true,
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions 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 package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "FormSG",
"description": "Form Manager for Government",
"version": "6.75.1",
"version": "6.76.0",
"homepage": "https://form.gov.sg",
"authors": [
"FormSG <[email protected]>"
Expand Down
Loading

0 comments on commit 7552c09

Please sign in to comment.