Skip to content

fix(wfctl): scope infra output secret sync#718

Merged
intel352 merged 1 commit into
mainfrom
fix/wfctl-scoped-plan-secret-sync
May 19, 2026
Merged

fix(wfctl): scope infra output secret sync#718
intel352 merged 1 commit into
mainfrom
fix/wfctl-scoped-plan-secret-sync

Conversation

@intel352
Copy link
Copy Markdown
Contributor

Summary

  • scope post-apply infra_output secret generation to the applied include set
  • preserve existing unscoped behavior for normal applies and infra outputs CLI
  • add runInfraApply regression coverage for scoped DNS apply with unrelated DB output secret

Verification

  • GOWORK=off go test ./cmd/wfctl -run 'TestInfraApplyScopedPlanSyncsOnlyScopedInfraOutputSecrets|TestSyncInfraOutputSecretsScoped|TestInfraOutputSourceInScope' -count=1\n- GOWORK=off go test ./cmd/wfctl -run 'TestInfraApplyScopedPlanSyncsOnlyScopedInfraOutputSecrets|TestSyncInfraOutputSecrets|TestInfraOutputSourceInScope|TestInfraApplyConsumesScopedPlan|TestInfraApplyConsumesPlan|TestInfraApplyPlanSkipBootstrap|TestApplyInclude|TestPlanInclude' -count=1\n- GOWORK=off go build ./cmd/wfctl\n- git diff --check\n- GOWORK=off go test ./cmd/wfctl -count=1\n\n## Regression proof\nWith the production scope filter disabled:\nGOWORK=off go test ./cmd/wfctl -run 'TestInfraApplyScopedPlanSyncsOnlyScopedInfraOutputSecrets' -count=1\nfailed with generate infra_output secret "DATABASE_URL": infra_output: module "bmw-database" not found in state (available: bmw-dns).\n\nWith the fix restored, the same test passed.

Copilot AI review requested due to automatic review settings May 19, 2026 16:36
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 scopes post-apply infra_output secret generation during wfctl infra apply so that when an apply is scoped (via --include or a scoped --plan), only infra_output generators whose source module is within the applied include set are synced, avoiding failures for out-of-scope modules.

Changes:

  • Thread an include-set-derived scope through runInfraApply into a new syncInfraOutputSecretsScoped helper.
  • Filter infra_output secret generators by applied include set before resolving outputs from state.
  • Add regression tests covering scoped plan applies where unrelated infra_output generators exist.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
cmd/wfctl/infra.go Passes an include-derived module scope into post-apply infra output secret syncing (including --plan path).
cmd/wfctl/infra_output_secrets.go Introduces scoped syncing and a scope predicate for infra output generator sources.
cmd/wfctl/infra_output_secrets_test.go Adds unit tests ensuring out-of-scope generators are skipped during scoped syncing.
cmd/wfctl/infra_apply_plan_test.go Adds end-to-end regression test ensuring scoped plan apply doesn’t attempt to sync unrelated infra_output secrets.

Comment thread cmd/wfctl/infra_output_secrets.go Outdated
@intel352 intel352 force-pushed the fix/wfctl-scoped-plan-secret-sync branch from bf4a0c6 to 54c8fb3 Compare May 19, 2026 16:44
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 19, 2026

⏱ Benchmark Results

No significant performance regressions detected.

benchstat comparison (baseline → PR)
## benchstat: baseline → PR
baseline-bench.txt:274: parsing iteration count: invalid syntax
baseline-bench.txt:351857: parsing iteration count: invalid syntax
baseline-bench.txt:618489: parsing iteration count: invalid syntax
baseline-bench.txt:909622: parsing iteration count: invalid syntax
baseline-bench.txt:1211246: parsing iteration count: invalid syntax
baseline-bench.txt:1536756: parsing iteration count: invalid syntax
benchmark-results.txt:274: parsing iteration count: invalid syntax
benchmark-results.txt:278885: parsing iteration count: invalid syntax
benchmark-results.txt:616815: parsing iteration count: invalid syntax
benchmark-results.txt:903997: parsing iteration count: invalid syntax
benchmark-results.txt:1238909: parsing iteration count: invalid syntax
benchmark-results.txt:1551135: 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 │
                            │       sec/op       │
