Skip to content

feat(wfctl): discover manifest-driven secrets#867

Merged
intel352 merged 1 commit into
mainfrom
feat/issue-864-manifest-secrets
Jun 6, 2026
Merged

feat(wfctl): discover manifest-driven secrets#867
intel352 merged 1 commit into
mainfrom
feat/issue-864-manifest-secrets

Conversation

@intel352
Copy link
Copy Markdown
Contributor

@intel352 intel352 commented Jun 6, 2026

Summary

  • Add wfctl secrets setup --manifest wfctl.yaml to discover secrets from wfctl.yaml, .wfctl-lock.yaml, installed plugin required_secrets[], and ${ENV_VAR} references in config YAML.
  • Reuse the existing secret writer and setup engine for GitHub repo/env/org scopes, including --from-env, --secret, interactive prompts, --only, and --skip-existing behavior.
  • Make plugin manifest loading respect actual install layouts: full plugin name, normalized provider name, or workflow-plugin-<provider>.
  • Update docs for repo-level provider plugin secret setup.

Verification

  • GOWORK=off go test ./cmd/wfctl -run 'TestDiscoverManifestSecrets|TestParseManifestSetupFlags|TestLoadPluginManifest' -count=1
  • GOWORK=off go test ./cmd/wfctl -count=1
  • git diff --check HEAD~1..HEAD

Fixes #864

Copilot AI review requested due to automatic review settings June 6, 2026 08:17
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 extends wfctl secrets setup with a manifest-driven mode that can discover required secrets from wfctl.yaml / .wfctl-lock.yaml, installed plugin required_secrets[], and ${ENV_VAR} references found in workflow config YAMLs, then guides GitHub Actions secret setup at repo/env/org scopes using the existing setup engine.

Changes:

  • Add --manifest flow to wfctl secrets setup, including discovery from manifest + lockfile + config env references.
  • Enhance plugin manifest loading to match real install layouts (full name, normalized provider name, or workflow-plugin-<provider>).
  • Update docs to describe manifest-driven secret setup and improved scope guidance.

Reviewed changes

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

Show a summary per file
File Description
docs/WFCTL.md Documents secrets setup --manifest and related flags/examples.
docs/wfctl-secrets-scopes.md Clarifies plugin manifest lookup behavior and adds repo-level manifest-driven setup example.
docs/iac-dns-providers.md Adds manifest-driven secrets setup guidance for provider plugins.
cmd/wfctl/secrets_setup.go Routes secrets setup to manifest-driven implementation when --manifest is present.
cmd/wfctl/secrets_setup_plugin.go Updates plugin manifest resolution to try multiple candidate install directories.
cmd/wfctl/secrets_setup_plugin_test.go Adds coverage for loading plugin manifests from normalized install directories.
cmd/wfctl/secrets_setup_manifest.go Implements manifest-driven secret discovery + setup engine integration.
cmd/wfctl/secrets_setup_manifest_test.go Adds tests for discovery and manifest flag parsing.

Comment on lines +64 to +72
if in != nil {
for _, kv := range readKVLines(in) {
k, v, ok := strings.Cut(kv, "=")
if ok {
secretMap[k] = v
}
}
}
interactive := in == nil && isatty.IsTerminal(os.Stdin.Fd())
if err := fs.Parse(args); err != nil {
return nil, err
}
_ = nonInteractive
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 6, 2026

Codecov Report

❌ Patch coverage is 49.84227% with 159 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/wfctl/secrets_setup_manifest.go 45.90% 127 Missing and 25 partials ⚠️
cmd/wfctl/secrets_setup.go 16.66% 4 Missing and 1 partial ⚠️
cmd/wfctl/secrets_setup_plugin.go 93.33% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 6, 2026

⏱ Benchmark Results

No significant performance regressions detected.

benchstat comparison (baseline → PR)
## benchstat: baseline → PR
baseline-bench.txt:304: parsing iteration count: invalid syntax
baseline-bench.txt:355523: parsing iteration count: invalid syntax
baseline-bench.txt:692625: parsing iteration count: invalid syntax
baseline-bench.txt:997933: parsing iteration count: invalid syntax
baseline-bench.txt:1334549: parsing iteration count: invalid syntax
baseline-bench.txt:1650555: parsing iteration count: invalid syntax
benchmark-results.txt:304: parsing iteration count: invalid syntax
benchmark-results.txt:478853: parsing iteration count: invalid syntax
benchmark-results.txt:990642: parsing iteration count: invalid syntax
benchmark-results.txt:1525405: parsing iteration count: invalid syntax
benchmark-results.txt:2059772: parsing iteration count: invalid syntax
benchmark-results.txt:2945808: parsing iteration count: invalid syntax
goos: linux
goarch: amd64
pkg: github.com/GoCodeAlone/workflow/dynamic
cpu: AMD EPYC 9V45 96-Core Processor                
                            │ benchmark-results.txt │
                            │        sec/op         │
InterpreterCreation-4                 2.420m ± 202%
ComponentLoad-4                       2.152m ±  11%
ComponentExecute-4                    1.120µ ±   4%
PoolContention/workers-1-4            602.1n ±   2%
PoolContention/workers-2-4            606.2n ±   5%
PoolContention/workers-4-4            596.8n ±   2%
PoolContention/workers-8-4            599.3n ±   1%
PoolContention/workers-16-4           605.5n ±   2%
ComponentLifecycle-4                  2.126m ±   3%
SourceValidation-4                    1.267µ ±   3%
RegistryConcurrent-4                  498.7n ±   6%
LoaderLoadFromString-4                2.275m ±   4%
geomean                               10.29µ

                            │ benchmark-results.txt │
                            │         B/op          │
InterpreterCreation-4                  2.027Mi ± 0%
ComponentLoad-4                        2.180Mi ± 0%
ComponentExecute-4                     1.203Ki ± 0%
PoolContention/workers-1-4             1.203Ki ± 0%
PoolContention/workers-2-4             1.203Ki ± 0%
PoolContention/workers-4-4             1.203Ki ± 0%
PoolContention/workers-8-4             1.203Ki ± 0%
PoolContention/workers-16-4            1.203Ki ± 0%
ComponentLifecycle-4                   2.183Mi ± 0%
SourceValidation-4                     1.984Ki ± 0%
RegistryConcurrent-4                   1.133Ki ± 0%
LoaderLoadFromString-4                 2.182Mi ± 0%
geomean                                15.25Ki

                            │ benchmark-results.txt │
                            │       allocs/op       │
InterpreterCreation-4                   15.68k ± 0%
ComponentLoad-4                         18.02k ± 0%
ComponentExecute-4                       25.00 ± 0%
PoolContention/workers-1-4               25.00 ± 0%
PoolContention/workers-2-4               25.00 ± 0%
PoolContention/workers-4-4               25.00 ± 0%
PoolContention/workers-8-4               25.00 ± 0%
PoolContention/workers-16-4              25.00 ± 0%
ComponentLifecycle-4                    18.07k ± 0%
SourceValidation-4                       32.00 ± 0%
RegistryConcurrent-4                     2.000 ± 0%
LoaderLoadFromString-4                  18.06k ± 0%
geomean                                  183.3

cpu: AMD EPYC 9V74 80-Core Processor                
                            │ baseline-bench.txt │
                            │       sec/op       │
InterpreterCreation-4               6.692m ± 55%
ComponentLoad-4                     3.524m ±  1%
ComponentExecute-4                  1.830µ ±  6%
PoolContention/workers-1-4          1.022µ ±  1%
PoolContention/workers-2-4          1.015µ ±  4%
PoolContention/workers-4-4          1.017µ ±  2%
PoolContention/workers-8-4          1.017µ ±  1%
PoolContention/workers-16-4         1.019µ ±  2%
ComponentLifecycle-4                3.542m ±  2%
SourceValidation-4                  2.118µ ±  3%
RegistryConcurrent-4                749.4n ±  3%
LoaderLoadFromString-4              3.591m ±  1%
geomean                             17.71µ

                            │ baseline-bench.txt │
                            │        B/op        │
