Problem#
The health endpoint at grain.pierrelf.com/health reports "version": "test" because the BUILD_VERSION environment variable is not set during the production build. The get_build_info() function in utils.rs falls back to "test" when option_env!("BUILD_VERSION") is None.
This makes it impossible to identify which version is deployed in production.
Proposed Solution#
- Ensure the CI/CD pipeline (spindle) sets
BUILD_VERSIONduringcargo build - Consider using
builtorvergencrate to automatically embed git SHA and version at compile time, removing the need for manual env var management - Alternatively, use a
build.rsscript to embedgit describe --tags --alwaysoutput
Current behavior#
{
"version": "test"
}
Expected behavior#
{
"version": "0.1.0-abc1234"
}