InterpreterCreation-4               8.186m ± 61%
ComponentLoad-4                     3.629m ±  2%
ComponentExecute-4                  1.979µ ±  1%
PoolContention/workers-1-4          1.097µ ±  3%
PoolContention/workers-2-4          1.098µ ±  1%
PoolContention/workers-4-4          1.095µ ±  1%
PoolContention/workers-8-4          1.099µ ±  3%
PoolContention/workers-16-4         1.099µ ±  1%
ComponentLifecycle-4                3.678m ±  2%
SourceValidation-4                  2.347µ ±  1%
RegistryConcurrent-4                784.6n ±  2%
LoaderLoadFromString-4              3.685m ±  1%
geomean                             19.08µ

                            │ 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

cpu: AMD EPYC 9V74 80-Core Processor                
                            │ benchmark-results.txt │
                            │        sec/op         │
InterpreterCreation-4                  6.251m ± 82%
ComponentLoad-4                        3.512m ±  6%
ComponentExecute-4                     1.834µ ±  1%
PoolContention/workers-1-4             1.010µ ±  2%
PoolContention/workers-2-4             1.004µ ±  1%
PoolContention/workers-4-4             1.016µ ±  2%
PoolContention/workers-8-4             1.012µ ±  2%
PoolContention/workers-16-4            1.014µ ±  1%
ComponentLifecycle-4                   3.539m ±  1%
SourceValidation-4                     2.109µ ±  1%
RegistryConcurrent-4                   755.6n ±  2%
LoaderLoadFromString-4                 3.563m ±  1%
geomean                                17.55µ

                            │ 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

pkg: github.com/GoCodeAlone/workflow/middleware
cpu: AMD EPYC 7763 64-Core Processor                
                                  │ baseline-bench.txt │
                                  │       sec/op       │
CircuitBreakerDetection-4                  287.6n ± 4%
CircuitBreakerExecution_Success-4          21.33n ± 3%
CircuitBreakerExecution_Failure-4          66.29n ± 0%
geomean                                    74.09n

                                  │ 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

cpu: AMD EPYC 9V74 80-Core Processor                
                                  │ benchmark-results.txt │
                                  │        sec/op         │
CircuitBreakerDetection-4                     298.4n ± 3%
CircuitBreakerExecution_Success-4             22.68n ± 2%
CircuitBreakerExecution_Failure-4             71.14n ± 0%
geomean                                       78.37n

                                  │ 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

pkg: github.com/GoCodeAlone/workflow/module
cpu: AMD EPYC 7763 64-Core Processor                
                                 │ baseline-bench.txt │
                                 │       sec/op       │
IaCStateBackend_InProcess-4              314.4n ± 24%
IaCStateBackend_GRPC-4                   9.506m ±  3%
JQTransform_Simple-4                     659.2n ± 38%
JQTransform_ObjectConstruction-4         1.512µ ±  1%
JQTransform_ArraySelect-4                3.500µ ±  1%
JQTransform_Complex-4                    39.23µ ±  2%
JQTransform_Throughput-4                 1.854µ ±  0%
SSEPublishDelivery-4                     70.00n ±  1%
geomean                                  3.896µ

                                 │ baseline-bench.txt │
                                 │        B/op        │
IaCStateBackend_InProcess-4              416.0 ± 0%
IaCStateBackend_GRPC-4                 5.827Mi ± 9%
JQTransform_Simple-4                   1.273Ki ± 0%
JQTransform_ObjectConstruction-4       1.773Ki ± 0%
JQTransform_ArraySelect-4              2.625Ki ± 0%
JQTransform_Complex-4                  16.22Ki ± 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.840k ± 0%
JQTransform_Simple-4                     10.00 ± 0%
JQTransform_ObjectConstruction-4         15.00 ± 0%
JQTransform_ArraySelect-4                30.00 ± 0%
JQTransform_Complex-4                    324.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                
                                 │ benchmark-results.txt │
                                 │        sec/op         │
IaCStateBackend_InProcess-4                 296.6n ±  1%
IaCStateBackend_GRPC-4                      10.44m ± 14%
JQTransform_Simple-4                        634.1n ± 34%
JQTransform_ObjectConstruction-4            1.419µ ±  0%
JQTransform_ArraySelect-4                   3.456µ ±  0%
JQTransform_Complex-4                       41.76µ ±  1%
JQTransform_Throughput-4                    1.750µ ±  1%
SSEPublishDelivery-4                        65.29n ±  7%
geomean                                     3.826µ

                                 │ benchmark-results.txt │
                                 │         B/op          │
