ComputerScienceHouse / ComputerScienceHouse/packet

Add Healthcheck Route

Open
#215 1 comment 0 reactions 0 assignees View on GitHub
good first issue python
Dominant language
Python
Stars
25
Forks
33
PR merge metrics
No merged PRs in 30d

Description

This is a route that connects to the database, connects to ldap, and returns a json blob stating whether or not it can connect.

This should allow us to more reasonably monitor on whether or not packet is up

How I want this to work
```
GET /api/v1/healthcheck
```
That would return 200 only when both ldap and the database connect correctly, and a 5XX range response when they don't. Different 5XX code for ldap down, sql down and both down
```json
{
"ldap": true,
"database": true
}
```
Return the json no matter what the status code is.
Even better would be
```json
{
"ldap": {
"status": true,
"server": "stone.csh.rit.edu"
},
"database": {
"status": true,
"server": "mysql.csh.rit.edu"
},
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the Flask route registration and the existing database and LDAP connection helpers. Add GET /api/v1/healthcheck with JSON returned for every outcome, distinct 5XX responses for LDAP, database, or both failing, and verify the healthy response reports both dependencies.

Written by the indexing model from the issue text.

Assessment

Tech stack
flask, mysql, python, sqlalchemy
Domain
api, backend, databases, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.