Skip to content

Create new API version for server#113

Merged
daniel-thom merged 1 commit intomainfrom
fix/split-api-version
Feb 12, 2026
Merged

Create new API version for server#113
daniel-thom merged 1 commit intomainfrom
fix/split-api-version

Conversation

@daniel-thom
Copy link
Collaborator

This allows the torc client to be upgraded while tracking compatibility with the server's HTTP API.

This allows the torc client to be upgraded while tracking compatibility
with the server's HTTP API.
Copy link
Contributor

Copilot AI left a 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 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_VERSION constant (0.8.0) separate from binary version
  • Modified server /version endpoint to return structured JSON with version, api_version, and git_hash fields
  • 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.

@daniel-thom daniel-thom merged commit 1893dda into main Feb 12, 2026
9 checks passed
@daniel-thom daniel-thom deleted the fix/split-api-version branch February 12, 2026 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants