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

always add commit hash to version.build for /status endpoint #12722

Merged
merged 6 commits into from
Feb 11, 2025

Conversation

qiweiii
Copy link
Contributor

@qiweiii qiweiii commented Jan 12, 2025

fix #12624

After locally adding a tag 5.5.5

before changes:

curl -s localhost:3030/status | jq -Mr .version
{
  "version": "trunk",
  "build": "5.5.5",
  "rustc_version": "1.83.0"
}

after changes:

curl -s localhost:3030/status | jq -Mr .version
{
  "version": "trunk",
  "build": "5.5.5-0-g1dd1b0a92",
  "rustc_version": "1.83.0"
}

@qiweiii qiweiii requested a review from a team as a code owner January 12, 2025 13:10
@qiweiii qiweiii requested a review from akhi3030 January 12, 2025 13:10
@staffik staffik requested a review from andrei-near January 13, 2025 10:32
@staffik
Copy link
Contributor

staffik commented Jan 13, 2025

@andrei-near Could you take a look if it does not break something with release process?
Maybe adding a commit field would be a safer way, if validators potentially rely on the build field not having the commit hash for release build.

@qiweiii
Copy link
Contributor Author

qiweiii commented Feb 8, 2025

hi @staffik @andrei-near, I updated to use a new commit field for commit hash, the new response looks like:

{
  "version": "trunk",
  "build": "5.5.6",
  "commit": "107c0ab026e8bbd9794eca4484a73e400fbca270",
  "rustc_version": "1.83.0"
}

Copy link

codecov bot commented Feb 10, 2025

Codecov Report

Attention: Patch coverage is 80.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 70.56%. Comparing base (5929da5) to head (bb37d21).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
neard/src/cli.rs 0.00% 1 Missing ⚠️
neard/src/main.rs 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12722      +/-   ##
==========================================
- Coverage   70.57%   70.56%   -0.02%     
==========================================
  Files         851      851              
  Lines      174824   174832       +8     
  Branches   174824   174832       +8     
==========================================
- Hits       123385   123372      -13     
- Misses      46314    46334      +20     
- Partials     5125     5126       +1     
Flag Coverage Δ
backward-compatibility 0.36% <80.00%> (+<0.01%) ⬆️
db-migration 0.36% <80.00%> (+<0.01%) ⬆️
genesis-check 1.42% <80.00%> (+<0.01%) ⬆️
linux 70.42% <80.00%> (-0.02%) ⬇️
linux-nightly 70.20% <80.00%> (+<0.01%) ⬆️
pytests 1.73% <80.00%> (+<0.01%) ⬆️
sanity-checks 1.54% <80.00%> (+<0.01%) ⬆️
unittests 70.39% <80.00%> (-0.02%) ⬇️
upgradability 0.36% <80.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Contributor

@staffik staffik left a comment

Choose a reason for hiding this comment

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

Thanks!

neard/build.rs Outdated
//! master. Build is a `git describe` of the commit the binary was built at
//! (for official releases it should be the same as version).
//! master. Build is a `git describe` of the commit the binary was built at.
Copy link
Contributor

Choose a reason for hiding this comment

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

That change is not needed now that we have commit field, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes

@staffik staffik added this pull request to the merge queue Feb 11, 2025
Merged via the queue into near:master with commit fb95d7b Feb 11, 2025
23 of 24 checks passed
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.

Add git commit to the /status endpoint
2 participants