Skip to content

fix(iac): let drivers suppress new-resource creates#753

Merged
intel352 merged 1 commit into
mainfrom
fix/computeplan-diff-create-noop
May 21, 2026
Merged

fix(iac): let drivers suppress new-resource creates#753
intel352 merged 1 commit into
mainfrom
fix/computeplan-diff-create-noop

Conversation

@intel352
Copy link
Copy Markdown
Contributor

@intel352 intel352 commented May 21, 2026

Summary

  • consult ResourceAdoptionLocator for desired resources missing from local state when a driver explicitly opts in
  • read the adoption ref and dispatch ResourceDriver.Diff against that current output so already-existing resources can plan as no-op
  • preserve legacy create behavior for nil provider, nil driver, and drivers that do not opt in to adoption

Verification

  • git diff --check
  • GOWORK=off go test ./platform -run 'TestComputePlan_NewResource_AdoptionNoopDiffSkipsCreate|TestComputePlan_NewResource_NoAdoptionDoesNotCallDiff|TestDiffer_NewResource|TestDiffer_DependencyOrdering' -v
  • GOWORK=off go test ./cmd/wfctl -run TestInfraApply_EmitsDiagnosticsOnFailure -v
  • GOWORK=off go test ./platform ./interfaces ./cmd/wfctl -run 'TestComputePlan_NewResource|TestDiffer_NewResource|TestInfraApply_EmitsDiagnosticsOnFailure'

@intel352 intel352 force-pushed the fix/computeplan-diff-create-noop branch from 4c1cc1b to 6d21c84 Compare May 21, 2026 14:12
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 21, 2026

⏱ Benchmark Results

No significant performance regressions detected.

benchstat comparison (baseline → PR)
## benchstat: baseline → PR
baseline-bench.txt:276: parsing iteration count: invalid syntax
baseline-bench.txt:295540: parsing iteration count: invalid syntax
baseline-bench.txt:563234: parsing iteration count: invalid syntax
baseline-bench.txt:816930: parsing iteration count: invalid syntax
baseline-bench.txt:1140385: parsing iteration count: invalid syntax
baseline-bench.txt:1475933: parsing iteration count: invalid syntax
benchmark-results.txt:276: parsing iteration count: invalid syntax
benchmark-results.txt:406531: parsing iteration count: invalid syntax
benchmark-results.txt:774419: parsing iteration count: invalid syntax
benchmark-results.txt:1139649: parsing iteration count: invalid syntax
benchmark-results.txt:1516654: parsing iteration count: invalid syntax
benchmark-results.txt:1941575: 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               6.865m ± 55%
ComponentLoad-4                     3.553m ±  6%
ComponentExecute-4                  1.934µ ±  1%
PoolContention/workers-1-4          1.083µ ±  1%
PoolContention/workers-2-4          1.080µ ±  2%
PoolContention/workers-4-4          1.082µ ±  3%
PoolContention/workers-8-4          1.105µ ±  1%
PoolContention/workers-16-4         1.095µ ±  1%
ComponentLifecycle-4                3.560m ±  1%
SourceValidation-4                  2.319µ ±  0%
RegistryConcurrent-4                787.0n ±  2%
LoaderLoadFromString-4              3.567m ±  0%
geomean                             18.56µ

                            │ 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                 2.310m ± 227%
ComponentLoad-4                       2.705m ±   7%
ComponentExecute-4                    1.407µ ±   1%
PoolContention/workers-1-4            785.9n ±   1%
PoolContention/workers-2-4            793.2n ±   1%
PoolContention/workers-4-4            790.5n ±   2%
PoolContention/workers-8-4            785.8n ±   3%
PoolContention/workers-16-4           783.6n ±   3%
ComponentLifecycle-4                  2.741m ±   1%
SourceValidation-4                    1.627µ ±   1%
RegistryConcurrent-4                  583.7n ±   6%
LoaderLoadFromString-4                2.746m ±   1%
geomean                               12.78µ

                            │ 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                  284.4n ± 3%
CircuitBreakerExecution_Success-4          21.48n ± 1%
CircuitBreakerExecution_Failure-4          66.82n ± 0%
geomean                                    74.18n

                                  │ 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                     230.8n ± 4%
CircuitBreakerExecution_Success-4             17.57n ± 0%
CircuitBreakerExecution_Failure-4             55.29n ± 0%
geomean                                       60.75n

                                  │ 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              318.7n ±  6%
IaCStateBackend_GRPC-4                   9.349m ± 12%
JQTransform_Simple-4                     662.4n ± 38%
JQTransform_ObjectConstruction-4         1.526µ ±  0%
JQTransform_ArraySelect-4                3.479µ ±  3%
JQTransform_Complex-4                    39.63µ ±  3%
JQTransform_Throughput-4                 1.857µ ±  1%
SSEPublishDelivery-4                     64.56n ±  2%
geomean                                  3.865µ

                                 │ baseline-bench.txt │
                                 │        B/op        │
