Skip to content

fix(wfctl): handle plugin flags and adoption secrets#666

Merged
intel352 merged 1 commit into
mainfrom
fix/wfctl-plugin-install-flags
May 14, 2026
Merged

fix(wfctl): handle plugin flags and adoption secrets#666
intel352 merged 1 commit into
mainfrom
fix/wfctl-plugin-install-flags

Conversation

@intel352
Copy link
Copy Markdown
Contributor

@intel352 intel352 commented May 14, 2026

Summary

  • allow wfctl plugin install <name> --plugin-dir <dir> and other interspersed install options
  • route sensitive outputs discovered during adopt_existing resource reads through the configured secrets provider
  • hand routed adopted secrets to infra_output in the same apply while preserving read-only behavior when no secrets provider is configured
  • clean up newly routed adoption secrets if state persistence fails without deleting the adopted cloud resource

Verification

  • RED proof: with the parser fix removed, GOWORK=off go test ./cmd/wfctl -run TestRunPluginInstallHonorsTrailingPluginDirFlag -count=1 fails with plugin "test" not found in registry default
  • RED proof: with adoption routing removed, GOWORK=off go test ./cmd/wfctl -run TestApplyWithProvider_AdoptionRoutesNewSensitiveOutputs -count=1 fails because adopted uri is absent from state/handoff
  • GOWORK=off go test ./cmd/wfctl -run 'TestApplyWithProvider_AdoptionRoutesNewSensitiveOutputs|TestAdoptExistingResources_AdoptionRoutingSaveFailureCleansSecretsOnly|TestApplyWithProvider_AdoptsExistingDNSBeforeComputePlan|TestApplyWithProvider_DNSAdoptionFailedUpdateKeepsLiveAppliedConfig|TestRunPluginInstallHonorsTrailingPluginDirFlag|TestRunPluginInstallTrailingFlagMissingValueErrors|TestInterspersedPluginInstallArgsReordersSupportedForms' -count=1
  • GOWORK=off golangci-lint run --timeout=5m ./cmd/wfctl
  • git diff --check

Known unrelated local failure

  • GOWORK=off go test ./cmd/wfctl -count=1 currently fails in existing local-only tests: TestConfigMigrate_DefaultWriterIsStderr and TestInfraMultiEnv_E2E (./data/plugins lacks a local DigitalOcean plugin).

Copilot AI review requested due to automatic review settings May 14, 2026 05:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 thread cmd/wfctl/plugin_install.go Outdated
Comment on lines +286 to +289
if i+1 < len(args) {
i++
flags = append(flags, args[i])
}
@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

❌ Patch coverage is 78.87324% with 15 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/wfctl/infra_apply.go 68.42% 8 Missing and 4 partials ⚠️
cmd/wfctl/plugin_install.go 90.90% 1 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 14, 2026

⏱ Benchmark Results

No significant performance regressions detected.

benchstat comparison (baseline → PR)
## benchstat: baseline → PR
baseline-bench.txt:264: parsing iteration count: invalid syntax
baseline-bench.txt:257167: parsing iteration count: invalid syntax
baseline-bench.txt:560642: parsing iteration count: invalid syntax
baseline-bench.txt:815388: parsing iteration count: invalid syntax
baseline-bench.txt:1117972: parsing iteration count: invalid syntax
baseline-bench.txt:1584026: parsing iteration count: invalid syntax
benchmark-results.txt:264: parsing iteration count: invalid syntax
benchmark-results.txt:303430: parsing iteration count: invalid syntax
benchmark-results.txt:829097: parsing iteration count: invalid syntax
benchmark-results.txt:1121079: parsing iteration count: invalid syntax
benchmark-results.txt:1643425: parsing iteration count: invalid syntax
benchmark-results.txt:1918640: parsing iteration count: invalid syntax
goos: linux
goarch: amd64
pkg: github.com/GoCodeAlone/workflow/dynamic
cpu: AMD EPYC 7763 64-Core Processor                
                            │ baseline-bench.txt │       benchmark-results.txt        │
                            │       sec/op       │    sec/op     vs base              │
