fix(release): inject httpapi.buildVersion everywhere + guard update check against non-semver versions#814
Merged
Merged
Conversation
…heck against non-semver versions
Release QA on v0.47.0-rc.4 found the installed app reporting version
'development' on every httpapi-backed surface, with the Spec 079 update
banner, 'mcpproxy doctor' and 'mcpproxy status' all offering v0.46.0 —
a DOWNGRADE prompt — and telemetry heartbeats reporting 'development'
(corrupting Spec 080 churn metrics for the whole RC channel).
Two root causes, both fixed:
1. Wrong/missing -X ldflags paths. Go silently ignores -X with a wrong
package path; the module is github.com/smart-mcp-proxy/mcpproxy-go:
- prerelease.yml used mcpproxy-go/internal/httpapi.buildVersion
(ignored) and the bogus mcpproxy-go/cmd/mcpproxy.version → every
RC binary shipped with buildVersion='development'
- scripts/build-windows-installer.ps1 (used by BOTH release.yml and
prerelease.yml) never set httpapi.buildVersion → stable Windows
installer builds have the same bug
- scripts/build.ps1 and pr-build.yml aligned for consistency
2. Checker.CheckNow() (the /api/v1/info forced-refresh path used by the
Web UI banner and doctor) lacked the non-semver guard that Start()
has, and compareVersions() ranks an invalid current version below
any release. A 'development' build therefore saw every stable
release as an available 'update'. CheckNow now skips like Start,
and compareVersions returns false for a non-semver current version.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Deploying mcpproxy-docs with
|
| Latest commit: |
faf6454
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f6a1ad6c.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://fix-rc-version-injection.mcpproxy-docs.pages.dev |
Member
Author
|
Cross-model review (Codex CLI 0.135.0, gpt-5.x): ACCEPT — "No actionable correctness issues were found in the diff. The linker flag updates target the module import path, and the update-check guards align CheckNow with the existing Start behavior for non-semver versions." Round 1/5, no findings to fix. |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 28846905036 --repo smart-mcp-proxy/mcpproxy-go
|
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Release QA on v0.47.0-rc.4 found the installed app reporting version
developmenton every httpapi-backed surface: the Spec 079 update banner,mcpproxy doctorandmcpproxy statusall offered v0.46.0 — a downgrade prompt — and telemetry heartbeats reporteddevelopment, corrupting Spec 080 churn metrics for the whole RC channel.Root cause 1 — wrong/missing
-Xldflags paths (silently ignored by Go)Module is
github.com/smart-mcp-proxy/mcpproxy-go:prerelease.ymlusedmcpproxy-go/internal/httpapi.buildVersion(ignored) + bogusmcpproxy-go/cmd/mcpproxy.version→ every RC binary shipsbuildVersion=developmentscripts/build-windows-installer.ps1(used by both release.yml and prerelease.yml) never sethttpapi.buildVersion→ stable Windows installer builds have the same bugscripts/build.ps1andpr-build.ymlaligned for consistencyRoot cause 2 — forced refresh bypasses the non-semver guard
Checker.CheckNow()(the/api/v1/inforefresh path behind the Web UI banner and doctor) lacked theisValidSemver()guard thatStart()has, andcompareVersions()ranks an invalid current version below any release → adevelopmentbuild sees every stable release as an available "update". Both guarded now.Evidence (live rc.4)
mcpproxy doctor: "Version: development (update available: v0.46.0)"/api/v1/info:{"version":"development","update":{"available":true,"latest_version":"v0.46.0"}}initializeserverInfo correctly saysv0.47.0-rc.4(main.version IS injected) — isolating the bug tohttpapi.buildVersionconsumersTests
TestChecker_CheckNow_NonSemverVersionSkipsCheck(development/dev/empty)TestChecker_CompareVersionsextended with invalid-current cases./scripts/test-api-e2e.sh: 65/65 PASS ·go test -racegreen · golangci-lint v2: 0 issues🤖 Generated with Claude Code