Repository navigation
Closed
Description
Context
Today every plugin repo carries a duplicated `plugin.json.version` field that must be kept in sync with the git tag. The `sync-plugin-version.yml` workflow opens a PR after each tag to bump the field, but those PRs accumulate (13 stale in `workflow-plugin-digitalocean` alone before sweep 2026-05-23). The whole class of drift is preventable by not committing the version at all.
Proposed direction
Adopt an architecture where:
- Plugin binary version comes from build-time `-ldflags` at release time. The `version` field is removed from committed `plugin.json`. Plugin contract requires every plugin binary expose its version via a standard symbol (e.g. `pluginsdk.Version()` backed by an `-X` linker var).
- Registry-side validation rejects publish of any plugin whose version string does not match strict semver (`vN.N.N` or `vN.N.N-prerelease`). Branch-tagged or dirty builds (e.g. `v0.1.0-feat-foo.dirty`) are allowed locally and in test installs but rejected from public registry publish.
- wfctl grows a publish-gate validation (e.g. `wfctl plugin validate --for-publish`) that performs the same semver check before push to the registry. Local installs / test branches do not trigger the gate.
- All plugin repos audited to adopt the new approach: drop `plugin.json.version`, ensure goreleaser `-ldflags -X` is wired, ensure plugin binary surfaces version via the contract symbol.
- `sync-plugin-version.yml` workflow removed from every repo where it currently exists.
Affected surfaces
- workflow (this repo): wfctl validation + plugin contract symbol definition
- workflow-registry: publish-time semver gate
- workflow-plugin-{admin, agent, auth, authz, authz-ui, aws, azure, bento, ci-generator, cloud-ui, compute, cms, data-protection, digitalocean, edge-compute, edge-risk, gcp, github, payments, sandbox, security, supply-chain, tofu, waf, ...}: audit + drop committed version + verify ldflags wiring
- Any plugin repo running `sync-plugin-version.yml`: workflow removal
Why now
Surfaced 2026-05-23 by user when 13 stale sync-PRs piled up in workflow-plugin-digitalocean. Closing those was a sweep; this issue eliminates the root cause.
Acceptance criteria
- Plugin contract documents the version-symbol requirement
- wfctl `plugin validate --for-publish` rejects non-semver versions
- workflow-registry rejects non-semver publishes
- All public plugins migrated; `plugin.json.version` removed; goreleaser ldflags verified
- All private plugins migrated
- `sync-plugin-version.yml` removed from every plugin repo
- One full release cycle on one plugin proves end-to-end (tag → ldflags-baked version → install → contract surface)
Out of scope here
Refer to workflow-plugin-digitalocean#159 for unrelated true-blue/green deploy work.
Metadata
Metadata
Assignees
Labels
No labels
Activity
intel352 commentedon May 23, 2026
Design + plan drafted on branch
feat/758-plugin-version-ldflag(commit 6d25311).Design (cycle 3, PASS):
docs/plans/2026-05-23-plugin-version-ldflag-design.md— pivoted from cycle-1's full ldflag-replacement (3 Critical) to: keepplugin.json.versionfield, fix sync mechanism (direct-push or auto-merge), add tag-format semver gate in release.yml + registry, restore ldflag-contract via newsdk.ResolveBuildVersion+IaCServeOptions.BuildVersion+ lint script.Plan (cycle 1 FAIL):
docs/plans/2026-05-23-plugin-version-ldflag.md— 26 PRs / 29 tasks drafted. Adversarial cycle 1 found 6 Critical + 9 Important against the plan:sdk.Serve(non-IaC plugins) has noWithBuildVersionoption; Task 2 only coversIaCServeOptionscurl|bashfrom main is a supply-chain footgungo testpath (debug.ReadBuildInfo emits no vcs.* in tests)cmd/plugin/main.gopath; actual layout iscmd/workflow-plugin-<name>/main.gofor 9 reposPausing. Plan-rebuild is a user-intent-line decision (which repos to include in scope; how to handle the gap repos). Awaiting authorization on rework direction. See plan's final section "Plan adversarial cycle 1 — FAIL" for full enumeration.
feat(sdk): ResolveBuildVersion + IaCServeOptions.BuildVersion + WithB…
feat(wfctl): plugin validate-contract subcommand + PLUGIN_RELEASE_GAT…
fix(wfctl): propagate filepath.Walk error in scanMainGoFilesForContra…
feat(sdk+wfctl): ResolveBuildVersion + WithBuildVersion + plugin vali…
intel352 commentedon May 23, 2026
Pilot complete
Layer 1 + Layer 2 + Layer 3 pilot (5 plugins) all merged 2026-05-23 21:04-21:05Z.
workflow v0.61.0 tagged + released.
Layer 3b sweep (56 remaining plugin repos) tracked in #760 — awaits authorization based on pilot outcome.
Retro: PR #761 (in flight).
Closing once retro PR lands. Layer 3b remains open.
docs(retro): workflow#758 plugin version discipline — Layer 1+2+3 pil…
intel352 commentedon May 23, 2026
Pilot shipped (5 plugins) + retro merged. Layer 3b sweep tracked separately at #760.