Fix plugin scaffold release versioning#872
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the plugin scaffolding/tooling so generated plugin repositories avoid plugin.json version churn by committing a stable 0.0.0 sentinel, while ensuring release builds still expose the real version via ldflags + sdk.ResolveBuildVersion. It also tightens the generated release workflows (pinned action SHAs + release contract gates) and adds/refreshes package docs for the plugin SDK surfaces.
Changes:
- Keep generated
plugin.jsonversions fixed at0.0.0(sentinel) instead of syncing to release versions. - Inject release version metadata into generated plugin binaries (GoReleaser ldflags /
Versionvar +ResolveBuildVersion) and wire it throughsdk.WithBuildVersion. - Add/refresh scaffolded release workflows (wfctl contract validation steps, pinned action refs) and add package/API docs.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| plugin/sdk/manifest.go | Adjusts top-of-file documentation framing for the plugin SDK manifest helpers. |
| plugin/sdk/generator.go | Changes scaffold defaults (sentinel versioning, Go version, GoReleaser ldflags) and updates generated release workflow steps. |
| plugin/sdk/generator_test.go | Updates/extends generator tests to assert sentinel versioning + build-version injection + workflow contents. |
| plugin/sdk/doc.go | Adds package documentation for the authoring/scaffolding SDK. |
| plugin/external/sdk/interfaces.go | Adds richer docs for runtime SDK interfaces/types and exports telemetry aliases for plugin authors. |
| plugin/external/sdk/doc.go | Adds package documentation and a canonical Serve(..., WithBuildVersion(...)) example for runtime SDK consumers. |
| plugin/doc.go | Adds package documentation describing host-side plugin primitives and where plugin authors should look instead. |
| cmd/wfctl/templates/ui-plugin/plugin.go.tmpl | Adds Version var + resolves runtime version via ResolveBuildVersion. |
| cmd/wfctl/templates/ui-plugin/main.go.tmpl | Passes build version into sdk.Serve via sdk.WithBuildVersion. |
| cmd/wfctl/templates/ui-plugin/.github/workflows/release.yml.tmpl | Adds wfctl setup + contract validation gates + ldflags version injection to the UI plugin release workflow template. |
| cmd/wfctl/templates/plugin/plugin.go.tmpl | Adds Version var + resolves runtime version via ResolveBuildVersion. |
| cmd/wfctl/templates/plugin/main.go.tmpl | Passes build version into sdk.Serve via sdk.WithBuildVersion. |
| cmd/wfctl/templates/plugin/.github/workflows/release.yml.tmpl | Adds wfctl setup + contract validation gates + ldflags version injection to the plugin release workflow template. |
| cmd/wfctl/plugin.go | Deprecates -version for wfctl plugin init and defaults it to the stable sentinel. |
| cmd/wfctl/plugin_init_test.go | Asserts wfctl plugin init produces plugin.json with the stable 0.0.0 sentinel version. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
⏱ Benchmark Results✅ No significant performance regressions detected. benchstat comparison (baseline → PR)
|
Summary
Closes #871
TDD invariant proof
With fix reverted:
With fix restored:
Verification