InterpreterCreation-4               7.520m ± 57%   6.368m ± 73%       ~ (p=0.818 n=6)
ComponentLoad-4                     3.593m ±  1%   3.659m ±  6%  +1.85% (p=0.002 n=6)
ComponentExecute-4                  1.970µ ±  0%   1.980µ ±  1%  +0.51% (p=0.039 n=6)
PoolContention/workers-1-4          1.103µ ±  1%   1.111µ ±  2%  +0.73% (p=0.035 n=6)
PoolContention/workers-2-4          1.090µ ±  3%   1.127µ ±  2%  +3.35% (p=0.015 n=6)
PoolContention/workers-4-4          1.090µ ±  1%   1.124µ ±  3%  +3.07% (p=0.002 n=6)
PoolContention/workers-8-4          1.100µ ±  4%   1.115µ ±  3%       ~ (p=0.093 n=6)
PoolContention/workers-16-4         1.101µ ±  1%   1.115µ ±  3%  +1.27% (p=0.011 n=6)
ComponentLifecycle-4                3.636m ±  2%   3.731m ±  1%  +2.62% (p=0.002 n=6)
SourceValidation-4                  2.333µ ±  1%   2.363µ ±  0%  +1.26% (p=0.002 n=6)
RegistryConcurrent-4                819.5n ±  5%   835.0n ±  3%  +1.90% (p=0.026 n=6)
LoaderLoadFromString-4              3.626m ±  1%   3.774m ±  1%  +4.07% (p=0.002 n=6)
geomean                             18.94µ         19.02µ        +0.42%

                            │ baseline-bench.txt │        benchmark-results.txt         │
                            │        B/op        │     B/op      vs base                │
InterpreterCreation-4               2.027Mi ± 0%   2.027Mi ± 0%       ~ (p=0.370 n=6)
ComponentLoad-4                     2.180Mi ± 0%   2.180Mi ± 0%       ~ (p=1.000 n=6)
ComponentExecute-4                  1.203Ki ± 0%   1.203Ki ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-1-4          1.203Ki ± 0%   1.203Ki ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-2-4          1.203Ki ± 0%   1.203Ki ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-4-4          1.203Ki ± 0%   1.203Ki ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-8-4          1.203Ki ± 0%   1.203Ki ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-16-4         1.203Ki ± 0%   1.203Ki ± 0%       ~ (p=1.000 n=6) ¹
ComponentLifecycle-4                2.183Mi ± 0%   2.183Mi ± 0%       ~ (p=0.911 n=6)
SourceValidation-4                  1.984Ki ± 0%   1.984Ki ± 0%       ~ (p=1.000 n=6) ¹
RegistryConcurrent-4                1.133Ki ± 0%   1.133Ki ± 0%       ~ (p=1.000 n=6) ¹
LoaderLoadFromString-4              2.182Mi ± 0%   2.182Mi ± 0%       ~ (p=0.848 n=6)
geomean                             15.25Ki        15.25Ki       -0.00%
¹ all samples are equal

                            │ baseline-bench.txt │        benchmark-results.txt        │
                            │     allocs/op      │  allocs/op   vs base                │
InterpreterCreation-4                15.68k ± 0%   15.68k ± 0%       ~ (p=1.000 n=6)
ComponentLoad-4                      18.02k ± 0%   18.02k ± 0%       ~ (p=1.000 n=6)
ComponentExecute-4                    25.00 ± 0%    25.00 ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-1-4            25.00 ± 0%    25.00 ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-2-4            25.00 ± 0%    25.00 ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-4-4            25.00 ± 0%    25.00 ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-8-4            25.00 ± 0%    25.00 ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-16-4           25.00 ± 0%    25.00 ± 0%       ~ (p=1.000 n=6) ¹
ComponentLifecycle-4                 18.07k ± 0%   18.07k ± 0%       ~ (p=1.000 n=6) ¹
SourceValidation-4                    32.00 ± 0%    32.00 ± 0%       ~ (p=1.000 n=6) ¹
RegistryConcurrent-4                  2.000 ± 0%    2.000 ± 0%       ~ (p=1.000 n=6) ¹
LoaderLoadFromString-4               18.06k ± 0%   18.06k ± 0%       ~ (p=1.000 n=6) ¹
geomean                               183.3         183.3       +0.00%
¹ all samples are equal

