feat: warn in CLI when server runs dev or RC builds#24158
Merged
Conversation
Enhance wrapTransportWithVersionCheck (renamed from wrapTransportWithVersionMismatchCheck) to also warn when the server version contains -devel or -rc.N prerelease tags. Add buildinfo.IsRCVersion() to detect release candidate versions, mirroring the existing IsDevVersion() pattern.
RC dev builds like v2.33.0-rc.1-devel+hash contain both -rc. and -devel tags. Swap the switch case order so RC is matched first.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds CLI-side warnings when connecting to servers running non-stable builds (development or release-candidate), while keeping the existing client/server version mismatch warning behavior.
Changes:
- Rename the transport wrapper to
wrapTransportWithVersionCheckand extend it to warn on-develand-rc.Nserver versions. - Add
buildinfo.IsRCVersion()for detecting release-candidate versions. - Add unit tests for
IsRCVersion()and extend CLI transport wrapper tests with a “stable version” subtest.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| cli/root.go | Renames and extends the HTTP transport wrapper to warn on RC/dev server builds (and still warn on mismatches). |
| cli/root_internal_test.go | Renames the transport wrapper test and adds an additional subtest for stable server versions. |
| buildinfo/buildinfo.go | Introduces IsRCVersion() helper. |
| buildinfo/buildinfo_test.go | Adds TestIsRCVersion table test coverage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Move the RC/dev warning message logic into serverVersionMessage() so it can be unit tested independently without the flag.Lookup test guard getting in the way.
f0ssel
approved these changes
Apr 9, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Adds warning on stderr when the server version contains
-develor-rc.N