Skip to content

Backend Service Health and Version Endpoints

Summary

Add version information to backend health endpoints to enable the web application's Version Info dialog to display actual backend service versions and health status.

Current State

The Version Info dialog (PR #2228) displays:

  • Web Application: Version info from app-config.json (fully working)
  • API Service: Calls /health/live but endpoint returns only health status, not version info
  • PM Service: No endpoint configured (shows "unavailable")

Technical Details

Current health endpoint response (/health/live):

{
  "status": "Healthy"
}

Expected response for version display:

{
  "status": "Healthy",
  "version": "8.21.0",
  "gitVersion": "8.21.0",
  "gitSha": "abc1234",
  "gitInformationalVersion": "8.21.0+abc1234"
}

Proposed Changes

Modify existing /health/live or /health/ready endpoints to include version information in the response.

API Service (src/services/api/):

  • Add version info to health check response
  • Include gitVersion, gitSha, gitInformationalVersion

PM Service (src/services/project-management/):

  • Add version info to health check response
  • Add pmOrigin configuration property to ExternalConfig and app-config.json

Option 2: Dedicated Version Endpoint

Create a new /version or /api/version endpoint that returns only version information.

Pros:

  • Separation of concerns (health vs version)
  • Lighter weight response

Cons:

  • Additional endpoint to maintain
  • Two HTTP calls instead of one

Frontend Changes Required

Once backend endpoints return version info, update version-info-dialog.component.ts:

// Add PM service health check when pmOrigin is available
const pmOrigin = this.config.pmOrigin; // New config property
if (pmOrigin) {
  const pmHealth$ = this.http.get<HealthCheckResponse>(`${pmOrigin}/health/live`).pipe(
    timeout(5000),
    catchError(() => of(null))
  );
}

Configuration Changes

Add to ExternalConfig interface and app-config.json:

interface ExternalConfig {
  // ... existing properties
  pmOrigin?: string; // Optional PM service origin for health checks
}

Environment configurations:

{
  "pmOrigin": "https://pm.syrf.org.uk"  // Production
  // or
  "pmOrigin": "https://pm.staging.syrf.org.uk"  // Staging
}

Implementation Effort

Task Effort Priority
Add version to API health endpoint Low Medium
Add version to PM health endpoint Low Medium
Add pmOrigin to ExternalConfig Low Low
Update frontend health check logic Low Low
Update Helm chart configs Low Low
  • Frontend: version-info-dialog.component.ts
  • API Service: src/services/api/SyRF.API.Endpoint/
  • PM Service: src/services/project-management/SyRF.ProjectManagement.Endpoint/
  • Config: src/services/web/src/assets/app-config.json

Notes

This is a low-priority enhancement. The current implementation gracefully handles unavailable backend versions by showing "Version info not available" with a help icon.