Conversation
…y + contract tests Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR aims to eliminate wfctl validate false-negatives for built-in plugin module/step types by expanding the schema registry’s hardcoded known-type lists and adding contract tests to prevent future drift between built-in plugins and schema/wfctl registries.
Changes:
- Expanded
schema.coreModuleTypesto include module/step types that are registered at runtime by built-in plugins. - Added built-in registrations to the module/step schema registries so existing registry-contract tests pass.
- Added contract tests to assert that types exposed by
DefaultPlugins()are covered byschema.KnownModuleTypes()andwfctl’sKnownModuleTypes().
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| schema/step_schema_builtins.go | Adds many built-in StepSchema entries for previously missing step types. |
| schema/schema.go | Expands coreModuleTypes with missing built-in plugin module + step types. |
| schema/module_schema.go | Adds built-in ModuleSchema entries for newly included module types and registers step types as module types. |
| consistency_test.go | Adds contract test ensuring schema-known types cover built-in plugin factories. |
| cmd/wfctl/type_registry_test.go | Adds contract test ensuring wfctl-known module types cover built-in plugin module factories. |
| cmd/wfctl/type_registry.go | Extends wfctl’s known module type registry for help/discovery. |
| .gitignore | Ignores cmd/wfctl/.wfctl.yaml. |
| r.Register(&StepSchema{ | ||
| Type: "step.apigw_apply", | ||
| Plugin: "platform", | ||
| Description: "Applies (provisions or updates) an API gateway configuration.", | ||
| ConfigFields: []ConfigFieldDef{ | ||
| {Key: "module", Type: FieldTypeString, Description: "Name of the platform.apigateway module", Required: true}, | ||
| }, |
⏱ Benchmark Results✅ No significant performance regressions detected. benchstat comparison (baseline → PR)
|
|
@copilot apply changes based on the comments in this thread |
Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Fixed in bcac0aa. The config field keys in the newly added platform/storage/cicd step schemas now match their step factory implementations:
|
wfctl validatereportedunknown module type "auth.m2m"(and many others) becauseschema.coreModuleTypes— the hardcoded list used byschema.ValidateConfig()— was missing types registered at runtime by built-in plugins. The workaround was--skip-unknown-types.Changes
schema/schema.goauth.m2m,auth.oauth2,auth.token-blacklist,actor.pool/system,nosql.*,platform.*,gitlab.*,cache.redis,security.field-protection,security.scanner,storage.artifact,tracing.propagation, etc.)step.git_*,step.gitlab_*,step.trace_*,step.k8s_*,step.ecs_*,step.iac_*,step.policy_*,step.actor_*,step.marketplace_*, etc.)schema/module_schema.go+schema/step_schema_builtins.goregisterBuiltins()entries for all new types, satisfying the existingTestModuleSchemaRegistry_RegisterAndGet/TestCoreStepTypesHaveSchemascontracts.cmd/wfctl/type_registry.goKnownModuleTypes()registry (used for help/discovery), including allplatform.*,actor.*,iac.state,argo.workflows,security.*.Contract tests (prevent recurrence)
consistency_test.go: New sub-test loads allDefaultPlugins()viaPluginLoaderand asserts every type fromModuleFactories()/StepFactories()appears inschema.KnownModuleTypes(). This is the test that would have caught theauth.m2mgap at authoring time.cmd/wfctl/type_registry_test.go:TestKnownModuleTypesCoverAllPlugins— mirrors the existingTestKnownStepTypesCoverAllPluginspattern for module types.Original prompt
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.