Skip to content

Fix plugin conformance source build packages#630

Merged
intel352 merged 1 commit into
mainfrom
codex/plugin-conformance-build-package
May 11, 2026
Merged

Fix plugin conformance source build packages#630
intel352 merged 1 commit into
mainfrom
codex/plugin-conformance-build-package

Conversation

@intel352
Copy link
Copy Markdown
Contributor

Summary

  • add wfctl plugin conformance --build-package for source trees whose executable package is not repo root
  • restrict the build package to . or a clean ./... single package inside the staged plugin source
  • document the flag and cover unsafe inputs plus artifact/source behavior

Verification

  • GOWORK=off go test ./cmd/wfctl -run TestPluginConformance -count=1
  • git diff --check

Regression proof

With fix reverted:

  • GOWORK=off go test ./cmd/wfctl -run TestPluginConformanceBuildsRequestedPackage -count=1
  • FAIL: flag provided but not defined: -build-package

With fix restored:

  • GOWORK=off go test ./cmd/wfctl -run TestPluginConformanceBuildsRequestedPackage -count=1
  • PASS

Review

  • Antagonistic/security review found unsafe build-package cases (-toolexec, module paths, artifact ambiguity); this PR rejects those before go build.

Copilot AI review requested due to automatic review settings May 11, 2026 08:25
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

Adds a --build-package flag to wfctl plugin conformance so conformance can build plugins whose main package isn’t at the repository root, while validating the flag to prevent unsafe/ambiguous go build invocations.

Changes:

  • Introduces --build-package (default .) and normalizes/rejects unsafe values before invoking go build.
  • Plumbs the selected build package into the conformance build step and updates CLI help/usage output.
  • Documents the new flag and adds tests covering safe usage, unsafe inputs, and artifact/source interactions.

Reviewed changes

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

File Description
docs/WFCTL.md Documents --build-package and adds an example invocation for non-root main packages.
cmd/wfctl/plugin_conformance.go Adds flag parsing/validation (normalizeConformanceBuildPackage) and uses the selected package in the go build step.
cmd/wfctl/plugin_conformance_test.go Adds coverage for building a non-root package and rejecting unsafe/unsupported --build-package usages.

Comment thread cmd/wfctl/plugin_conformance.go
Comment thread cmd/wfctl/plugin_conformance_test.go Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

❌ Patch coverage is 92.68293% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/wfctl/plugin_conformance.go 92.68% 1 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 11, 2026

⏱ Benchmark Results

No significant performance regressions detected.

benchstat comparison (baseline → PR)
## benchstat: baseline → PR
baseline-bench.txt:262: parsing iteration count: invalid syntax
baseline-bench.txt:347369: parsing iteration count: invalid syntax
baseline-bench.txt:675708: parsing iteration count: invalid syntax
baseline-bench.txt:991288: parsing iteration count: invalid syntax
baseline-bench.txt:1295666: parsing iteration count: invalid syntax
baseline-bench.txt:1593558: parsing iteration count: invalid syntax
benchmark-results.txt:262: parsing iteration count: invalid syntax
benchmark-results.txt:318962: parsing iteration count: invalid syntax
benchmark-results.txt:636477: parsing iteration count: invalid syntax
benchmark-results.txt:938980: parsing iteration count: invalid syntax
benchmark-results.txt:1284164: parsing iteration count: invalid syntax
benchmark-results.txt:1560468: 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.824m ± 93%
ComponentLoad-4                     3.638m ±  2%
ComponentExecute-4                  1.964µ ±  1%
PoolContention/workers-1-4          1.106µ ±  1%
PoolContention/workers-2-4          1.117µ ±  2%
PoolContention/workers-4-4          1.117µ ±  3%
PoolContention/workers-8-4          1.111µ ±  1%
PoolContention/workers-16-4         1.115µ ±  2%
ComponentLifecycle-4                3.690m ±  1%
SourceValidation-4                  2.332µ ±  3%
RegistryConcurrent-4                822.6n ±  6%
LoaderLoadFromString-4              3.832m ±  3%
geomean                             19.03µ

                            │ 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                 3.416m ± 154%
ComponentLoad-4                       3.461m ±   9%
ComponentExecute-4                    1.835µ ±   0%
PoolContention/workers-1-4            1.019µ ±   1%
PoolContention/workers-2-4            1.018µ ±   3%
PoolContention/workers-4-4            1.006µ ±   1%
PoolContention/workers-8-4            1.011µ ±   2%
PoolContention/workers-16-4           1.011µ ±   1%
ComponentLifecycle-4                  3.476m ±   1%
SourceValidation-4                    2.082µ ±   1%
RegistryConcurrent-4                  743.3n ±   7%
LoaderLoadFromString-4                3.515m ±   1%
geomean                               16.60µ

                            │ 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                  285.7n ± 2%
