Skip to content

fix(wfctl): capture logs for env resource name#739

Merged
intel352 merged 1 commit into
mainfrom
fix/log-capture-env-name
May 20, 2026
Merged

fix(wfctl): capture logs for env resource name#739
intel352 merged 1 commit into
mainfrom
fix/log-capture-env-name

Conversation

@intel352
Copy link
Copy Markdown
Contributor

Summary

  • preserve ResolveForEnv's lifted resource name when building wfctl log capture ResourceSpec
  • add regression coverage for env-specific infra.container_service names

Verification

  • GOWORK=off go test ./cmd/wfctl -run 'TestResolveLogCaptureResource' -count=1
  • GOWORK=off go test ./cmd/wfctl ./plugin/external/sdk ./plugin/external/proto -count=1
  • git diff --check

Copilot AI review requested due to automatic review settings May 20, 2026 13:41
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 fixes wfctl logs capture so that when an infra module is resolved for a specific environment (via ResolveForEnv), the resulting ResourceSpec preserves the env-resolved resource name (including “lifted” config.name for infra.* modules). This ensures log capture requests target the correct cloud resource name in env-specific configurations.

Changes:

  • Preserve ResolveForEnv(...).Name when building the log-capture ResourceSpec.
  • Add a regression test covering env-specific renaming for infra.container_service.

Reviewed changes

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

File Description
cmd/wfctl/logs.go Uses the env-resolved module name when constructing the ResourceSpec for log capture.
cmd/wfctl/logs_test.go Adds a regression test verifying env-resolved resource names are used for log capture.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions
Copy link
Copy Markdown

⏱ 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:309923: parsing iteration count: invalid syntax
baseline-bench.txt:633741: parsing iteration count: invalid syntax
baseline-bench.txt:927253: parsing iteration count: invalid syntax
baseline-bench.txt:1202969: parsing iteration count: invalid syntax
baseline-bench.txt:1519785: parsing iteration count: invalid syntax
benchmark-results.txt:274: parsing iteration count: invalid syntax
benchmark-results.txt:303743: parsing iteration count: invalid syntax
benchmark-results.txt:632859: parsing iteration count: invalid syntax
benchmark-results.txt:958888: parsing iteration count: invalid syntax
benchmark-results.txt:1258961: parsing iteration count: invalid syntax
benchmark-results.txt:1580901: parsing iteration count: invalid syntax
goos: linux
goarch: amd64
pkg: github.com/GoCodeAlone/workflow/dynamic
cpu: AMD EPYC 7763 64-Core Processor                
                            │ benchmark-results.txt │
                            │        sec/op         │
InterpreterCreation-4                  8.433m ± 64%
ComponentLoad-4                        3.555m ±  0%
ComponentExecute-4                     1.945µ ±  1%
PoolContention/workers-1-4             1.078µ ±  2%
PoolContention/workers-2-4             1.075µ ±  1%
PoolContention/workers-4-4             1.074µ ±  1%
PoolContention/workers-8-4             1.078µ ±  1%
PoolContention/workers-16-4            1.079µ ±  1%
ComponentLifecycle-4                   3.555m ±  0%
SourceValidation-4                     2.295µ ±  1%
RegistryConcurrent-4                   767.1n ±  6%
LoaderLoadFromString-4                 3.565m ±  0%
geomean                                18.74µ

                            │ 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.848m ± 56%
ComponentLoad-4                     3.519m ±  0%
ComponentExecute-4                  1.825µ ±  2%
PoolContention/workers-1-4          1.012µ ±  3%
PoolContention/workers-2-4          1.013µ ±  1%
PoolContention/workers-4-4          1.016µ ±  1%
PoolContention/workers-8-4          1.013µ ±  1%
PoolContention/workers-16-4         1.016µ ±  1%
ComponentLifecycle-4                3.562m ±  1%
SourceValidation-4                  2.099µ ±  1%
RegistryConcurrent-4                734.7n ±  5%
LoaderLoadFromString-4              3.580m ±  1%
geomean                             17.67µ

                            │ 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 7763 64-Core Processor                
                                  │ benchmark-results.txt │
                                  │        sec/op         │
CircuitBreakerDetection-4                    284.9n ± 12%
CircuitBreakerExecution_Success-4            21.54n ±  1%
CircuitBreakerExecution_Failure-4            66.34n ±  0%
geomean                                      74.12n

                                  │ 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                  298.9n ± 4%
CircuitBreakerExecution_Success-4          22.68n ± 1%
CircuitBreakerExecution_Failure-4          70.94n ± 0%
geomean                                    78.34n

                                  │ 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 7763 64-Core Processor                
                                 │ benchmark-results.txt │
                                 │        sec/op         │
IaCStateBackend_InProcess-4                 312.5n ± 19%
IaCStateBackend_GRPC-4                      9.500m ±  4%
JQTransform_Simple-4                        655.8n ± 37%
JQTransform_ObjectConstruction-4            1.494µ ±  0%
JQTransform_ArraySelect-4                   3.405µ ±  0%
JQTransform_Complex-4                       38.66µ ±  0%
JQTransform_Throughput-4                    1.831µ ±  1%
SSEPublishDelivery-4                        73.58n ±  2%
geomean                                     3.882µ

                                 │ benchmark-results.txt │
                                 │         B/op          │
IaCStateBackend_InProcess-4                416.0 ±  0%
IaCStateBackend_GRPC-4                   5.922Mi ± 13%
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.835k ± 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                
                                 │ baseline-bench.txt │
                                 │       sec/op       │
IaCStateBackend_InProcess-4              297.2n ± 27%
IaCStateBackend_GRPC-4                   10.23m ±  1%
JQTransform_Simple-4                     646.4n ± 31%
JQTransform_ObjectConstruction-4         1.429µ ±  3%
JQTransform_ArraySelect-4                3.505µ ±  1%
JQTransform_Complex-4                    42.07µ ±  1%
JQTransform_Throughput-4                 1.752µ ±  1%
SSEPublishDelivery-4                     65.38n ±  3%
geomean                                  3.842µ

                                 │ baseline-bench.txt │
                                 │        B/op        │
IaCStateBackend_InProcess-4              416.0 ± 0%
IaCStateBackend_GRPC-4                 5.945Mi ± 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.864k ± 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                
                                    │ benchmark-results.txt │
                                    │        sec/op         │
SchemaValidation_Simple-4                      1.105µ ± 13%
SchemaValidation_AllFields-4                   1.638µ ±  3%
SchemaValidation_FormatValidation-4            1.573µ ±  1%
SchemaValidation_ManySchemas-4                 1.854µ ±  3%
geomean                                        1.516µ

                                    │ 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.072µ ± 6%
SchemaValidation_AllFields-4                 1.623µ ± 5%
SchemaValidation_FormatValidation-4          1.569µ ± 3%
SchemaValidation_ManySchemas-4               1.587µ ± 2%
geomean                                      1.442µ

                                    │ 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 7763 64-Core Processor                
                                   │ benchmark-results.txt │
                                   │        sec/op         │
EventStoreAppend_InMemory-4                   1.318µ ± 17%
EventStoreAppend_SQLite-4                     1.583m ±  8%
GetTimeline_InMemory/events-10-4              13.98µ ±  3%
GetTimeline_InMemory/events-50-4              76.96µ ±  2%
GetTimeline_InMemory/events-100-4             126.6µ ±  3%
GetTimeline_InMemory/events-500-4             646.0µ ±  0%
GetTimeline_InMemory/events-1000-4            1.321m ±  1%
GetTimeline_SQLite/events-10-4                106.5µ ±  1%
GetTimeline_SQLite/events-50-4                249.8µ ±  0%
GetTimeline_SQLite/events-100-4               424.0µ ±  0%
GetTimeline_SQLite/events-500-4               1.813m ±  0%
GetTimeline_SQLite/events-1000-4              3.541m ±  0%
geomean                                       225.8µ

                                   │ benchmark-results.txt │
                                   │         B/op          │
EventStoreAppend_InMemory-4                     805.5 ± 5%
EventStoreAppend_SQLite-4                     1.985Ki ± 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.46Ki

                                   │ 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

cpu: AMD EPYC 9V74 80-Core Processor                
                                   │ baseline-bench.txt │
                                   │       sec/op       │
EventStoreAppend_InMemory-4                1.101µ ± 24%
EventStoreAppend_SQLite-4                  1.064m ±  8%
GetTimeline_InMemory/events-10-4           12.48µ ±  3%
GetTimeline_InMemory/events-50-4           55.07µ ± 28%
GetTimeline_InMemory/events-100-4          109.5µ ±  0%
GetTimeline_InMemory/events-500-4          559.2µ ±  1%
GetTimeline_InMemory/events-1000-4         1.135m ±  0%
GetTimeline_SQLite/events-10-4             84.73µ ±  1%
GetTimeline_SQLite/events-50-4             219.4µ ±  0%
GetTimeline_SQLite/events-100-4            390.6µ ±  2%
GetTimeline_SQLite/events-500-4            1.659m ±  1%
GetTimeline_SQLite/events-1000-4           3.228m ±  2%
geomean                                    189.7µ

                                   │ baseline-bench.txt │
                                   │        B/op        │
EventStoreAppend_InMemory-4                  760.0 ± 2%
EventStoreAppend_SQLite-4                  1.983Ki ± 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.12Ki

                                   │ 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 f5081d3 into main May 20, 2026
26 checks passed
@intel352 intel352 deleted the fix/log-capture-env-name branch May 20, 2026 13: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.

2 participants