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

671 show urdr version on web page #1020

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

KattisLej
Copy link
Contributor

@KattisLej KattisLej commented Nov 26, 2024

Related issue(s) and PR(s)

This PR closes #671

Type of change

  • New feature (showing version on the website)

List of changes made

  • Added the git branch and hash in webpack as a enviroment variable. In order to access this information I installed git as root in docker. I copied the same procedure to the production docker file (but haven't managed to test it)
  • The main changes in the webpack file are around these variables:
const gitBranch = execSync("git rev-parse --abbrev-ref HEAD").toString().trim();
const gitHash = execSync("git rev-parse --short HEAD").toString().trim();

Screenshot of the fix

image

Screenshot from 2024-11-26 16-47-33

Testing

  • Start URDR
  • See if you get the information as shown above

Further comments

I haven't manage to test this in production mode by running the production docker image.

Definition of Done checklist

  • I have made an effort making the commit history understandable
  • I have performed a self-review of my own code and commented any hard-to-understand areas
  • Tests and lint/format validations are passing
  • My changes generate no new warnings

Copy link

@pdmnyberg pdmnyberg left a comment

Choose a reason for hiding this comment

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

I am not too excited about making git a requirement in the webpack build and including git in the Dockerfiles.

Feel free to push back on my ideas here but I would like to suggest another approach if possible.

  • Always get gitBranch and gitHash from env varibles in the build scripts
  • Supply the env variables using docker compose or the github workflow

If am correct this way of doing things should allow us to avoid including git as a dependency and the GIT_BRANCH and GIT_HASH will just bit data built into the containers.

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.

Show Urdr version on web page
2 participants