Rust implementation of OCI Distribution Spec with granular access control

Embed build version in production binary #9

open opened by pierrelf.com

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_VERSION during cargo build
  • Consider using built or vergen crate to automatically embed git SHA and version at compile time, removing the need for manual env var management
  • Alternatively, use a build.rs script to embed git describe --tags --always output

Current behavior#

{
  "version": "test"
}

Expected behavior#

{
  "version": "0.1.0-abc1234"
}
sign up or login to add to the discussion
Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:meotu43t6usg4qdwzenk4s2t/sh.tangled.repo.issue/3mfkg7zbb642x