CircuitBreakerExecution_Success-4          21.46n ± 2%
CircuitBreakerExecution_Failure-4          66.21n ± 0%
geomean                                    74.05n

                                  │ 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                     297.2n ± 3%
CircuitBreakerExecution_Success-4             22.68n ± 2%
CircuitBreakerExecution_Failure-4             70.96n ± 0%
geomean                                       78.19n

                                  │ 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       │
JQTransform_Simple-4                     894.9n ± 24%
JQTransform_ObjectConstruction-4         1.481µ ±  1%
JQTransform_ArraySelect-4                3.399µ ±  2%
JQTransform_Complex-4                    39.20µ ±  0%
JQTransform_Throughput-4                 1.798µ ±  1%
SSEPublishDelivery-4                     67.42n ±  7%
geomean                                  1.666µ

                                 │ baseline-bench.txt │
                                 │        B/op        │
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      │
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         │
JQTransform_Simple-4                        824.0n ± 28%
JQTransform_ObjectConstruction-4            1.396µ ±  0%
JQTransform_ArraySelect-4                   3.395µ ±  1%
JQTransform_Complex-4                       41.44µ ±  1%
JQTransform_Throughput-4                    1.711µ ±  0%
SSEPublishDelivery-4                        64.58n ±  1%
geomean                                     1.617µ

                                 │ benchmark-results.txt │
                                 │         B/op          │
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       │
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.105µ ± 21%
SchemaValidation_AllFields-4                1.675µ ±  4%
SchemaValidation_FormatValidation-4         1.599µ ±  1%
SchemaValidation_ManySchemas-4              1.837µ ±  5%
geomean                                     1.527µ

                                    │ 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.089µ ± 19%
SchemaValidation_AllFields-4                   1.626µ ±  4%
SchemaValidation_FormatValidation-4            1.591µ ±  2%
SchemaValidation_ManySchemas-4                 1.606µ ±  2%
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.215µ ± 23%
EventStoreAppend_SQLite-4                  1.321m ±  6%
GetTimeline_InMemory/events-10-4           13.71µ ±  2%
GetTimeline_InMemory/events-50-4           76.04µ ±  6%
GetTimeline_InMemory/events-100-4          122.4µ ±  1%
GetTimeline_InMemory/events-500-4          632.4µ ±  1%
GetTimeline_InMemory/events-1000-4         1.276m ±  1%
GetTimeline_SQLite/events-10-4             107.9µ ±  1%
GetTimeline_SQLite/events-50-4             248.5µ ±  1%
GetTimeline_SQLite/events-100-4            421.4µ ±  1%
GetTimeline_SQLite/events-500-4            1.790m ±  1%
GetTimeline_SQLite/events-1000-4           3.537m ±  1%
geomean                                    218.5µ

                                   │ baseline-bench.txt │
                                   │        B/op        │
EventStoreAppend_InMemory-4                  822.5 ± 8%
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.57Ki

                                   │ 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.043µ ± 15%
EventStoreAppend_SQLite-4                     982.4µ ±  4%
GetTimeline_InMemory/events-10-4              12.50µ ±  2%
GetTimeline_InMemory/events-50-4              69.52µ ± 21%
GetTimeline_InMemory/events-100-4             110.0µ ±  1%
GetTimeline_InMemory/events-500-4             561.4µ ±  0%
GetTimeline_InMemory/events-1000-4            1.140m ±  0%
GetTimeline_SQLite/events-10-4                83.09µ ±  1%
GetTimeline_SQLite/events-50-4                217.8µ ±  1%
GetTimeline_SQLite/events-100-4               378.7µ ±  3%
GetTimeline_SQLite/events-500-4               1.653m ±  1%
GetTimeline_SQLite/events-1000-4              3.216m ±  0%
geomean                                       190.5µ

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

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

@intel352 intel352 force-pushed the codex/plugin-conformance-build-package branch from 1b0f7fc to 63f5b53 Compare May 11, 2026 08:37
Copilot AI review requested due to automatic review settings May 11, 2026 08:39
@intel352 intel352 force-pushed the codex/plugin-conformance-build-package branch from 63f5b53 to 8261219 Compare May 11, 2026 08:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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

@intel352 intel352 merged commit 8246535 into main May 11, 2026
23 checks passed
@intel352 intel352 deleted the codex/plugin-conformance-build-package branch May 11, 2026 08:57
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