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

[CHE-172] Refactor Server Startup and DB Connection #142

Conversation

seantokuzo
Copy link
Contributor

Description

As part of the CHE-167 story, this PR:

  • separates app configuration logic from server startup logic
  • adds environment variable checks to server startup function
  • adds necessary environment variable to docker compose files for development and testing
  • simplifies imports of routers
  • fixes imports and logic in existing tests in db.test.ts and index.test.ts
  • comments out tests that need refactoring in db.test.ts

Jira Task

JIRA TICKET

Testing Instructions

  • run npm run docker-remove-all to remove local containers/images/volumes
  • run docker build -f Dockerfile-dev -t codehammers/ch-dev-dep-v2 . to build the dev image including the express-async-errors package
  • run npm run docker-build-check to run linting and testing

Checklist

All Team Members

  • I added a descriptive title to this PR.
  • I filled out the Description, Jira Task, and Testing Instructions sections above.
  • I added or updated [Jest unit tests]for any changes to components, server-side controllers, etc.
  • I ran npm run docker-build-check in my local environment to check that this PR passes all linting checks and unit tests.
  • I did a quick check to make sure my code changes follow the recommended style guide.

Copy link
Contributor

@brok3turtl3 brok3turtl3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great re-org here @seantokuzo ! 👍 It was overdue!

I think the front and back testing files need to be reviewed at this point and a fresh slate of refactoring and new testing tickets put up. Let's chat about that this week.

I left mostly attaboys but had a few questions around the compose files. ❓

docker-compose-dev.yml Show resolved Hide resolved
docker-compose-dev.yml Show resolved Hide resolved
docker-compose-test.yml Show resolved Hide resolved
server/config/db.ts Show resolved Hide resolved
server/config/db.ts Show resolved Hide resolved
server/index.ts Show resolved Hide resolved
@brok3turtl3 brok3turtl3 added the enhancement New feature or request label Jun 13, 2024
@brok3turtl3 brok3turtl3 self-requested a review June 13, 2024 16:03
Copy link
Contributor

@brok3turtl3 brok3turtl3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Nice work @seantokuzo!

@brok3turtl3 brok3turtl3 merged commit 51888b5 into CHE-167/story/BE-Refactor-Error-Handling Jun 15, 2024
1 check passed
@brok3turtl3 brok3turtl3 deleted the CHE-172/subtask/Refactor-Server-Startup-and-DB-Connection branch June 15, 2024 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants