-
Notifications
You must be signed in to change notification settings - Fork 95
🩺 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
🩺 Add Health Check and Sessions Endpoints #925
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #925 +/- ##
========================================
Coverage 99.69% 99.69%
========================================
Files 71 71
Lines 8921 8933 +12
Branches 1168 1170 +2
========================================
+ Hits 8894 8906 +12
Misses 23 23
Partials 4 4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Fix docs. Co-authored-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
Fix docs. Co-authored-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
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.
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.
These changes look good, happy to approve the PR
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).