Granola-Team / mina-indexer

The Mina Indexer is a re-imagined version of the software collectively called the "Mina archive node."
Apache License 2.0
19 stars 10 forks source link

Unsure what git commit an Indexer is running #971

Closed jhult closed 5 months ago

jhult commented 5 months ago

Add a REST endpoint (e.g. /version or /about) that provides the git commit ('git rev-parse --short=8 HEAD) this Indexer instance was built against.

Note that the --version for the CLI returns mina-indexer 0.1.1 (due to this in Cargo.toml). We want the version (CLI command) to be the git commit (or perhaps something like Calendar Versioning).

jhult commented 5 months ago

This relates to https://github.com/Granola-Team/mina-block-explorer/issues/698 and the implementation PR #702:

image
trevorbernard commented 5 months ago

I was going to suggest adding a build.rs but you beat me to it. You could use something like the BUILDKITE_COMMIT env variable to set this value in CI/CD

robinbb commented 5 months ago

For consistency, please use the output of 'git rev-parse --short=8 HEAD', run at build time.

trevorbernard commented 5 months ago

For simplicity sake (and simplest solution to the problem), I fixed the CLI version command to include the git commit hash. If we really want to add an API, it should be another issue.