pkg: github.com/GoCodeAlone/workflow/middleware
                                  │ baseline-bench.txt │       benchmark-results.txt        │
                                  │       sec/op       │    sec/op     vs base              │
CircuitBreakerDetection-4                  285.8n ± 5%   287.8n ± 14%  +0.68% (p=0.037 n=6)
CircuitBreakerExecution_Success-4          21.52n ± 0%   21.53n ±  1%       ~ (p=0.329 n=6)
CircuitBreakerExecution_Failure-4          66.16n ± 0%   66.34n ±  0%       ~ (p=0.093 n=6)
geomean                                    74.09n        74.35n        +0.34%

                                  │ baseline-bench.txt │       benchmark-results.txt        │
                                  │        B/op        │    B/op     vs base                │
CircuitBreakerDetection-4                 144.0 ± 0%     144.0 ± 0%       ~ (p=1.000 n=6) ¹
CircuitBreakerExecution_Success-4         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
CircuitBreakerExecution_Failure-4         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
geomean                                              ²               +0.00%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                                  │ baseline-bench.txt │       benchmark-results.txt        │
                                  │     allocs/op      │ allocs/op   vs base                │
CircuitBreakerDetection-4                 1.000 ± 0%     1.000 ± 0%       ~ (p=1.000 n=6) ¹
CircuitBreakerExecution_Success-4         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
CircuitBreakerExecution_Failure-4         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
geomean                                              ²               +0.00%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

pkg: github.com/GoCodeAlone/workflow/module
                                 │ baseline-bench.txt │       benchmark-results.txt        │
                                 │       sec/op       │    sec/op     vs base              │
JQTransform_Simple-4                     877.4n ± 28%   877.9n ± 31%       ~ (p=0.937 n=6)
JQTransform_ObjectConstruction-4         1.452µ ±  1%   1.461µ ±  0%  +0.62% (p=0.045 n=6)
JQTransform_ArraySelect-4                3.369µ ±  1%   3.404µ ±  4%  +1.04% (p=0.015 n=6)
JQTransform_Complex-4                    38.24µ ±  0%   38.74µ ±  3%  +1.30% (p=0.026 n=6)
JQTransform_Throughput-4                 1.784µ ±  1%   1.792µ ±  1%       ~ (p=0.234 n=6)
SSEPublishDelivery-4                     63.20n ±  1%   63.94n ±  7%  +1.17% (p=0.002 n=6)
geomean                                  1.626µ         1.639µ        +0.77%

                                 │ baseline-bench.txt │        benchmark-results.txt         │
                                 │        B/op        │     B/op      vs base                │
JQTransform_Simple-4                   1.273Ki ± 0%     1.273Ki ± 0%       ~ (p=1.000 n=6) ¹
JQTransform_ObjectConstruction-4       1.773Ki ± 0%     1.773Ki ± 0%       ~ (p=1.000 n=6) ¹
JQTransform_ArraySelect-4              2.625Ki ± 0%     2.625Ki ± 0%       ~ (p=1.000 n=6) ¹
JQTransform_Complex-4                  16.22Ki ± 0%     16.22Ki ± 0%       ~ (p=1.000 n=6) ¹
JQTransform_Throughput-4               1.984Ki ± 0%     1.984Ki ± 0%       ~ (p=1.000 n=6) ¹
SSEPublishDelivery-4                     0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=6) ¹
geomean                                             ²                 +0.00%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                                 │ baseline-bench.txt │       benchmark-results.txt        │
                                 │     allocs/op      │ allocs/op   vs base                │