InterpreterCreation-4               2.027Mi ± 0%
ComponentLoad-4                     2.180Mi ± 0%
ComponentExecute-4                  1.203Ki ± 0%
PoolContention/workers-1-4          1.203Ki ± 0%
PoolContention/workers-2-4          1.203Ki ± 0%
PoolContention/workers-4-4          1.203Ki ± 0%
PoolContention/workers-8-4          1.203Ki ± 0%
PoolContention/workers-16-4         1.203Ki ± 0%
ComponentLifecycle-4                2.183Mi ± 0%
SourceValidation-4                  1.984Ki ± 0%
RegistryConcurrent-4                1.133Ki ± 0%
LoaderLoadFromString-4              2.182Mi ± 0%
geomean                             15.25Ki

                            │ baseline-bench.txt │
                            │     allocs/op      │
InterpreterCreation-4                15.68k ± 0%
ComponentLoad-4                      18.02k ± 0%
ComponentExecute-4                    25.00 ± 0%
PoolContention/workers-1-4            25.00 ± 0%
PoolContention/workers-2-4            25.00 ± 0%
PoolContention/workers-4-4            25.00 ± 0%
PoolContention/workers-8-4            25.00 ± 0%
PoolContention/workers-16-4           25.00 ± 0%
ComponentLifecycle-4                 18.07k ± 0%
SourceValidation-4                    32.00 ± 0%
RegistryConcurrent-4                  2.000 ± 0%
LoaderLoadFromString-4               18.06k ± 0%
geomean                               183.3

pkg: github.com/GoCodeAlone/workflow/middleware
cpu: AMD EPYC 9V45 96-Core Processor                
                                  │ benchmark-results.txt │
                                  │        sec/op         │
CircuitBreakerDetection-4                     352.3n ± 3%
CircuitBreakerExecution_Success-4             45.51n ± 3%
CircuitBreakerExecution_Failure-4             65.58n ± 1%
geomean                                       101.7n

                                  │ benchmark-results.txt │
                                  │         B/op          │
CircuitBreakerDetection-4                    144.0 ± 0%
CircuitBreakerExecution_Success-4            0.000 ± 0%
CircuitBreakerExecution_Failure-4            0.000 ± 0%
geomean                                                 ¹
¹ summaries must be >0 to compute geomean

                                  │ benchmark-results.txt │
                                  │       allocs/op       │
CircuitBreakerDetection-4                    1.000 ± 0%
CircuitBreakerExecution_Success-4            0.000 ± 0%
CircuitBreakerExecution_Failure-4            0.000 ± 0%
geomean                                                 ¹
¹ summaries must be >0 to compute geomean

cpu: AMD EPYC 9V74 80-Core Processor                
                                  │ baseline-bench.txt │
                                  │       sec/op       │
CircuitBreakerDetection-4                  296.6n ± 5%
CircuitBreakerExecution_Success-4          22.67n ± 0%
CircuitBreakerExecution_Failure-4          70.98n ± 0%
geomean                                    78.15n

                                  │ baseline-bench.txt │
                                  │        B/op        │
CircuitBreakerDetection-4                 144.0 ± 0%
CircuitBreakerExecution_Success-4         0.000 ± 0%
CircuitBreakerExecution_Failure-4         0.000 ± 0%
geomean                                              ¹
¹ summaries must be >0 to compute geomean

                                  │ baseline-bench.txt │
                                  │     allocs/op      │
CircuitBreakerDetection-4                 1.000 ± 0%
CircuitBreakerExecution_Success-4         0.000 ± 0%
CircuitBreakerExecution_Failure-4         0.000 ± 0%
geomean                                              ¹
¹ summaries must be >0 to compute geomean

pkg: github.com/GoCodeAlone/workflow/module
cpu: AMD EPYC 9V45 96-Core Processor                
                                 │ benchmark-results.txt │
                                 │        sec/op         │
IaCStateBackend_InProcess-4                 202.6n ± 13%
IaCStateBackend_GRPC-4                      5.700m ±  3%
JQTransform_Simple-4                        446.4n ± 12%
JQTransform_ObjectConstruction-4            944.9n ±  2%
JQTransform_ArraySelect-4                   1.997µ ±  2%
JQTransform_Complex-4                       23.25µ ±  2%
JQTransform_Throughput-4                    1.120µ ±  1%
SSEPublishDelivery-4                        53.86n ±  2%
geomean                                     2.465µ

                                 │ benchmark-results.txt │
                                 │         B/op          │
