chore: bump version to 260304.0.0#89
Conversation
Add `GrpcVersionCompat` struct and `grpc_changelog()` function that records min-compatible client/server versions at each package version where compatibility changed. Consumers use `.range(..=v).last()` to look up the applicable entry for any historical version. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add changelog entry for 260304.0.0 and a test asserting the current package version is present in the gRPC compatibility changelog. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
xp-trumpet
left a comment
There was a problem hiding this comment.
@xp-trumpet reviewed 3 files and all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on drmingdrmer).
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cc64e87729
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
This PR bumps the workspace version to 260304.0.0 and introduces a gRPC compatibility changelog API intended to let consumers look up minimum compatible client/server versions for historical package versions.
Changes:
- Bump package/workspace version to
260304.0.0and update version-related unit tests. - Add
GrpcVersionCompatandgrpc_changelog()to record min compatible gRPC client/server versions by package version. - Add tests ensuring the changelog aligns with
MIN_CLIENT_VERSION/MIN_SERVER_VERSION.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
crates/common/version/src/lib.rs |
Registers and re-exports the new gRPC changelog module; updates version assertions to 260304.0.0. |
crates/common/version/src/grpc_changelog.rs |
New compatibility changelog data structure, builder function, and unit tests. |
Cargo.toml |
Workspace version bump to 260304.0.0. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| assert!( | ||
| changelog.contains_key(¤t), | ||
| "changelog must contain an entry for the current version {}", | ||
| current | ||
| ); |
There was a problem hiding this comment.
test_grpc_changelog_contains_current_version enforces that every release version must have an explicit changelog entry, even when compatibility didn't change (which is why 260304.0.0 had to be added). If the goal is to ensure the changelog can answer queries for the current version, a more stable assertion is to look up changelog.range(..=current).next_back() and validate it matches MIN_CLIENT_VERSION/MIN_SERVER_VERSION (and optionally that current >= *changelog.keys().next_back().unwrap()).
| assert!( | |
| changelog.contains_key(¤t), | |
| "changelog must contain an entry for the current version {}", | |
| current | |
| ); | |
| let (_, compat) = changelog | |
| .range(..=current) | |
| .next_back() | |
| .unwrap_or_else(|| { | |
| panic!( | |
| "changelog must contain an entry for or before the current version {}", | |
| current | |
| ) | |
| }); | |
| assert_eq!( | |
| compat.min_client, MIN_CLIENT_VERSION, | |
| "changelog entry for or before current version {} must match MIN_CLIENT_VERSION", | |
| current | |
| ); | |
| assert_eq!( | |
| compat.min_server, MIN_SERVER_VERSION, | |
| "changelog entry for or before current version {} must match MIN_SERVER_VERSION", | |
| current | |
| ); |
| //! | ||
| //! Records the minimum compatible client and server versions at each package | ||
| //! version where compatibility changed. Consumers use | ||
| //! `.range(..=v).last()` to find the applicable entry for a given version. |
There was a problem hiding this comment.
The docs recommend using .range(..=v).last() to find the applicable entry. On a BTreeMap, last() will iterate through the entire range (O(n)); since BTreeMap::Range is a DoubleEndedIterator, using .range(..=v).next_back() returns the same entry without scanning.
| //! `.range(..=v).last()` to find the applicable entry for a given version. | |
| //! `.range(..=v).next_back()` to find the applicable entry for a given version. |
| /// Returns a changelog mapping each package version (where compatibility | ||
| /// changed) to the min-compatible client and server versions at that point. | ||
| /// | ||
| /// Only versions where `min_client` or `min_server` changed are included. | ||
| pub fn grpc_changelog() -> BTreeMap<Version, GrpcVersionCompat> { | ||
| const fn ver(major: u64, minor: u64, patch: u64) -> Version { | ||
| Version::new(major, minor, patch) | ||
| } | ||
|
|
||
| let mut m = BTreeMap::new(); | ||
|
|
||
| // 260205.0.0: client adds ExpireInMillis, PutSequential (server since 1.2.770) | ||
| m.insert(ver(260205, 0, 0), GrpcVersionCompat { | ||
| min_client: ver(1, 2, 676), | ||
| min_server: ver(1, 2, 770), | ||
| }); | ||
|
|
||
| // 260214.0.0: client adds KvGetMany(srv:1.2.869), TransactionPrevValue(srv:1.2.304) | ||
| m.insert(ver(260214, 0, 0), GrpcVersionCompat { | ||
| min_client: ver(1, 2, 676), | ||
| min_server: ver(1, 2, 869), | ||
| }); | ||
|
|
||
| // 260217.0.0: client adds KvTransactionPutMatchSeq (server since 260217.0.0) | ||
| #[cfg(feature = "txn-put-match-seq")] | ||
| m.insert(ver(260217, 0, 0), GrpcVersionCompat { | ||
| min_client: ver(1, 2, 676), | ||
| min_server: ver(260217, 0, 0), | ||
| }); | ||
|
|
||
| // 260217.0.0: without txn-put-match-seq, no new client requirement | ||
| #[cfg(not(feature = "txn-put-match-seq"))] | ||
| m.insert(ver(260217, 0, 0), GrpcVersionCompat { | ||
| min_client: ver(1, 2, 676), | ||
| min_server: ver(1, 2, 869), | ||
| }); | ||
|
|
||
| // 260304.0.0: no compatibility change | ||
| #[cfg(feature = "txn-put-match-seq")] | ||
| m.insert(ver(260304, 0, 0), GrpcVersionCompat { | ||
| min_client: ver(1, 2, 676), | ||
| min_server: ver(260217, 0, 0), | ||
| }); | ||
|
|
||
| #[cfg(not(feature = "txn-put-match-seq"))] | ||
| m.insert(ver(260304, 0, 0), GrpcVersionCompat { | ||
| min_client: ver(1, 2, 676), | ||
| min_server: ver(1, 2, 869), | ||
| }); |
There was a problem hiding this comment.
The function/docs state that only versions where min_client/min_server changed are included, but the map unconditionally adds an entry for 260304.0.0 even though the comment says "no compatibility change". This inconsistency will force adding a new entry on every version bump; consider either (a) removing no-op entries like 260304.0.0 and updating the docs/tests to use a range(..=v).next_back() lookup, or (b) changing the docs to explicitly state that the current version is always present even when compatibility did not change.
Changelog
chore: bump version to 260304.0.0
Add changelog entry for 260304.0.0 and a test asserting the current
package version is present in the gRPC compatibility changelog.
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
feat: add gRPC version compatibility changelog
Add
GrpcVersionCompatstruct andgrpc_changelog()function thatrecords min-compatible client/server versions at each package version
where compatibility changed. Consumers use
.range(..=v).last()tolook up the applicable entry for any historical version.
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com