JQTransform_Simple-4                     10.00 ± 0%     10.00 ± 0%       ~ (p=1.000 n=6) ¹
JQTransform_ObjectConstruction-4         15.00 ± 0%     15.00 ± 0%       ~ (p=1.000 n=6) ¹
JQTransform_ArraySelect-4                30.00 ± 0%     30.00 ± 0%       ~ (p=1.000 n=6) ¹
JQTransform_Complex-4                    324.0 ± 0%     324.0 ± 0%       ~ (p=1.000 n=6) ¹
JQTransform_Throughput-4                 17.00 ± 0%     17.00 ± 0%       ~ (p=1.000 n=6) ¹
SSEPublishDelivery-4                     0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
geomean                                             ²               +0.00%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

pkg: github.com/GoCodeAlone/workflow/schema
                                    │ baseline-bench.txt │       benchmark-results.txt        │
                                    │       sec/op       │    sec/op     vs base              │
SchemaValidation_Simple-4                   1.110µ ± 19%   1.111µ ±  2%       ~ (p=1.000 n=6)
SchemaValidation_AllFields-4                1.662µ ±  2%   1.686µ ± 13%       ~ (p=0.065 n=6)
SchemaValidation_FormatValidation-4         1.584µ ±  1%   1.592µ ±  3%       ~ (p=0.240 n=6)
SchemaValidation_ManySchemas-4              1.795µ ±  3%   1.825µ ±  3%       ~ (p=0.180 n=6)
geomean                                     1.513µ         1.527µ        +0.92%

                                    │ baseline-bench.txt │       benchmark-results.txt        │
                                    │        B/op        │    B/op     vs base                │
SchemaValidation_Simple-4                   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
SchemaValidation_AllFields-4                0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
SchemaValidation_FormatValidation-4         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
SchemaValidation_ManySchemas-4              0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
geomean                                                ²               +0.00%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                                    │ baseline-bench.txt │       benchmark-results.txt        │
                                    │     allocs/op      │ allocs/op   vs base                │
SchemaValidation_Simple-4                   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
SchemaValidation_AllFields-4                0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
SchemaValidation_FormatValidation-4         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
SchemaValidation_ManySchemas-4              0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
geomean                                                ²               +0.00%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

pkg: github.com/GoCodeAlone/workflow/store
                                   │ baseline-bench.txt │        benchmark-results.txt        │
                                   │       sec/op       │    sec/op     vs base               │
EventStoreAppend_InMemory-4                1.251µ ± 18%   1.136µ ± 27%        ~ (p=0.180 n=6)
EventStoreAppend_SQLite-4                  1.335m ± 10%   1.485m ±  8%  +11.18% (p=0.004 n=6)
GetTimeline_InMemory/events-10-4           14.93µ ±  3%   13.81µ ±  3%   -7.47% (p=0.002 n=6)
GetTimeline_InMemory/events-50-4           82.46µ ±  3%   76.74µ ±  2%   -6.93% (p=0.002 n=6)
GetTimeline_InMemory/events-100-4          133.3µ ± 25%   155.2µ ±  5%        ~ (p=0.240 n=6)
GetTimeline_InMemory/events-500-4          673.3µ ±  1%   754.5µ ± 16%        ~ (p=0.394 n=6)
GetTimeline_InMemory/events-1000-4         1.373m ±  1%   1.310m ±  1%   -4.59% (p=0.002 n=6)
GetTimeline_SQLite/events-10-4             111.1µ ±  1%   108.5µ ±  1%   -2.30% (p=0.002 n=6)
GetTimeline_SQLite/events-50-4             264.7µ ±  2%   251.7µ ±  1%   -4.93% (p=0.002 n=6)
GetTimeline_SQLite/events-100-4            446.6µ ±  1%   424.7µ ±  1%   -4.90% (p=0.002 n=6)
GetTimeline_SQLite/events-500-4            1.895m ±  1%   1.816m ±  1%   -4.17% (p=0.002 n=6)
GetTimeline_SQLite/events-1000-4           3.696m ±  5%   3.601m ±  1%   -2.59% (p=0.002 n=6)
geomean                                    231.2µ         229.0µ         -0.94%

                                   │ baseline-bench.txt │        benchmark-results.txt         │
                                   │        B/op        │     B/op      vs base                │