IaCStateBackend_InProcess-4                416.0 ±  0%
IaCStateBackend_GRPC-4                   5.614Mi ± 13%
JQTransform_Simple-4                     1.273Ki ±  0%
JQTransform_ObjectConstruction-4         1.773Ki ±  0%
JQTransform_ArraySelect-4                2.625Ki ±  0%
JQTransform_Complex-4                    16.31Ki ±  0%
JQTransform_Throughput-4                 1.984Ki ±  0%
SSEPublishDelivery-4                       0.000 ±  0%
geomean                                                ¹
¹ summaries must be >0 to compute geomean

                                 │ benchmark-results.txt │
                                 │       allocs/op       │
IaCStateBackend_InProcess-4                 2.000 ± 0%
IaCStateBackend_GRPC-4                     6.856k ± 0%
JQTransform_Simple-4                        10.00 ± 0%
JQTransform_ObjectConstruction-4            15.00 ± 0%
JQTransform_ArraySelect-4                   30.00 ± 0%
JQTransform_Complex-4                       328.0 ± 0%
JQTransform_Throughput-4                    17.00 ± 0%
SSEPublishDelivery-4                        0.000 ± 0%
geomean                                                ¹
¹ summaries must be >0 to compute geomean

cpu: AMD EPYC 9V74 80-Core Processor                
                                 │ baseline-bench.txt │
                                 │       sec/op       │
IaCStateBackend_InProcess-4              301.4n ± 22%
IaCStateBackend_GRPC-4                   10.25m ±  1%
JQTransform_Simple-4                     665.6n ± 31%
JQTransform_ObjectConstruction-4         1.478µ ±  1%
JQTransform_ArraySelect-4                3.540µ ±  2%
JQTransform_Complex-4                    42.71µ ±  2%
JQTransform_Throughput-4                 1.798µ ±  1%
SSEPublishDelivery-4                     64.81n ±  1%
geomean                                  3.900µ

                                 │ baseline-bench.txt │
                                 │        B/op        │
IaCStateBackend_InProcess-4              416.0 ± 0%
IaCStateBackend_GRPC-4                 5.772Mi ± 9%
JQTransform_Simple-4                   1.273Ki ± 0%
JQTransform_ObjectConstruction-4       1.773Ki ± 0%
JQTransform_ArraySelect-4              2.625Ki ± 0%
JQTransform_Complex-4                  16.31Ki ± 0%
JQTransform_Throughput-4               1.984Ki ± 0%
SSEPublishDelivery-4                     0.000 ± 0%
geomean                                             ¹
¹ summaries must be >0 to compute geomean

                                 │ baseline-bench.txt │
                                 │     allocs/op      │
IaCStateBackend_InProcess-4              2.000 ± 0%
IaCStateBackend_GRPC-4                  6.859k ± 0%
JQTransform_Simple-4                     10.00 ± 0%
JQTransform_ObjectConstruction-4         15.00 ± 0%
JQTransform_ArraySelect-4                30.00 ± 0%
JQTransform_Complex-4                    328.0 ± 0%
JQTransform_Throughput-4                 17.00 ± 0%
SSEPublishDelivery-4                     0.000 ± 0%
geomean                                             ¹
¹ summaries must be >0 to compute geomean

pkg: github.com/GoCodeAlone/workflow/schema
cpu: AMD EPYC 9V45 96-Core Processor                
                                    │ benchmark-results.txt │
                                    │        sec/op         │
SchemaValidation_Simple-4                       616.7n ± 4%
SchemaValidation_AllFields-4                    932.0n ± 1%
SchemaValidation_FormatValidation-4             904.2n ± 3%
SchemaValidation_ManySchemas-4                  1.031µ ± 5%
geomean                                         855.6n

                                    │ benchmark-results.txt │
                                    │         B/op          │