IaCStateBackend_InProcess-4                416.0 ±  0%
IaCStateBackend_GRPC-4                   5.799Mi ± 14%
JQTransform_Simple-4                     1.273Ki ±  0%
JQTransform_ObjectConstruction-4         1.773Ki ±  0%
JQTransform_ArraySelect-4                2.625Ki ±  0%
JQTransform_Complex-4                    16.22Ki ±  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.854k ± 0%
JQTransform_Simple-4                        10.00 ± 0%
JQTransform_ObjectConstruction-4            15.00 ± 0%
JQTransform_ArraySelect-4                   30.00 ± 0%
JQTransform_Complex-4                       324.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 7763 64-Core Processor                
                                    │ baseline-bench.txt │
                                    │       sec/op       │
SchemaValidation_Simple-4                    1.106µ ± 3%
SchemaValidation_AllFields-4                 1.650µ ± 9%
SchemaValidation_FormatValidation-4          1.581µ ± 1%
SchemaValidation_ManySchemas-4               1.823µ ± 4%
geomean                                      1.514µ

                                    │ 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

cpu: AMD EPYC 9V74 80-Core Processor                
                                    │ benchmark-results.txt │
                                    │        sec/op         │
SchemaValidation_Simple-4                      1.091µ ± 18%
SchemaValidation_AllFields-4                   1.650µ ±  6%
SchemaValidation_FormatValidation-4            1.562µ ±  3%
SchemaValidation_ManySchemas-4                 1.606µ ±  3%
geomean                                        1.458µ

                                    │ 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

pkg: github.com/GoCodeAlone/workflow/store
cpu: AMD EPYC 7763 64-Core Processor                
                                   │ baseline-bench.txt │
                                   │       sec/op       │
EventStoreAppend_InMemory-4                1.248µ ± 14%
EventStoreAppend_SQLite-4                  1.401m ±  2%
GetTimeline_InMemory/events-10-4           13.73µ ±  4%
GetTimeline_InMemory/events-50-4           76.27µ ±  4%
GetTimeline_InMemory/events-100-4          123.4µ ±  2%
GetTimeline_InMemory/events-500-4          639.4µ ±  1%
GetTimeline_InMemory/events-1000-4         1.304m ±  1%
GetTimeline_SQLite/events-10-4             108.8µ ±  1%
GetTimeline_SQLite/events-50-4             251.8µ ±  1%
GetTimeline_SQLite/events-100-4            428.4µ ±  0%
GetTimeline_SQLite/events-500-4            1.842m ±  1%
GetTimeline_SQLite/events-1000-4           3.589m ±  3%
geomean                                    222.4µ

                                   │ baseline-bench.txt │
                                   │        B/op        │
EventStoreAppend_InMemory-4                 780.0 ± 10%
EventStoreAppend_SQLite-4                 1.988Ki ±  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.28Ki

                                   │ 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

cpu: AMD EPYC 9V74 80-Core Processor                
                                   │ benchmark-results.txt │
                                   │        sec/op         │
EventStoreAppend_InMemory-4                   1.202µ ± 16%
EventStoreAppend_SQLite-4                     1.130m ±  9%
GetTimeline_InMemory/events-10-4              12.56µ ±  2%
GetTimeline_InMemory/events-50-4              67.69µ ± 19%
GetTimeline_InMemory/events-100-4             110.7µ ±  2%
GetTimeline_InMemory/events-500-4             559.5µ ±  1%
GetTimeline_InMemory/events-1000-4            1.137m ±  2%
GetTimeline_SQLite/events-10-4                86.13µ ±  1%
GetTimeline_SQLite/events-50-4                223.1µ ±  1%
GetTimeline_SQLite/events-100-4               389.9µ ±  3%
GetTimeline_SQLite/events-500-4               1.676m ±  4%
GetTimeline_SQLite/events-1000-4              3.247m ±  6%
geomean                                       196.5µ

                                   │ benchmark-results.txt │
                                   │         B/op          │
EventStoreAppend_InMemory-4                     813.0 ± 8%
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.51Ki

                                   │ benchmark-results.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.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2026

Codecov Report

❌ Patch coverage is 93.33333% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/wfctl/infra_output_secrets.go 92.59% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@intel352 intel352 merged commit 6d8d4eb into main May 19, 2026
24 checks passed
@intel352 intel352 deleted the fix/wfctl-scoped-plan-secret-sync branch May 19, 2026 16:56
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