Merged
Conversation
This allows the torc client to be upgraded while tracking compatibility with the server's HTTP API.
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request introduces a separate API versioning system for the torc HTTP API, independent of the binary/crate version. This allows the client to be upgraded frequently without implying server incompatibility, with the API version only changing when the HTTP contract changes.
Changes:
- Added
CLIENT_API_VERSIONconstant (0.8.0) separate from binary version - Modified server
/versionendpoint to return structured JSON withversion,api_version, andgit_hashfields - Updated client version checking logic to compare API versions instead of binary versions
- Added comprehensive test coverage for API version checking scenarios
- Updated UI and logging to display both binary and API versions
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/server/api_types.rs | Changed API_VERSION from "v0.7.0" to "0.8.0" (removed "v" prefix and bumped minor version) |
| src/server/http_server.rs | Modified get_version() to return JSON object with version, api_version, and git_hash fields |
| src/client/version_check.rs | Added CLIENT_API_VERSION constant, ServerInfo struct, and logic to compare API versions with backward compatibility for legacy servers |
| src/client.rs | Exported ServerInfo struct for use by other modules |
| src/client/job_runner.rs | Updated logging to include client and server API versions |
| src/bin/torc-dash.rs | Updated VersionResponse struct and handler to include and display API versions |
| src/tui/ui.rs | Modified UI to display server API version alongside binary version |
| tests/test_version_check.rs | Added 8 new tests covering API version checking scenarios including match, patch diff, minor diff, major diff, legacy servers, and field verification |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
This allows the torc client to be upgraded while tracking compatibility with the server's HTTP API.