Skip to content

Add health check endpoint#202

Open
devin-ai-integration[bot] wants to merge 2 commits intomasterfrom
devin/1777649768-add-health-check-endpoint
Open

Add health check endpoint#202
devin-ai-integration[bot] wants to merge 2 commits intomasterfrom
devin/1777649768-add-health-check-endpoint

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot commented May 1, 2026

Summary

Adds a GET /health endpoint to the FTGO application that checks application and database connectivity status.

Endpoint behavior:

  • Returns 200 OK with {"status": "UP", "database": {"status": "UP"}} when the database connection is healthy
  • Returns 503 Service Unavailable with {"status": "DOWN", "database": {"status": "DOWN", "error": "..."}} when the database is unreachable or the connection is invalid

Changes:

  • HealthCheckController.java — new REST controller with a /health GET endpoint that validates DB connectivity via DataSource.getConnection() and connection.isValid(2) with proper return value checking
  • HealthCheckControllerTest.java — unit tests using Mockito covering healthy DB, connection refused, and invalid connection scenarios
  • ftgo-application/build.gradle — added spring-boot-starter-test as a test dependency for Mockito support

Review & Testing Checklist for Human

  • Verify GET /health returns 200 with status: UP when the app is running with a healthy MySQL connection
  • Verify GET /health returns 503 with status: DOWN when MySQL is stopped or unreachable
  • Confirm the endpoint does not conflict with the existing Actuator /actuator/health endpoint

Notes

  • The application already includes spring-boot-starter-actuator, which provides /actuator/health. This new /health endpoint is a custom, simpler alternative at the root path for easier integration with load balancers and container orchestration health probes.
  • The DataSource bean is auto-injected by Spring Boot from the existing MySQL configuration.

Link to Devin session: https://app.devin.ai/sessions/f9d0275342fc4acd955f123f8ea9bbdc
Requested by: @WesternConcrete


Devin Review

Status Commit
⚪ Not started

Run Devin Review

💡 Connect your GitHub account to enable automatic code reviews.

Open in Devin Review (Staging)
Open in Devin Review

- Add GET /health endpoint that checks application and database status
- Returns 200 with status UP when database is healthy
- Returns 503 with status DOWN when database is unavailable
- Add unit test with Mockito for both healthy and unhealthy scenarios
- Add spring-boot-starter-test dependency to ftgo-application module

Co-Authored-By: Wes Convery <2wconvery@gmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

devin-ai-integration[bot]

This comment was marked as resolved.

Report database as DOWN when isValid() returns false instead of
silently treating an invalid connection as healthy. Add test coverage
for this case.

Co-Authored-By: Wes Convery <2wconvery@gmail.com>
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.

1 participant