Skip to content

feat(health): include build version in health response#21

Merged
hammond01 merged 1 commit intodevelopfrom
feat/health-versioning
Mar 20, 2026
Merged

feat(health): include build version in health response#21
hammond01 merged 1 commit intodevelopfrom
feat/health-versioning

Conversation

@hammond01
Copy link
Copy Markdown
Owner

Summary\n- add �ersion field to /health/live and /health/ready JSON payload\n- resolve version from APP_BUILD_VERSION env var, fallback to assembly informational version\n- stamp deployment runtime with CI build version (

unNumber.runAttempt-sha7) in API deploy workflow\n\n## Why\nThis provides deterministic release traceability after each CI/CD run and makes it easy to verify what version is live from health endpoints.

Copilot AI review requested due to automatic review settings March 20, 2026 13:53
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds build/version traceability to the API health endpoints by including a version field in the /health/live and /health/ready JSON response, sourced from runtime deployment metadata.

Changes:

  • Add version field to health check JSON response, resolved from APP_BUILD_VERSION with assembly version fallback.
  • Stamp deployments with a CI-derived build version (runNumber.runAttempt-sha7) via the API deploy GitHub Actions workflow.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/ModularMonolith/CleanArchitecture.Api/HealthChecks/HealthCheckResponseWriter.cs Adds version to health payload and implements version resolution logic (env var → assembly informational/version → "unknown").
.github/workflows/api-ci-cd.yml Computes a CI build version and injects it into the deployed container as APP_BUILD_VERSION.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 15 to 19
var payload = new
{
status = report.Status.ToString(),
version = ApplicationVersion,
totalDuration = report.TotalDuration.TotalMilliseconds,
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

The new version field is added to the health JSON payload, but current integration tests only assert the status property. Add/extend tests to assert version is present and that APP_BUILD_VERSION (when set for the test host) overrides the assembly version fallback, to prevent regressions in this traceability feature.

Copilot uses AI. Check for mistakes.
@hammond01 hammond01 merged commit 7a46a13 into develop Mar 20, 2026
10 checks passed
@hammond01 hammond01 deleted the feat/health-versioning branch March 20, 2026 14:16
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.

2 participants