Cleanup/api pass - #173
Open
Xarlos89 wants to merge 13 commits into
Open
Conversation
JefeThePug
reviewed
Aug 23, 2026
Collaborator
There was a problem hiding this comment.
We don't want to use the http module from stdlib here instead of a manual dict?
from http import HTTPStatus
HTTPStatus.OK == 200 # True
JefeThePug
reviewed
Aug 23, 2026
JefeThePug
reviewed
Aug 23, 2026
JefeThePug
reviewed
Aug 23, 2026
JefeThePug
reviewed
Aug 23, 2026
| def get_log_setting(self, log_id): | ||
| return self._get_row(LOGGING_TABLE, log_id, "log_setting") | ||
|
|
||
| def get_log_settings(self): |
Collaborator
There was a problem hiding this comment.
Minor suggestion to avoid typos and reading too quickly and missing it...
get_log_setting and get_log_settings are very similar... perhaps a name like get_all_log_settings ?
JefeThePug
approved these changes
Aug 23, 2026
JefeThePug
left a comment
Collaborator
There was a problem hiding this comment.
Looks great. I've added a few comments here and there. Also some of the docker stuff is a bit over my head so I skipped it, but the python is good :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A full cleanup pass over the Flask API.
The API now uses a connection pool instead of a single psycopg connection, every route returns a correct HTTP status code, and the responses are consistent across all endpoints. Every cog was updated to the new response, and a pytest suite covering the routes was added and slammed into CI.
Fixes the long-standing jsonify(data, status_code) bug — that call serialised the status code into the body as a JSON array and always returned HTTP 200, which is why cogs were indexing responses as
result[0]["logging"][2].Closes #134