icefoganalytics / elcc-data-management

Data Management application for Education's Early Learning Child Centre
Apache License 2.0
0 stars 0 forks source link

ELCC-47: Add Version Info To Deployed Production Build #71

Closed klondikemarlen closed 9 months ago

klondikemarlen commented 9 months ago

Fixes https://yg-hpw.atlassian.net/browse/ELCC-47

Context

It is currently impossible to determine what version of the app is running in production. As demonstrated in the https://github.com/icefoganalytics/travel-authorization and https://github.com/icefoganalytics/internal-data-portal projects, it is possible to inject version information into the build environment.

Implementation

Inject version info into built image via publish script. Add /_status api endpoint with version info. Add top nav dropdown entry for version info. Add /status UI page for version info.

Screenshots

/_status page image

/status page image

Status info in development in top kebab menu. image

Testing Instructions

  1. Boot the app via RELEASE_TAG=1.0.0 GIT_COMMIT_HASH=0f8549e5da8ff9694f1b322382243fac63494275 dev up
  2. Check that the app complies, and that you can log in at http://localhost:8080.
  3. Check that there is a new menu entry with the release tag of 1.0.0 (this will say development if unset)
  4. Click on the menu entry to go to the /status page.
  5. Go to the http://localhost:3000/_status page via pasting the url into your browser.

Testing production build.

  1. Build the app via docker compose build --build-arg RELEASE_TAG=1.0.0 --build-arg GIT_COMMIT_HASH=0f8549e5da8ff9694f1b322382243fac63494275
  2. Boot the app via docker compose up
  3. Check that the app complies, and that you can log in at http://localhost:8080.
  4. Check that there is a new menu entry with the release tag of 1.0.0
  5. Click on the menu entry to go to the /status page.
  6. Go to the http://localhost:8080/_status page via pasting the url into your browser.