Skip to content

The API build_info fields (version, commit, build_time) are always empty strings because no build-time variables are set in the Dockerfile #257

Description

@Lost-Z

Summary

The /health endpoint response includes version, commit, and build_time fields sourced from state.build_info. These values are intended to identify the deployed binary. However the Dockerfile does not set the corresponding CARGO_PKG_VERSION, GIT_COMMIT, or BUILD_TIME environment variables during the build step. As a result, all three fields are empty strings in every Docker-based deployment, making it impossible to identify which version is running from the health endpoint.

Expected Behavior

The /health endpoint should return the actual version, git commit SHA, and build timestamp of the running binary.

Proposed Solution

  • Add ARG GIT_COMMIT, ARG BUILD_TIME to the Dockerfile builder stage and pass them as ENV variables
  • Set them in docker-compose.full.yml and in the docker-publish CI workflow using --build-arg
  • Read them in the application's main.rs using std::env::var at startup

Affected Files

  • Dockerfile
  • docker-compose.full.yml
  • .github/workflows/docker-publish.yml

Activity

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

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't workinginfraInfrastructure, Docker, deploymentobservabilityMetrics, logging, tracing, health

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions