Skip to content
This repository was archived by the owner on Dec 19, 2025. It is now read-only.

[ADMINAPI-1292] Add Health Check for Security and Admin Databases#370

Merged
DavidJGapCR merged 6 commits intomainfrom
ADMINAPI-1292
Oct 21, 2025
Merged

[ADMINAPI-1292] Add Health Check for Security and Admin Databases#370
DavidJGapCR merged 6 commits intomainfrom
ADMINAPI-1292

Conversation

@jagudelo-gap
Copy link

This pull request adds comprehensive health check support to the application, including multi-tenancy scenarios, and improves the health check API response format. It introduces new tests to verify health check registration and refactors the health check registration logic for better maintainability.

Health check registration and configuration:

  • Refactored the AddHealthCheck extension method in HealthCheckServiceExtensions to support both single-tenant and multi-tenant configurations, registering health checks for both EdFi_Admin and EdFi_Security databases based on the database engine and tenancy settings. [1] [2]
  • Added an overload to AddHealthCheck that allows explicit registration of health checks by passing connection strings and database type directly.

Health check endpoint improvements:

  • Enhanced the /health endpoint to return a detailed JSON response including the status of each health check and any exceptions, and to return HTTP 503 if any health check is unhealthy.

Testing:

  • Added a new unit test class HealthCheckServiceExtensionsTests to verify that health checks are registered correctly for both single-tenant and multi-tenant configurations.

Dependency and import cleanup:

  • Cleaned up unused using directives in HealthCheckServiceExtensions.cs.

Dependency registration:

  • Added necessary imports for health checks in Program.cs to support the new health check features.

@jagudelo-gap jagudelo-gap changed the title [ADMINAPI-1292] - Health endpoint for both DB [ADMINAPI-1292] Add Health Check for Security and Admin Databases Oct 16, 2025
@jagudelo-gap jagudelo-gap requested a review from Copilot October 16, 2025 23:25
@github-actions
Copy link

github-actions bot commented Oct 16, 2025

Test Results

338 tests   337 ✅  16s ⏱️
  4 suites    1 💤
  4 files      0 ❌

Results for commit 254a221.

♻️ This comment has been updated with latest results.

Copy link

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 health checks for both Admin and Security databases (single-tenant and multi-tenant) and enhances the /health endpoint response with per-check detail and status-based HTTP codes.

  • Refactors health check registration to support multi-tenancy and both database types.
  • Adds an overload for explicit connection string-based registration.
  • Improves /health endpoint JSON output and introduces new unit tests (though coverage is minimal).

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
Application/EdFi.Ods.AdminApi/Program.cs Customizes /health endpoint response and status code logic.
Application/EdFi.Ods.AdminApi/Infrastructure/Helpers/HealthCheckServiceExtensions.cs Refactors registration to add both Admin and Security health checks with multi-tenant naming.
Application/EdFi.Ods.AdminApi.V1/Infrastructure/Helpers/HealthCheckServiceExtensions.cs Adds overload for explicit connection strings and database type.
Application/EdFi.Ods.AdminApi.UnitTests/Infrastructure/HealthCheckServiceExtensionsTests.cs Adds basic tests asserting health check service registration only.

@DavidJGapCR DavidJGapCR merged commit 727f5ac into main Oct 21, 2025
20 checks passed
@DavidJGapCR DavidJGapCR deleted the ADMINAPI-1292 branch October 21, 2025 17:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants