Skip to content

Conversation

@arosenkranz
Copy link
Collaborator

@arosenkranz arosenkranz commented Feb 14, 2024

How to test

Locally

  • Use Training Local Env in VSCode devcontainers
  • Run setup-storedog to set environment variables and get up and running

In lab environment

  • Checkout this branch in a lab environment (TRAIN-1691-frontend-refactor)
  • Make sure environment variables are correctly using Instruqt-provided values and not localhost/container name for everything

Don't forget to set necessary flags to true in featureFlags file for log-course specific items.

Changes

There's a lot going on, but here's high level items by service:

Global

  • reconfigures docker compose file for better parity with docker compose files we use in labs (still use local build dockerfiles)

Backend

  • updates log configuration
  • updates tracer configuration
  • updates restore.sql file to setup dbm (TODO: may need to take a look at why postgres throws so many false errors)
  • adds some blob storage

Worker (backend)

  • adds worker-specific files for docker compose

Nginx / webserver

  • Adds GeoIP functionality and databases (TODO: these files are large, consider s3 bucket(?))
  • Updates Dockerfile for new functionality

Puppeteer

  • Adds service files
  • Updates puppeteer.js flow to include more movement to secondary pages

Frontend

  • Refactors entire application to use fetch calls to Spree API instead of side-loaded dependencies
  • Removes turbo monorepo configuration, fixing logs
  • Adds dd-trace
  • Updates rum to v5, adjusts some global context setting and configuration
  • Updates Dockerfile (TODO: build variation that actually builds the app, which relies on backend server being up and running)
  • Adds new feature flag to throw new API route errors

To do (also see in-line TODO items)

  • Ads/Discounts have double logs (perhaps dd-trace related)?
  • Frontend service works with next-logger but Pino sets error logs to err and not error (breaking error tracking), consider (see: https://getpino.io/#/docs/api?id=errorkey-string)
  • Backend service logs related to postgres queries don't parse correctly, consider just turning them off in development.rb
  • Postgres queries seem to throw a lot of error logs, potentially related to DBM configuration?
  • Update .env template for both root-level and /services/frontend locations to remove unused variables (lots of the NEXT_PUBLIC... ones are now obsolete)

A lot of the above may be solved if we perhaps write to an actual log file for the Agent to consume?

@arosenkranz arosenkranz self-assigned this Feb 14, 2024
@arosenkranz arosenkranz changed the title Train 1691 frontend refactor Refactors frontend service and general updates Feb 14, 2024
Copy link
Collaborator

@stanleegoodspeed stanleegoodspeed left a comment

Choose a reason for hiding this comment

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

I was able to get the DevContainer environment up and running but I'm getting the following error when hitting the frontend

Screenshot 2024-02-21 at 12 28 51 PM

@arosenkranz arosenkranz marked this pull request as ready for review March 4, 2024 20:51
@stanleegoodspeed stanleegoodspeed merged commit c883986 into main Mar 5, 2024
@stanleegoodspeed stanleegoodspeed deleted the TRAIN-1691-frontend-refactor branch March 5, 2024 17:26
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.

3 participants