-
Notifications
You must be signed in to change notification settings - Fork 12
Add versioning and health check endpoints #113
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: main
Are you sure you want to change the base?
Conversation
- Introduced build arguments in Dockerfile for versioning information (version, git commit, build time). - Enhanced server startup logging to include version details. - Added a new `/version` endpoint to return server version information. - Implemented a health check endpoint that includes version info in the response. - Updated GitHub Actions workflow to automate CalVer versioning and tagging for Docker images.
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 introduces versioning and health monitoring capabilities to the vCon server. The changes enable CalVer-based automatic versioning during builds and provide endpoints for clients to check server version and health status.
Changes:
- Added version management module with functions to retrieve version, git commit, and build time information
- Implemented
/versionand/healthAPI endpoints for monitoring - Enhanced Docker build process to inject versioning metadata via build arguments
- Automated CalVer versioning and release creation in GitHub Actions workflow
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| server/version.py | New module providing version information retrieval functions with environment variable fallbacks |
| server/main.py | Added startup logging to display version information when server initializes |
| server/api.py | Implemented public /version and /health endpoints returning version metadata |
| docker/Dockerfile | Added build arguments and environment variables for version injection |
| .github/workflows/docker-publish.yml | Automated CalVer version generation, git tagging, Docker image tagging, and GitHub release creation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@pavanputhra Just a suggestion: it is common for API servers to return the version in response headers. This makes it easy to inspect using curl, proxies, load balancers, and APM tools. |
You, mean in every API calls? |
- Introduced VersionHeaderMiddleware to append version and commit information to all API responses. - Updated the version endpoint to reflect the new naming convention. - Enhanced response headers for better debugging and monitoring capabilities.
|
@slyapustin Updated according to your comments |
|
@pavanputhra How do you plan to update VCON_SERVER_VERSION? Should we consider defining the version inside the app instead (https://peps.python.org/pep-0396/)? That would be a more Pythonic approach and would allow the version to be tracked within the application without relying on an environment variable. |
/versionendpoint to return server version information.