Skip to content

feat: warn in CLI when server runs dev or RC builds#24158

Merged
johnstcn merged 3 commits intomainfrom
cian/cli-server-version-warnings
Apr 9, 2026
Merged

feat: warn in CLI when server runs dev or RC builds#24158
johnstcn merged 3 commits intomainfrom
cian/cli-server-version-warnings

Conversation

@johnstcn
Copy link
Copy Markdown
Member

@johnstcn johnstcn commented Apr 8, 2026

Adds warning on stderr when the server version contains -devel or -rc.N

🤖 Written by a Coder Agent. Will be reviewed by a human.

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.
@johnstcn johnstcn changed the title feat(cli): warn when server runs dev or RC builds feat: warn when server runs dev or RC builds Apr 8, 2026
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.
@johnstcn johnstcn changed the title feat: warn when server runs dev or RC builds feat: warn in CLI when server runs dev or RC builds Apr 8, 2026
@johnstcn johnstcn marked this pull request as ready for review April 8, 2026 19:49
@johnstcn johnstcn requested review from Copilot and f0ssel April 8, 2026 19:49
Copy link
Copy Markdown
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

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 wrapTransportWithVersionCheck and extend it to warn on -devel and -rc.N server 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.

Comment thread cli/root_internal_test.go
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.
@johnstcn johnstcn enabled auto-merge (squash) April 8, 2026 20:05
@johnstcn johnstcn disabled auto-merge April 8, 2026 20:05
@johnstcn johnstcn enabled auto-merge (squash) April 8, 2026 20:07
Copy link
Copy Markdown
Member Author

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ready for human eyes

@johnstcn johnstcn merged commit 1e40cea into main Apr 9, 2026
30 checks passed
@johnstcn johnstcn deleted the cian/cli-server-version-warnings branch April 9, 2026 16:48
@github-actions github-actions bot locked and limited conversation to collaborators Apr 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants