🩺 Add Health Check and Sessions Endpoints#925
🩺 Add Health Check and Sessions Endpoints#925shaneahmed merged 8 commits intoTissueImageAnalytics:developfrom
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.
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. |
| 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.
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 |
There was a problem hiding this comment.
The sessions endpoint is registered only once, this is a false statement.
measty
left a comment
There was a problem hiding this comment.
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).