EventStoreAppend_InMemory-4                  780.5 ± 6%     819.5 ± 7%       ~ (p=0.063 n=6)
EventStoreAppend_SQLite-4                  1.983Ki ± 1%   1.987Ki ± 2%       ~ (p=0.768 n=6)
GetTimeline_InMemory/events-10-4           7.953Ki ± 0%   7.953Ki ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_InMemory/events-50-4           46.62Ki ± 0%   46.62Ki ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_InMemory/events-100-4          94.48Ki ± 0%   94.48Ki ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_InMemory/events-500-4          472.8Ki ± 0%   472.8Ki ± 0%       ~ (p=0.545 n=6)
GetTimeline_InMemory/events-1000-4         944.3Ki ± 0%   944.3Ki ± 0%  +0.00% (p=0.043 n=6)
GetTimeline_SQLite/events-10-4             16.74Ki ± 0%   16.74Ki ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_SQLite/events-50-4             87.14Ki ± 0%   87.14Ki ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_SQLite/events-100-4            175.4Ki ± 0%   175.4Ki ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_SQLite/events-500-4            846.1Ki ± 0%   846.1Ki ± 0%  -0.00% (p=0.022 n=6)
GetTimeline_SQLite/events-1000-4           1.639Mi ± 0%   1.639Mi ± 0%       ~ (p=0.052 n=6)
geomean                                    67.27Ki        67.56Ki       +0.42%
¹ all samples are equal

                                   │ baseline-bench.txt │        benchmark-results.txt        │
                                   │     allocs/op      │  allocs/op   vs base                │
EventStoreAppend_InMemory-4                  7.000 ± 0%    7.000 ± 0%       ~ (p=1.000 n=6) ¹
EventStoreAppend_SQLite-4                    53.00 ± 0%    53.00 ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_InMemory/events-10-4             125.0 ± 0%    125.0 ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_InMemory/events-50-4             653.0 ± 0%    653.0 ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_InMemory/events-100-4           1.306k ± 0%   1.306k ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_InMemory/events-500-4           6.514k ± 0%   6.514k ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_InMemory/events-1000-4          13.02k ± 0%   13.02k ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_SQLite/events-10-4               382.0 ± 0%    382.0 ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_SQLite/events-50-4              1.852k ± 0%   1.852k ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_SQLite/events-100-4             3.681k ± 0%   3.681k ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_SQLite/events-500-4             18.54k ± 0%   18.54k ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_SQLite/events-1000-4            37.29k ± 0%   37.29k ± 0%       ~ (p=1.000 n=6) ¹
geomean                                     1.162k        1.162k       +0.00%
¹ all samples are equal

Benchmarks run with go test -bench=. -benchmem -count=6.
Regressions ≥ 20% are flagged. Results compared via benchstat.

@intel352 intel352 force-pushed the fix/wfctl-plugin-install-flags branch from ad38f11 to 8cf1296 Compare May 14, 2026 05:42
Copilot AI review requested due to automatic review settings May 14, 2026 05:49
@intel352 intel352 force-pushed the fix/wfctl-plugin-install-flags branch from 8cf1296 to f43cc62 Compare May 14, 2026 05:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

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.
@intel352 intel352 force-pushed the fix/wfctl-plugin-install-flags branch from f43cc62 to 3e1725f Compare May 14, 2026 06:05
@intel352 intel352 changed the title fix(wfctl): accept trailing plugin install flags fix(wfctl): handle plugin flags and adoption secrets May 14, 2026
@intel352 intel352 merged commit eba4413 into main May 14, 2026
23 checks passed
@intel352 intel352 deleted the fix/wfctl-plugin-install-flags branch May 14, 2026 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants