Conversation
2 tasks
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds version information accessibility to the API by exposing version numbers through a new HTTP endpoint and updating the health endpoint with structured responses. The changes enable better API introspection and monitoring capabilities.
- Adds a new
/versionendpoint that returns API and schema version information - Refactors the
/healthendpoint to return structured response models - Implements dynamic version extraction from Git tags in the CI/CD pipeline
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/server.py | Adds new /version endpoint and updates /health endpoint with structured responses |
| src/models.py | Defines Pydantic models for health and version API responses |
| src/README.md | Documents the source directory structure and contents |
| pyproject.toml | Updates version management approach with placeholder for CI/CD replacement |
| .github/workflows/build-and-push-image.yaml | Implements dynamic version extraction and injection during container builds |
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.
On this branch, I update the GitHub Actions workflow that builds the container image, so it gets the Git tag name (if the workflow was triggered by a GitHub Release being published) or the Git commit hash (otherwise), and overwrites the placeholder
"0.0.0"version number inpyproject.toml.I also added a
/versionAPI endpoint that reads the value frompyproject.tomland returns it to the HTTP client. This, effectively, allows HTTP clients to determine which version of the API they are accessing.I also updated the existing
/healthAPI endpoint to usetrue/falseas its possible field values, instead of one field using"ok"and the other field usingtrue/false. In other words, I standardized the values across fields. I also implemented a Pydantic model namedHealthResponse, which makes the "schema" of that response visible to users of our Swagger UI page.Finally, I added a
src/README.mdfile that contains one-line descriptions of the contents of thesrc/folder (except for one item, which I'm punting on describing).