fix: wfctl list_step_types missing 51 built-in step types#306
Conversation
Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates wfctl list-step-types / MCP discovery by expanding the hardcoded KnownStepTypes() registry to include step types that are already registered by built-in plugins at runtime, improving IDE completions and config validation accuracy.
Changes:
- Added the previously omitted built-in step types to
KnownStepTypes()(by plugin). - Expanded
TestKnownStepTypesPopulatedto assert presence of the newly added step types. - Increased the minimum step-type count threshold to reduce the chance of future silent omissions.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| cmd/wfctl/type_registry.go | Extends the static step-type registry with additional built-in step types and their config keys. |
| cmd/wfctl/type_registry_test.go | Updates tests to cover newly added step types and raises the step-count regression threshold. |
| cmd/wfctl/main.go | Formatting/alignment changes to the CLI command map. |
| func TestStepTypeCount(t *testing.T) { | ||
| types := KnownStepTypes() | ||
| // We should have a substantial number of step types | ||
| if len(types) < 20 { | ||
| t.Errorf("expected at least 20 step types, got %d", len(types)) | ||
| // We should have a substantial number of step types — all built-in plugin steps. | ||
| // This threshold guards against accidental removal; update it when new steps are added. | ||
| if len(types) < 120 { | ||
| t.Errorf("expected at least 120 step types, got %d — some step types may have been dropped", len(types)) | ||
| } | ||
| } |
There was a problem hiding this comment.
The regression guard in TestStepTypeCount is still weak against future omissions: it can pass even if specific built-in step types are missing (as long as the total stays >= 120). Since the goal of this PR is to keep KnownStepTypes() in sync with built-in plugins, consider asserting that every step type returned by plugins/all.DefaultPlugins() (via p.StepFactories() keys or p.EngineManifest().StepTypes) exists in KnownStepTypes(). That will deterministically catch any dropped/forgotten step types without relying on a brittle numeric threshold.
⏱ Benchmark Results✅ No significant performance regressions detected. benchstat comparison (baseline → PR)
|
|
@copilot apply changes based on the comments in this thread Also address the failing linter |
…teps, replace count guard with plugin cross-check test Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Done in d578ef8:
|
|
@copilot Ensure tests and linter are passing |
… test) Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
KnownStepTypes()incmd/wfctl/type_registry.gois a hardcoded static map that was never updated as new step types were added to plugins. This causedwfctl list_step_types(and MCP discovery) to silently omit registered steps, breaking IDE completions and config validation for types that work fine at runtime.Changes
cmd/wfctl/type_registry.goAdded all missing step types with correct config keys, by plugin:
step.json_parse,step.raw_response,step.auth_validate,step.authz_check,step.hash,step.regex_match,step.parallel,step.field_reencrypt,step.token_revoke,step.sandbox_exec,step.ui_scaffold,step.ui_scaffold_analyzestep.actor_send,step.actor_askstep.secret_rotatestep.platform_template;step.k8s_plan/apply/status/destroy;step.scaling_*×4;step.iac_*×5;step.dns_*,step.network_*,step.apigw_*,step.ecs_*×3–4 each;step.app_deploy/status/rollbackstep.git_clone,step.git_commit,step.git_push,step.git_tag,step.git_checkoutAlso corrected inaccurate
ConfigKeysforstep.scaling_planandstep.scaling_apply(both only acceptscaling), and added the missingfail_on_errorkey tostep.sandbox_exec.cmd/wfctl/type_registry_test.goTestKnownStepTypesPopulatedto cover all newly added step types including the three called out in the issueTestStepTypeCountthreshold with a newTestKnownStepTypesCoverAllPluginstest that loads allDefaultPlugins()viaplugin.PluginLoaderand asserts every registered step factory is present inKnownStepTypes()— deterministically catching any future omissionsOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.