Skip to content

fix: replace git hash with build number in UI footer#5153

Open
Ma77Ball wants to merge 7 commits into
apache:mainfrom
Ma77Ball:fix/removeUIGitHash
Open

fix: replace git hash with build number in UI footer#5153
Ma77Ball wants to merge 7 commits into
apache:mainfrom
Ma77Ball:fix/removeUIGitHash

Conversation

@Ma77Ball
Copy link
Copy Markdown
Contributor

@Ma77Ball Ma77Ball commented May 22, 2026

What changes were proposed in this PR?

  • Replaced frontend/git-version.js with frontend/build-version.js, which uses build-number-generator to stamp a version + timestamp build number instead of shelling out to git describe.
  • Swapped the git-describe devDependency for build-number-generator, and pointed the postinstall script at the new file.
  • Simplified src/environments/version.ts schema to { buildNumber, version }, since the old git-describe output fields had a single consumer.
  • Renamed DashboardComponent.gitCommitHash to buildNumber, updated the footer label to Build:, and renamed the #git-commit-id CSS id to #build-number.

Any related issues, documentation, or discussions?

closes: #3613

How was this PR tested?

  • Ran node build-version.js directly and confirmed it wrote a valid version.ts with the new buildNumber field.

Was this PR authored or co-authored using generative AI tooling?

Co-authored with Claude Opus 4.7 in compliance with ASF

@github-actions github-actions Bot added dependencies Pull requests that update a dependency file fix frontend Changes related to the frontend GUI labels May 22, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.66%. Comparing base (0f5f791) to head (9a30975).

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #5153   +/-   ##
=========================================
  Coverage     43.66%   43.66%           
  Complexity     2218     2218           
=========================================
  Files          1049     1050    +1     
  Lines         40580    40583    +3     
  Branches       4324     4324           
=========================================
+ Hits          17719    17721    +2     
  Misses        21766    21766           
- Partials       1095     1096    +1     
Flag Coverage Δ *Carryforward flag
access-control-service 39.53% <ø> (ø) Carriedforward from 0f5f791
agent-service 33.76% <ø> (ø) Carriedforward from 0f5f791
amber 43.94% <ø> (ø) Carriedforward from 0f5f791
computing-unit-managing-service 1.38% <ø> (ø) Carriedforward from 0f5f791
config-service 19.35% <ø> (ø) Carriedforward from 0f5f791
file-service 32.18% <ø> (ø) Carriedforward from 0f5f791
frontend 35.16% <100.00%> (+0.01%) ⬆️
python 90.50% <ø> (ø) Carriedforward from 0f5f791
workflow-compiling-service 58.39% <ø> (ø) Carriedforward from 0f5f791

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Ma77Ball
Copy link
Copy Markdown
Contributor Author

/request-review @bobbai00

@github-actions github-actions Bot requested a review from bobbai00 May 22, 2026 15:58
@Yicong-Huang
Copy link
Copy Markdown
Contributor

For UI related PRs, please include UI screenshot as the change. Thanks

Comment thread frontend/package.json
Comment thread frontend/build-version.js
Comment on lines 21 to +25
const { version } = require("./package.json");
const { resolve, relative } = require("path");
const { writeFileSync, existsSync, mkdirSync } = require("fs-extra");

const gitInfo = gitDescribeSync({
dirtyMark: false,
dirtySemver: false,
});

gitInfo.version = version;
const buildNumber = generate(version);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can we simply call this method in source code, instead of doing so in post install script? I think we can get rid of such a post install script.

Copy link
Copy Markdown
Contributor Author

@Ma77Ball Ma77Ball May 23, 2026

Choose a reason for hiding this comment

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

@Yicong-Huang, this was a design decision because the buildNumber includes the date.

  • In the current format, it shows the date when yarn install is run.
  • In the advised format (in source code), it shows the date the user loads the page.

If we go with option 2, should I remove the date and show only the version, not the build number?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

hmm. neither option is reflecting the actual build time.

  • yarn install is to install packages. we need to generate this date when we actually build frontend for prod.
  • "when user loads the page" is also meaning less to be shown as a build time.

can we bundle this command with yarn run build --prod etc (I might be wrong on the exact build command)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes I can add it

Copy link
Copy Markdown
Contributor

@Yicong-Huang Yicong-Huang May 23, 2026

Choose a reason for hiding this comment

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

for dev environment, it is fine to either show a "dev" or git sha. This feature (show build number) is mainly for production usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file fix frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use build number to replace git hash display on the UI

3 participants