From e741d3ddfa706a03fed7a399db50461fba445081 Mon Sep 17 00:00:00 2001 From: aloftus23 Date: Wed, 6 Mar 2024 10:26:20 -0500 Subject: [PATCH 1/3] Remove logging password error --- backend/src/tasks/checkUserExpiration.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/backend/src/tasks/checkUserExpiration.ts b/backend/src/tasks/checkUserExpiration.ts index 2e5faa72..f17a9eaa 100644 --- a/backend/src/tasks/checkUserExpiration.ts +++ b/backend/src/tasks/checkUserExpiration.ts @@ -103,9 +103,7 @@ export const handler: Handler = async (event) => { `Password reset for user ${user.id} due to 45 days of inactivity.` ); } catch (passwordError) { - console.error( - `Error resetting password for user ${user.id}: ${passwordError}` - ); + console.error(`Error resetting password.`); } } From c5e042eeb7cbb4bc50aa4ee4d9093d3814b701e8 Mon Sep 17 00:00:00 2001 From: aloftus23 Date: Wed, 6 Mar 2024 10:27:44 -0500 Subject: [PATCH 2/3] Make sure to use variable --- backend/src/tasks/dotgov.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/src/tasks/dotgov.ts b/backend/src/tasks/dotgov.ts index 7c49eda0..fd686aca 100644 --- a/backend/src/tasks/dotgov.ts +++ b/backend/src/tasks/dotgov.ts @@ -61,6 +61,7 @@ export const handler = async (commandOptions: CommandOptions) => { )) { // Create a new organization if needed; else, create the same one. console.log(orgName); + console.log(row); const organization = (await Organization.findOne({ name: orgName From cc367b8e93099adf89df8630026a7ea43fb8dd9d Mon Sep 17 00:00:00 2001 From: aloftus23 Date: Wed, 6 Mar 2024 10:39:13 -0500 Subject: [PATCH 3/3] Fix docs lint --- docs/src/documentation-pages/dev/pe.md | 2 ++ docs/src/documentation-pages/dev/quickstart.md | 14 +++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/docs/src/documentation-pages/dev/pe.md b/docs/src/documentation-pages/dev/pe.md index 5a5e13e3..05314358 100644 --- a/docs/src/documentation-pages/dev/pe.md +++ b/docs/src/documentation-pages/dev/pe.md @@ -69,7 +69,9 @@ Then enter pe database password. Follow [this guide](https://www.postgresqltutorial.com/psql-commands/) for psql command basics. ## Populate the database with pg dump file + Locate the latest postgres dump file and run: + ```bash pg_restore -U pe -d pe "[path to sql dump file]" ``` diff --git a/docs/src/documentation-pages/dev/quickstart.md b/docs/src/documentation-pages/dev/quickstart.md index b2e05f5d..10dc3739 100644 --- a/docs/src/documentation-pages/dev/quickstart.md +++ b/docs/src/documentation-pages/dev/quickstart.md @@ -18,9 +18,9 @@ This quickstart describes the initial setup required to run an instance of Cross cd backend && npm run build-worker ``` 5. Start the entire environment from the root directory: - ```bash - npm start - ``` + ```bash + npm start + ``` 6. Generate the initial DB schema and populate it with sample data: ```bash cd backend @@ -65,6 +65,7 @@ This quickstart describes the initial setup required to run an instance of Cross ### Running tests To run tests, first make sure you have already started Crossfeed with `npm start` (or, at bare minimum, that the database container is running). Then run: + ```bash cd backend npm test @@ -73,6 +74,7 @@ npm test If snapshot tests fail, update snapshots by running `npm test -- -u`. To run tests for the subset of worker code that is written in Python, you need to run: + ```bash pip install -r worker/requirements.txt pytest @@ -83,6 +85,7 @@ To view a code coverage report (a minimum code coverage threshold is checked in ### Monitoring Docker containers To see which Docker containers are running, you can run: + ```bash{outputLines: 2-10} docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES @@ -97,6 +100,7 @@ c3ed457a71d2 postgres:latest "docke ``` You can then check the logs of a particular container by specifying a container's name with the `docker logs` command. For example: + ```bash docker logs crossfeed_backend_1 --follow ``` @@ -105,6 +109,7 @@ docker logs crossfeed_backend_1 --follow To see more information about the design and development of each component of Crossfeed, see the following links: + - [Frontend](frontend.md) for the React frontend. - [REST API](rest-api.md) for the REST API. - [Database](database.md) for the database models stored in Postgres. @@ -121,6 +126,7 @@ The docs are based on the [federalist-uswds-gatsby](https://github.com/18F/feder ### Common Issues - Node Error issue occurs due to "npm install" + ```bash npm ERR! code EBADENGINE npm ERR! engine Unsupported engine @@ -137,6 +143,7 @@ In this case install nvm for nodes 16.0.0 to 17.0.0. for example `nvm install 16.19.0` then check it by `node -- version` and `npm -- version` - Sometimes you may get an error in package-lock.json. This error is due to the package downloading the docker build. Remove the package-lock.json file and reinstall it using `npm install`. + ```bash rm package-lock.json npm install @@ -145,6 +152,7 @@ for example `nvm install 16.19.0` then check it by `node -- version` and `npm -- If successful then continue to step 3. - Permission Issue / Permissions not permitted / Operation not permitted / Module build Failed + ```bash Failed to compile. crossfeed-frontend-1 |