fix(wfctl): validate infra secret pseudo-modules#881
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates wfctl validate so it no longer rejects infra-only “pseudo-module” types (secrets.generate, secrets.requires) as unknown module types, aligning validation behavior with existing wfctl infra plan/align/bootstrap usage.
Changes:
- Allowlist
secrets.generateandsecrets.requiresduring CLI config validation viaschema.WithExtraModuleTypes(...). - Add a regression test ensuring infra configs containing those pseudo-modules validate successfully.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
cmd/wfctl/validate.go |
Adds extra allowed module types so infra secret pseudo-modules pass schema validation. |
cmd/wfctl/main_test.go |
Adds a regression test covering successful validation of infra secret pseudo-modules. |
⏱ Benchmark Results✅ No significant performance regressions detected. benchstat comparison (baseline → PR)
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
wfctl validatenow accepts the infra-only pseudo-module typessecrets.generateandsecrets.requireswithout requiring--skip-unknown-types.These module types are already consumed by
wfctl infra plan/align/bootstrap; the validator was the outlier and rejected valid infra configs before plugin/type validation could finish.Why
While validating GoCodeAlone/buymywishlist#276 against current
main, BMW's originalinfra.eventbus*blocker was already resolved/superseded by the pgchannel migration, but strict validation ofinfra.yamlstill failed on:error: modules[0].type: unknown module type "secrets.requires"The fix keeps these types local to CLI validation rather than adding them to the runtime engine's core module registry.
Verification
Red/green invariant:
Additional local verification:
End-to-end BMW validation using a
wfctlbinary built from this branch and BMW's pinned plugins installed into/tmp/bmw-wfctl-plugins-issue276: