Skip to content

chore(release): plugin-version discipline (workflow#758)#26

Merged
intel352 merged 1 commit into
mainfrom
chore/758-release-discipline
May 23, 2026
Merged

chore(release): plugin-version discipline (workflow#758)#26
intel352 merged 1 commit into
mainfrom
chore/758-release-discipline

Conversation

@intel352
Copy link
Copy Markdown
Contributor

Summary

Per workflow#758 Layer 3 — mechanical migration mirroring the canonical DO plugin pattern shipped at GoCodeAlone/workflow-plugin-digitalocean#165.

  • Delete .github/workflows/sync-plugin-version.yml — sync mechanism retired; goreleaser before-hook + binary ldflag carry release-tag truth.
  • plugin.json.version"0.0.0" sentinel (flat M.m.p, ParseSemver-compatible).
  • plugin.json.minEngineVersion0.61.0 (requires sdk.ResolveBuildVersion + IaCServeOptions.BuildVersion from workflow v0.61.0).
  • plugin.json.downloads: archive-name shape switched from workflow-plugin-aws_VERSION_OS_ARCH.tar.gzworkflow-plugin-aws-OS-ARCH.tar.gz to mirror DO. Release tag now embedded only in /releases/download/<tag>/ path; filename no longer carries version.
  • cmd/workflow-plugin-aws/main.go: passes sdk.ResolveBuildVersion(internal.Version) to IaCServeOptions.BuildVersion. Binary runtime version surfaces via GetManifest RPC even when committed plugin.json shows the sentinel.
  • provider.ProviderVersion: constvar so the -ldflags -X override actually takes effect (const is build-time, not link-time). Default "dev" in unit tests.
  • internal.Version = "dev": new var so the second goreleaser ldflag drives the runtime version surfaced via sdk.ResolveBuildVersion (previously dead-referencing a nonexistent symbol).
  • .goreleaser.yaml: adopt canonical .release/plugin.json rewrite pattern (rm + cp + sed for version + tag-path; wfctl plugin validate --strict-contracts pre-build). Archive name_template flattened to {{ .ProjectName }}-{{ .Os }}-{{ .Arch }}.
  • release.yml: setup-wfctl@v1 pinned to v0.61.0 + pre-build wfctl plugin validate-contract --for-publish + post-build --release-dir verification.
  • ci.yml: bump strict-contracts wfctl pin v0.20.1 → v0.61.0 (v0.20.1 cannot validate the new sentinel + minEngineVersion).
  • Bump workflow pin v0.57.0 → v0.61.0.
  • provider/provider_test.go: stop asserting hardcoded "1.0.0"; compare against provider.ProviderVersion.

Test plan

  • GOWORK=off go build ./... — green
  • GOWORK=off go test ./... -count=1 — all green
  • Local wfctl plugin validate-contract . — PASS
  • Local wfctl plugin validate-contract --for-publish --tag v0.0.1 . — PASS
  • release.yml gates fire on next vX.Y.Z tag push (post-merge)

Per-repo variance vs DO

  • Two ldflag-target packages (provider.ProviderVersion + internal.Version) instead of one — both retained per existing goreleaser config; internal.Version is the one consumed by sdk.ResolveBuildVersion.
  • provider.ProviderVersion had to be converted from constvar (DO never had a const).
  • internal.Version did not exist; added.
  • AWS .goreleaser.yaml retains windows GOOS (DO is linux+darwin only).
  • AWS has no equivalent of DO's TestPluginDownloadsMatchGoReleaserArchives URL-vs-version test, so no test retirement was required (host_conformance_test.go is module/step parity only — orthogonal).

Rollback

Revert PR. Restores sync workflow + workflow pin + version string. Pure-additive forward; revert is clean.

🤖 Generated with Claude Code

- Delete .github/workflows/sync-plugin-version.yml (sync mechanism retired;
  goreleaser before-hook + binary ldflag carry release-tag truth)
- plugin.json.version → "0.0.0" (sentinel; flat M.m.p parses through
  PluginManifest.ParseSemver without prerelease)
- plugin.json.minEngineVersion → 0.61.0 (requires sdk.ResolveBuildVersion +
  IaCServeOptions.BuildVersion landed in workflow v0.61.0)
- plugin.json.downloads: switch archive-name shape from
  workflow-plugin-aws_VERSION_OS_ARCH.tar.gz to
  workflow-plugin-aws-OS-ARCH.tar.gz to mirror canonical DO pattern (the
  release tag is now embedded only in /releases/download/<tag>/ path; the
  archive filename no longer carries the version)
- cmd/workflow-plugin-aws/main.go: pass sdk.ResolveBuildVersion(internal.Version)
  to IaCServeOptions.BuildVersion; binary's runtime version surfaces via
  GetManifest RPC even when committed plugin.json shows the sentinel
- provider.ProviderVersion: convert const → var so the goreleaser
  -ldflags -X override can take effect (const is build-time, not link-time);
  default sentinel "dev" applies in unit tests
- internal.Version = "dev": new var so the second goreleaser ldflag (which
  was previously dead-referencing a nonexistent symbol) drives the runtime
  version surfaced via sdk.ResolveBuildVersion
- .goreleaser.yaml: adopt the canonical .release/plugin.json rewrite pattern
  (rm -rf .release; cp + sed for version + tag-path; wfctl plugin validate
  --strict-contracts pre-build); archive name_template flattened to
  {{ .ProjectName }}-{{ .Os }}-{{ .Arch }}; src/dst remap of
  .release/plugin.json → plugin.json inside the tarball
- release.yml: setup-wfctl@v1 pinned to v0.61.0 + pre-build wfctl plugin
  validate-contract --for-publish + post-build --release-dir verification;
  go-version sourced from go.mod (was hardcoded "stable")
- ci.yml: bump strict-contracts wfctl pin v0.20.1 → v0.61.0 (v0.20.1
  cannot validate the new 0.0.0 sentinel + 0.61.0 minEngineVersion)
- Bump workflow pin v0.57.0 → v0.61.0
- provider/provider_test.go: stop asserting hardcoded "1.0.0" version
  string; compare against provider.ProviderVersion (sentinel "dev" in
  tests, tag at release time)

Rollback: revert PR; restores prior sync mechanism + workflow pin.
@intel352 intel352 merged commit 52f2af5 into main May 23, 2026
5 checks passed
@intel352 intel352 deleted the chore/758-release-discipline branch May 23, 2026 21:05
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.

1 participant