fix(wfctl): handle plugin flags and adoption secrets#666
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates wfctl plugin install argument parsing so install-specific flags can appear after the plugin name, matching the CLI behavior described in the PR.
Changes:
- Reorders recognized install flags ahead of positionals before parsing.
- Adds a regression test for
wfctl plugin install test --plugin-dir <dir>. - Applies a comment formatting cleanup in
plugin_install.go.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
cmd/wfctl/plugin_install.go |
Adds interspersed argument handling for plugin install flags. |
cmd/wfctl/plugin_install_test.go |
Adds regression coverage for trailing --plugin-dir install usage. |
Comment on lines
+286
to
+289
| if i+1 < len(args) { | ||
| i++ | ||
| flags = append(flags, args[i]) | ||
| } |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
⏱ Benchmark Results✅ No significant performance regressions detected. benchstat comparison (baseline → PR)
|
ad38f11 to
8cf1296
Compare
8cf1296 to
f43cc62
Compare
Accept plugin install flags after positional plugin names. Route sensitive outputs discovered during resource adoption through the configured secrets provider so infra_output can consume them in the same apply.
f43cc62 to
3e1725f
Compare
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 plugin install <name> --plugin-dir <dir>and other interspersed install optionsadopt_existingresource reads through the configured secrets providerinfra_outputin the same apply while preserving read-only behavior when no secrets provider is configuredVerification
GOWORK=off go test ./cmd/wfctl -run TestRunPluginInstallHonorsTrailingPluginDirFlag -count=1fails withplugin "test" not found in registry defaultGOWORK=off go test ./cmd/wfctl -run TestApplyWithProvider_AdoptionRoutesNewSensitiveOutputs -count=1fails because adopteduriis absent from state/handoffGOWORK=off go test ./cmd/wfctl -run 'TestApplyWithProvider_AdoptionRoutesNewSensitiveOutputs|TestAdoptExistingResources_AdoptionRoutingSaveFailureCleansSecretsOnly|TestApplyWithProvider_AdoptsExistingDNSBeforeComputePlan|TestApplyWithProvider_DNSAdoptionFailedUpdateKeepsLiveAppliedConfig|TestRunPluginInstallHonorsTrailingPluginDirFlag|TestRunPluginInstallTrailingFlagMissingValueErrors|TestInterspersedPluginInstallArgsReordersSupportedForms' -count=1GOWORK=off golangci-lint run --timeout=5m ./cmd/wfctlgit diff --checkKnown unrelated local failure
GOWORK=off go test ./cmd/wfctl -count=1currently fails in existing local-only tests:TestConfigMigrate_DefaultWriterIsStderrandTestInfraMultiEnv_E2E(./data/pluginslacks a local DigitalOcean plugin).