Skip to content

fix(client): replace server_version property with get_server_version() method#83

Merged
zeevdr merged 1 commit into
mainfrom
fix/sync-client-server-version-method
May 20, 2026
Merged

fix(client): replace server_version property with get_server_version() method#83
zeevdr merged 1 commit into
mainfrom
fix/sync-client-server-version-method

Conversation

@zeevdr
Copy link
Copy Markdown
Member

@zeevdr zeevdr commented May 20, 2026

Summary

  • Properties should not hide I/O cost: server_version on the sync client triggered a gRPC call on access, while the async client already used the explicit method form get_server_version().
  • This aligns the sync API with the async API and makes the network round-trip visible at the call site.
  • The old property is kept for one release with a DeprecationWarning pointing callers to the new method.

Test plan

  • Renamed cached-fetch test to test_client_get_server_version_cached — covers call-once-then-cache behavior via get_server_version()
  • Added test_client_server_version_property_deprecated — asserts DeprecationWarning is emitted with the correct message when accessing the property
  • check_compatibility() calls get_server_version() directly — existing pass/fail tests cover this
  • Full suite: 204 passed, client.py at 100% coverage

Closes #52

🤖 Generated with Claude Code

…) method

The async client exposed get_server_version() as a method; the sync
client exposed server_version as a property, hiding the I/O cost. This
inconsistency made the API misleading — property access should not
trigger a network call.

Changes:
- Add get_server_version() to ConfigClient (same logic as the old property)
- Deprecate the server_version property with DeprecationWarning pointing
  to get_server_version()
- Update check_compatibility() to call get_server_version() directly
- Update test suite: rename cached-fetch test, add deprecation-warning test

Co-Authored-By: Claude <noreply@anthropic.com>

Closes #52
@zeevdr zeevdr added this to the Beta Readiness milestone May 20, 2026
@zeevdr zeevdr added bug Something isn't working size: S Quick win — a few hours or less priority: P1 Current milestone work labels May 20, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@zeevdr zeevdr merged commit 1162962 into main May 20, 2026
14 checks passed
@zeevdr zeevdr deleted the fix/sync-client-server-version-method branch May 20, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: P1 Current milestone work size: S Quick win — a few hours or less

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent server_version API across sync and async

1 participant