ucsb-cs156-s24 / proj-gauchoride-s24-5pm-8

https://ucsb-cs156-s24.github.io/proj-gauchoride-s24-5pm-8/
1 stars 0 forks source link

FEATURE - expose commit infomation at /api/systemInfo #5

Open github-actions[bot] opened 4 months ago

github-actions[bot] commented 4 months ago

Note: Join the channel #help-git-commit-id-maven-plugin on slack for advice on how to complete this story.

User Story

Discussion

In this issue, we bring over some code from proj-courses into this code base; code that provides transparency about what version of the code is running in any given deployment.

In the proj-courses code base, we've implemented a feature where you can get the SHA and the commit message for the latest commit that was deployed either on localhost or on dokku. You access it by going to the endpoint /api/systemInfo.

Here's what it looks like:

image

Note that this only works if all of the code is deployed correctly in the code base, and if the following has been done on the dokku deployment (here, courses-qa is the name of the dokku app)

  dokku git:set courses-qa keep-git-dir true

After setting that, you will need to do a dokku ps:rebuild appname for it to take effect.

If that's not set, you'll see something like this:

image

Also, you need to set the env variable: SOURCE_REPO to the correct repo. This should be done rather than changing the value https://github.com/ucsb-cs156/proj-happycows in the code!

dokku config:set gauchoride  SOURCE_REPO=https://ucsb-cs156-s24/proj-gauchoride-s24-5pm-5

For the changes you need to make to the code, refer to this PR from proj-courses:

https://github.com/ucsb-cs156/proj-courses/pull/85

Acceptance Criteria

Implementation Todos

See: https://github.com/ucsb-cs156/proj-courses/pull/85 for hints on how to proceed.

github-actions[bot] commented 4 months ago

Copied from https://github.com/ucsb-cs156/proj-gauchoride/issues/111