SchemaValidation_Simple-4                      0.000 ± 0%
SchemaValidation_AllFields-4                   0.000 ± 0%
SchemaValidation_FormatValidation-4            0.000 ± 0%
SchemaValidation_ManySchemas-4                 0.000 ± 0%
geomean                                                   ¹
¹ summaries must be >0 to compute geomean

                                    │ benchmark-results.txt │
                                    │       allocs/op       │
SchemaValidation_Simple-4                      0.000 ± 0%
SchemaValidation_AllFields-4                   0.000 ± 0%
SchemaValidation_FormatValidation-4            0.000 ± 0%
SchemaValidation_ManySchemas-4                 0.000 ± 0%
geomean                                                   ¹
¹ summaries must be >0 to compute geomean

cpu: AMD EPYC 9V74 80-Core Processor                
                                    │ baseline-bench.txt │
                                    │       sec/op       │
SchemaValidation_Simple-4                   1.092µ ± 14%
SchemaValidation_AllFields-4                1.623µ ±  7%
SchemaValidation_FormatValidation-4         1.583µ ±  1%
SchemaValidation_ManySchemas-4              1.576µ ±  2%
geomean                                     1.450µ

                                    │ baseline-bench.txt │
                                    │        B/op        │
SchemaValidation_Simple-4                   0.000 ± 0%
SchemaValidation_AllFields-4                0.000 ± 0%
SchemaValidation_FormatValidation-4         0.000 ± 0%
SchemaValidation_ManySchemas-4              0.000 ± 0%
geomean                                                ¹
¹ summaries must be >0 to compute geomean

                                    │ baseline-bench.txt │
                                    │     allocs/op      │
SchemaValidation_Simple-4                   0.000 ± 0%
SchemaValidation_AllFields-4                0.000 ± 0%
SchemaValidation_FormatValidation-4         0.000 ± 0%
SchemaValidation_ManySchemas-4              0.000 ± 0%
geomean                                                ¹
¹ summaries must be >0 to compute geomean

pkg: github.com/GoCodeAlone/workflow/store
cpu: AMD EPYC 9V45 96-Core Processor                
                                   │ benchmark-results.txt │
                                   │        sec/op         │
EventStoreAppend_InMemory-4                   668.4n ±  4%
EventStoreAppend_SQLite-4                     4.053m ± 36%
GetTimeline_InMemory/events-10-4              7.324µ ± 18%
GetTimeline_InMemory/events-50-4              35.23µ ±  3%
GetTimeline_InMemory/events-100-4             68.92µ ±  2%
GetTimeline_InMemory/events-500-4             353.9µ ±  2%
GetTimeline_InMemory/events-1000-4            702.1µ ±  2%
GetTimeline_SQLite/events-10-4                37.42µ ±  4%
GetTimeline_SQLite/events-50-4                128.3µ ±  4%
GetTimeline_SQLite/events-100-4               240.1µ ±  1%
GetTimeline_SQLite/events-500-4               1.141m ±  1%
GetTimeline_SQLite/events-1000-4              2.646m ± 11%
geomean                                       136.5µ

                                   │ benchmark-results.txt │
                                   │         B/op          │
EventStoreAppend_InMemory-4                     803.0 ± 3%
EventStoreAppend_SQLite-4                     1.984Ki ± 3%
GetTimeline_InMemory/events-10-4              7.953Ki ± 0%
GetTimeline_InMemory/events-50-4              46.62Ki ± 0%
GetTimeline_InMemory/events-100-4             94.48Ki ± 0%
GetTimeline_InMemory/events-500-4             472.8Ki ± 0%
GetTimeline_InMemory/events-1000-4            944.3Ki ± 0%
GetTimeline_SQLite/events-10-4                16.74Ki ± 0%
GetTimeline_SQLite/events-50-4                87.14Ki ± 0%
GetTimeline_SQLite/events-100-4               175.4Ki ± 0%
GetTimeline_SQLite/events-500-4               846.1Ki ± 0%
GetTimeline_SQLite/events-1000-4              1.639Mi ± 0%
geomean                                       67.43Ki

                                   │ benchmark-results.txt │
                                   │       allocs/op       │
