Skip to content

[pre-check] knative/func#3832 rebased (mcp: use build-time version) - #265

Open
lkingland wants to merge 3 commits into
mainfrom
pr-3832-rebased
Open

lkingland wants to merge 3 commits into
mainfrom
pr-3832-rebased

Conversation

@lkingland

Copy link
Copy Markdown
Owner

Fork-internal pre-check of the rebased contributor branch for knative#3832 (author: @Ankitsinghsisodya; authorship preserved).

Purpose: run the full Actions suite on our fork before any push to the contributor's branch. Not for merge.

Rebased onto knative/func main d926a693. The pkg/mcp/mcp.go conflict keeps main's readonly comment ("disables mutation tools when true").

Checked against the requested design:

  • pkg/version is a string stamp: Default = "v0.0.0+source", Vers = Default, Kver and Hash strings. No Get(), no Masterminds.
  • The Makefile adds each -X only when that value is non-empty, and still appends the Socat/Tar/FuncUtil image lines.
  • The MCP server stores version.Vers once at construction. Healthcheck reports that field.
  • cmd/root.go sets DefaultVersion = version.Default.
  • The empty-Vers fallback in cmd/version.go is gone.
  • pkg/app already passes version.Vers, Kver, and Hash through. Unchanged.
  • go.mod matches main. semver/v3 stays indirect.
  • The healthcheck test compares the reported version to version.Vers, so a hardcoded 0.1.0 fails.

Tip: 878395707dca8e53eed7964de0c984c9f78ce2f7

Ankitsinghsisodya and others added 3 commits October 30, 2026 20:26
The MCP server advertised a static version = "0.1.0" regardless of the
actual binary version. Stamp the Server with pkg/version.Vers (already
set via ldflags, defaulting to "v0.0.0+source" for source builds) and
use it for both the MCP Implementation version and the healthcheck
tool's reported version.

Per review feedback, keep pkg/version a plain string-stamp package with
no semver parsing (no Get(), no Masterminds dependency), and harden the
Makefile's LDFLAGS so an empty VERS/KVER/HASH doesn't clear the
package-level defaults via -X.
The stamp package does not import Masterminds. Moving semver/v3
into the direct require block was tidy noise. go mod tidy leaves
go.mod matching main.
A hardcoded "0.1.0" still looks like a version, so the old
healthcheck test stayed green. Compare the reported version
with the build stamp.
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