fix(cli): stamp printed MCP versions in bundles#2817
Conversation
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 require-ready-label-and-ciWonderful, this rule succeeded.
|
Greptile SummaryThis PR fixes MCPB bundle versioning by decoupling the generate-time manifest from the release tag:
Confidence Score: 5/5Safe to merge; the change is well-scoped and the on-disk manifest is never mutated by the version-stamp path. The core logic — stamping the version into ZIP bytes while leaving the on-disk manifest unchanged — is straightforward and thoroughly tested. Both the --version validation and the manifest rewrite have dedicated subtests covering happy paths, immutability of on-disk files, and rejection of invalid inputs. Golden fixture updates and compiled-output verification are included. The one style note (dead manifest.Version assignment) has no runtime impact. No files require special attention. Important Files Changed
|
|
@Mergifyio queue |
Merge Queue Status
This pull request spent 26 minutes 51 seconds in the queue, including 19 minutes 29 seconds running CI. Required conditions to merge
|
Intent
Issue: Closes #2387
Printed CLI MCPB bundles no longer present the Printing Press generator release as the bundle's own version, and generated MCP servers no longer default to a release-looking
1.0.0serverInfo version before release stamping.Approach
Generate-time
manifest.jsonnow uses a neutral0.0.0placeholder because the printed CLI release tag is not known during generation. The bundle path accepts--versionand stamps that printed CLI release version into the manifest bytes inside the.mcpbarchive without mutating the on-disk manifest.Generated HTTP and device MCP server mains now default their ldflag-overridable
versionvariable to0.0.0-dev; the existing goreleaser-X main.version={{ .Version }}injection remains the release-time source of truth.Scope
Primary area: MCPB packaging and generated MCP server version metadata.
Why this belongs in this repo: the bug appears in every future printed CLI generated or bundled by the Printing Press, so the fix belongs in the generator and bundle command rather than in one published CLI.
Catalog Justification
Embedded catalog fit: N/A
Distinct blueprint pattern: N/A
Closest existing entries checked: N/A
Source provenance: N/A
Auth and tenant assumptions: N/A
Safe default surface: N/A
Generation path: N/A
Stale-body check: N/A
Risk
The main risk is release workflow adoption: published CLI workflows must pass
cli-printing-press bundle --version <release>to stamp non-placeholder MCPB versions. Generated MCP server releases still receive the tag via existing goreleaser ldflags, and generate-time artifacts intentionally remain placeholders.Output Contract
Generated MCP server
main.gofiles now emitvar version = "0.0.0-dev"and still pass that variable toserver.NewMCPServer. Golden fixtures cover HTTP, stdio, and device generated MCP mains.scripts/verify-generator-output.shcompiled representative generated modules for HTTP, device, and MCP-first cases.Verification
go test ./internal/pipeline ./internal/cli ./internal/generator -run 'Test(BuildMCPBBundle|WriteMCPBManifest|NewBundleCmd|GenerateMCPMainRemoteOptIn|GeneratedBLEDeviceEmitsMCPSurface)'scripts/golden.sh verifyscripts/verify-generator-output.sh generate-golden-api generate-device-ble generate-mcp-apigo test ./...go build -o ./cli-printing-press ./cmd/cli-printing-pressgolangci-lint run ./...AI / Automation Disclosure