feat: Add health check endpoint and documentation#95
Open
metaforx wants to merge 3 commits intodjango-cms:mainfrom
Open
feat: Add health check endpoint and documentation#95metaforx wants to merge 3 commits intodjango-cms:mainfrom
metaforx wants to merge 3 commits intodjango-cms:mainfrom
Conversation
Contributor
Reviewer's GuideAdds a minimal read-only health check endpoint at /api/healthcheck/, wires it into the URL configuration, documents it in both README and Sphinx reference docs, and introduces a small test to ensure it returns the expected payload and status code. Sequence diagram for the new health check request flowsequenceDiagram
actor MonitoringTool
participant DjangoURLResolver
participant HealthCheckView
participant ResponseObject
MonitoringTool->>DjangoURLResolver: HTTP GET /api/healthcheck/
DjangoURLResolver->>HealthCheckView: dispatch(request)
HealthCheckView->>HealthCheckView: get(request)
HealthCheckView-->>ResponseObject: create Response {status: ok}
ResponseObject-->>MonitoringTool: HTTP 200 {"status": "ok"}
Class diagram for the new HealthCheckView endpointclassDiagram
class APIView {
}
class HealthCheckView {
+ http_method_names: tuple
+ get(request): Response
}
APIView <|-- HealthCheckView
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #95 +/- ##
==========================================
+ Coverage 91.98% 92.03% +0.04%
==========================================
Files 19 19
Lines 886 891 +5
Branches 100 100
==========================================
+ Hits 815 820 +5
Misses 44 44
Partials 27 27 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="docs/source/reference/index.rst" line_range="8" />
<code_context>
OpenAPI Documentation
---------------------
- We recommend to use the :doc:`../tutorial/03-openapi-documentation` guide to setup a browsable OpenAPI documentation.
- This will automatically generate the latest endpoints and their documentation.
+ We recommend to use the :doc:`../tutorial/03-openapi-documentation` guide to setup a browsable OpenAPI documentation.
</code_context>
<issue_to_address>
**suggestion (typo):** Consider improving the grammar in this sentence ("recommend using" and "set up").
You could rephrase this to: "We recommend using the :doc:`../tutorial/03-openapi-documentation` guide to set up browsable OpenAPI documentation."
```suggestion
We recommend using the :doc:`../tutorial/03-openapi-documentation` guide to set up browsable OpenAPI documentation.
```
</issue_to_address>
### Comment 2
<location path="docs/source/reference/healthcheck.rst" line_range="1" />
<code_context>
+Healthcheck Endpoint
+====================
+
</code_context>
<issue_to_address>
**nitpick (typo):** Standardize the spelling of "health check" in the title with the rest of the document.
The title uses “Healthcheck” (one word), but the rest of the document uses “health check.” Please update the title to “Health Check Endpoint” for consistency with the body and README.
```suggestion
Health Check Endpoint
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
nitpick (typo) Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Suggestion (typo) Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
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.
fix #93
Summary by Sourcery
Add a minimal API health check endpoint and document its availability.
New Features:
Documentation:
Tests: