Skip to content

fix(release): inject httpapi.buildVersion everywhere + guard update check against non-semver versions#814

Merged
Dumbris merged 1 commit into
mainfrom
fix/rc-version-injection
Jul 7, 2026
Merged

fix(release): inject httpapi.buildVersion everywhere + guard update check against non-semver versions#814
Dumbris merged 1 commit into
mainfrom
fix/rc-version-injection

Conversation

@Dumbris

@Dumbris Dumbris commented Jul 7, 2026

Copy link
Copy Markdown
Member

Summary

Release QA on v0.47.0-rc.4 found the installed app reporting version development on every httpapi-backed surface: the Spec 079 update banner, mcpproxy doctor and mcpproxy status all offered v0.46.0 — a downgrade prompt — and telemetry heartbeats reported development, corrupting Spec 080 churn metrics for the whole RC channel.

Root cause 1 — wrong/missing -X ldflags paths (silently ignored by Go)

Module is github.com/smart-mcp-proxy/mcpproxy-go:

  • prerelease.yml used mcpproxy-go/internal/httpapi.buildVersion (ignored) + bogus mcpproxy-go/cmd/mcpproxy.versionevery RC binary ships buildVersion=development
  • scripts/build-windows-installer.ps1 (used by both release.yml and prerelease.yml) never set httpapi.buildVersionstable Windows installer builds have the same bug
  • scripts/build.ps1 and pr-build.yml aligned for consistency

Root cause 2 — forced refresh bypasses the non-semver guard

Checker.CheckNow() (the /api/v1/info refresh path behind the Web UI banner and doctor) lacked the isValidSemver() guard that Start() has, and compareVersions() ranks an invalid current version below any release → a development build sees every stable release as an available "update". Both guarded now.

Evidence (live rc.4)

  • Web UI banner: "Update available: v0.46.0 — you are running development"
  • mcpproxy doctor: "Version: development (update available: v0.46.0)"
  • /api/v1/info: {"version":"development","update":{"available":true,"latest_version":"v0.46.0"}}
  • MCP initialize serverInfo correctly says v0.47.0-rc.4 (main.version IS injected) — isolating the bug to httpapi.buildVersion consumers

Tests

  • TestChecker_CheckNow_NonSemverVersionSkipsCheck (development/dev/empty)
  • TestChecker_CompareVersions extended with invalid-current cases
  • Full ./scripts/test-api-e2e.sh: 65/65 PASS · go test -race green · golangci-lint v2: 0 issues

🤖 Generated with Claude Code

…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>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

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

View logs

@Dumbris

Dumbris commented Jul 7, 2026

Copy link
Copy Markdown
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-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

📦 Build Artifacts

Workflow Run: View Run
Branch: fix/rc-version-injection

Available Artifacts

  • archive-darwin-amd64 (28 MB)
  • archive-darwin-arm64 (25 MB)
  • archive-linux-amd64 (16 MB)
  • archive-linux-arm64 (15 MB)
  • archive-windows-amd64 (28 MB)
  • archive-windows-arm64 (25 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (22 MB)
  • installer-dmg-darwin-arm64 (19 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 28846905036 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

@Dumbris Dumbris merged commit e6190f6 into main Jul 7, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants