-
Notifications
You must be signed in to change notification settings - Fork 89
🩺 Add Health Check and Sessions Endpoints #925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
🩺 Add Health Check and Sessions Endpoints #925
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #925 +/- ##
========================================
Coverage 99.70% 99.70%
========================================
Files 71 71
Lines 8848 8859 +11
Branches 1154 1156 +2
========================================
+ Hits 8822 8833 +11
Misses 23 23
Partials 3 3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Fix docs. Co-authored-by: Shan E Ahmed Raza <[email protected]>
Fix docs. Co-authored-by: Shan E Ahmed Raza <[email protected]>
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds two new endpoints – one for verifying the server's health and another for retrieving active session-to-slide mappings – along with corresponding API documentation and tests.
- Adds documentation for the healthcheck and sessions endpoints in the OpenAPI spec (tileserver_api.yml).
- Implements route handlers for the healthcheck and sessions endpoints in the TileServer class.
- Provides unit tests for both endpoints in tests/test_tileserver.py.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
tiatoolbox/visualization/tileserver_api.yml | Adds API documentation for sessions and healthcheck endpoints. |
tiatoolbox/visualization/tileserver.py | Implements sessions and healthcheck endpoints; duplicate route registration observed. |
tests/test_tileserver.py | Adds tests to verify the behavior of the new endpoints. |
@@ -165,6 +165,8 @@ def __init__( # noqa: PLR0915 | |||
self.route("/tileserver/tap_query/<x>/<y>")(self.tap_query) | |||
self.route("/tileserver/prop_range", methods=["PUT"])(self.prop_range) | |||
self.route("/tileserver/shutdown", methods=["POST"])(self.shutdown) | |||
self.route("/tileserver/sessions", methods=["GET"])(self.sessions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sessions endpoint is registered twice in the init method, which may lead to confusion. Consider removing the duplicate registration to keep the endpoint configuration clear and maintainable.
self.route("/tileserver/sessions", methods=["GET"])(self.sessions) | |
# Removed duplicate registration of the /tileserver/sessions endpoint |
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sessions endpoint is registered only once, this is a false statement.
This PR introduces the healthcheck endpoint and the sessions endpoint.
The purpose of the healthcheck endpoint is to tell if the TileServer is running.
The purpose of the sessions endpoint is to return a mapping of all active sessions and their loaded Whole Slide Images (WSIs).