EventStoreAppend_InMemory-4                     7.000 ± 0%
EventStoreAppend_SQLite-4                       52.00 ± 2%
GetTimeline_InMemory/events-10-4                125.0 ± 0%
GetTimeline_InMemory/events-50-4                653.0 ± 0%
GetTimeline_InMemory/events-100-4              1.306k ± 0%
GetTimeline_InMemory/events-500-4              6.514k ± 0%
GetTimeline_InMemory/events-1000-4             13.02k ± 0%
GetTimeline_SQLite/events-10-4                  382.0 ± 0%
GetTimeline_SQLite/events-50-4                 1.852k ± 0%
GetTimeline_SQLite/events-100-4                3.681k ± 0%
GetTimeline_SQLite/events-500-4                18.54k ± 0%
GetTimeline_SQLite/events-1000-4               37.29k ± 0%
geomean                                        1.160k

cpu: AMD EPYC 9V74 80-Core Processor                
                                   │ baseline-bench.txt │
                                   │       sec/op       │
EventStoreAppend_InMemory-4                1.121µ ±  9%
EventStoreAppend_SQLite-4                  1.038m ±  6%
GetTimeline_InMemory/events-10-4           13.16µ ±  6%
GetTimeline_InMemory/events-50-4           74.37µ ±  2%
GetTimeline_InMemory/events-100-4          145.9µ ± 22%
GetTimeline_InMemory/events-500-4          582.8µ ±  1%
GetTimeline_InMemory/events-1000-4         1.196m ±  0%
GetTimeline_SQLite/events-10-4             58.79µ ±  0%
GetTimeline_SQLite/events-50-4             196.4µ ±  0%
GetTimeline_SQLite/events-100-4            365.9µ ±  2%
GetTimeline_SQLite/events-500-4            1.699m ±  1%
GetTimeline_SQLite/events-1000-4           3.350m ±  2%
geomean                                    193.6µ

                                   │ baseline-bench.txt │
                                   │        B/op        │
EventStoreAppend_InMemory-4                  795.0 ± 7%
EventStoreAppend_SQLite-4                  1.984Ki ± 2%
GetTimeline_InMemory/events-10-4           7.953Ki ± 0%
GetTimeline_InMemory/events-50-4           46.62Ki ± 0%
GetTimeline_InMemory/events-100-4          94.48Ki ± 0%
GetTimeline_InMemory/events-500-4          472.8Ki ± 0%
GetTimeline_InMemory/events-1000-4         944.3Ki ± 0%
GetTimeline_SQLite/events-10-4             16.74Ki ± 0%
GetTimeline_SQLite/events-50-4             87.14Ki ± 0%
GetTimeline_SQLite/events-100-4            175.4Ki ± 0%
GetTimeline_SQLite/events-500-4            846.1Ki ± 0%
GetTimeline_SQLite/events-1000-4           1.639Mi ± 0%
geomean                                    67.38Ki

                                   │ baseline-bench.txt │
                                   │     allocs/op      │
EventStoreAppend_InMemory-4                  7.000 ± 0%
EventStoreAppend_SQLite-4                    53.00 ± 0%
GetTimeline_InMemory/events-10-4             125.0 ± 0%
GetTimeline_InMemory/events-50-4             653.0 ± 0%
GetTimeline_InMemory/events-100-4           1.306k ± 0%
GetTimeline_InMemory/events-500-4           6.514k ± 0%
GetTimeline_InMemory/events-1000-4          13.02k ± 0%
GetTimeline_SQLite/events-10-4               382.0 ± 0%
GetTimeline_SQLite/events-50-4              1.852k ± 0%
GetTimeline_SQLite/events-100-4             3.681k ± 0%
GetTimeline_SQLite/events-500-4             18.54k ± 0%
GetTimeline_SQLite/events-1000-4            37.29k ± 0%
geomean                                     1.162k

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

@intel352 intel352 merged commit acd30fe into main Jun 6, 2026
23 checks passed
@intel352 intel352 deleted the feat/issue-864-manifest-secrets branch June 6, 2026 08:30
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.

wfctl secrets should support plugin-pinned secret setup from wfctl.yaml

2 participants