IaCStateBackend_InProcess-4              416.0 ± 0%
IaCStateBackend_GRPC-4                 5.997Mi ± 8%
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.830k ± 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                 230.9n ± 27%
IaCStateBackend_GRPC-4                      8.052m ±  1%
JQTransform_Simple-4                        518.8n ± 16%
JQTransform_ObjectConstruction-4            1.096µ ±  1%
JQTransform_ArraySelect-4                   2.689µ ±  1%
JQTransform_Complex-4                       32.94µ ±  1%
JQTransform_Throughput-4                    1.373µ ±  2%
SSEPublishDelivery-4                        49.43n ±  0%
geomean                                     2.988µ

                                 │ benchmark-results.txt │
                                 │         B/op          │
IaCStateBackend_InProcess-4                416.0 ±  0%
IaCStateBackend_GRPC-4                   5.671Mi ± 12%
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.862k ± 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.101µ ± 2%
SchemaValidation_AllFields-4                 1.646µ ± 1%
SchemaValidation_FormatValidation-4          1.590µ ± 2%
SchemaValidation_ManySchemas-4               1.818µ ± 2%
geomean                                      1.512µ

                                    │ 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                      831.9n ± 16%
SchemaValidation_AllFields-4                   1.253µ ±  4%
SchemaValidation_FormatValidation-4            1.204µ ±  1%
SchemaValidation_ManySchemas-4                 1.225µ ±  1%
geomean                                        1.113µ

                                    │ 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.193µ ± 23%
EventStoreAppend_SQLite-4                  1.327m ±  4%
GetTimeline_InMemory/events-10-4           14.09µ ±  3%
GetTimeline_InMemory/events-50-4           64.15µ ± 18%
GetTimeline_InMemory/events-100-4          129.0µ ±  0%
GetTimeline_InMemory/events-500-4          661.9µ ±  1%
GetTimeline_InMemory/events-1000-4         1.357m ±  2%
GetTimeline_SQLite/events-10-4             108.6µ ±  1%
GetTimeline_SQLite/events-50-4             256.0µ ±  0%
GetTimeline_SQLite/events-100-4            434.5µ ±  1%
GetTimeline_SQLite/events-500-4            1.858m ±  1%
GetTimeline_SQLite/events-1000-4           3.593m ±  0%
geomean                                    220.7µ

                                   │ baseline-bench.txt │
                                   │        B/op        │
EventStoreAppend_InMemory-4                  818.0 ± 7%
EventStoreAppend_SQLite-4                  1.983Ki ± 1%
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.54Ki

                                   │ 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                   751.4n ± 12%
EventStoreAppend_SQLite-4                     3.175m ± 79%
GetTimeline_InMemory/events-10-4              7.699µ ± 11%
GetTimeline_InMemory/events-50-4              42.52µ ±  1%
GetTimeline_InMemory/events-100-4             85.17µ ±  1%
GetTimeline_InMemory/events-500-4             433.0µ ±  1%
GetTimeline_InMemory/events-1000-4            877.9µ ±  0%
GetTimeline_SQLite/events-10-4                64.84µ ±  2%
GetTimeline_SQLite/events-50-4                169.1µ ±  0%
GetTimeline_SQLite/events-100-4               294.8µ ±  1%
GetTimeline_SQLite/events-500-4               1.276m ±  2%
GetTimeline_SQLite/events-1000-4              2.499m ±  1%
geomean                                       159.0µ

                                   │ benchmark-results.txt │
                                   │         B/op          │
EventStoreAppend_InMemory-4                     849.0 ± 9%
EventStoreAppend_SQLite-4                     1.982Ki ± 8%
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.74Ki

                                   │ benchmark-results.txt │
                                   │       allocs/op       │
EventStoreAppend_InMemory-4                     7.000 ± 0%
EventStoreAppend_SQLite-4                       52.50 ± 1%
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.161k

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 21, 2026

Codecov Report

❌ Patch coverage is 47.45763% with 31 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
platform/differ.go 52.38% 12 Missing and 8 partials ⚠️
cmd/wfctl/iac_typed_adapter.go 35.29% 8 Missing and 3 partials ⚠️

📢 Thoughts on this report? Let us know!

@intel352 intel352 force-pushed the fix/computeplan-diff-create-noop branch 2 times, most recently from 24f6fda to e60a546 Compare May 21, 2026 14:33
@intel352 intel352 force-pushed the fix/computeplan-diff-create-noop branch from e60a546 to 2cef64e Compare May 21, 2026 14:41
@intel352 intel352 merged commit e5acccc into main May 21, 2026
28 checks passed
@intel352 intel352 deleted the fix/computeplan-diff-create-noop branch May 21, 2026 14:54
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.

1 participant