Skip to content

fix: normalize checksum asset paths#877

Merged
intel352 merged 2 commits into
mainfrom
fix/wfctl-update-checksum-prefix
Jun 7, 2026
Merged

fix: normalize checksum asset paths#877
intel352 merged 2 commits into
mainfrom
fix/wfctl-update-checksum-prefix

Conversation

@intel352
Copy link
Copy Markdown
Contributor

@intel352 intel352 commented Jun 7, 2026

Summary

Verification

  • GOWORK=off go test ./cmd/wfctl -run TestVerifyAssetChecksum_AcceptsDotSlashAssetPrefix -count=1 failed before the fix with checksum for "wfctl-darwin-arm64" not found in checksums.txt
  • GOWORK=off go test ./cmd/wfctl -run 'TestParseChecksumsTxt|TestLookupChecksumForURL|TestVerifyAssetChecksum' -count=1\n- GOWORK=off go test ./cmd/wfctl -count=1\n- GOWORK=off golangci-lint run --timeout=5m\n- git diff --check\n

Copilot AI review requested due to automatic review settings June 7, 2026 10:47
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 update checksum verification failures for releases whose checksums.txt records assets with a leading ./ by normalizing checksum entry filenames before lookup, and adds regression coverage for the v0.75.0 checksum format.

Changes:

  • Normalize leading ./ in checksums.txt filenames during parsing to match release asset names.
  • Reject conflicting checksum entries that normalize to the same filename.
  • Add regression tests covering ./-prefixed checksum entries for both parsing and wfctl update verification.

Reviewed changes

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

File Description
cmd/wfctl/plugin_checksum.go Normalizes ./ prefix in parsed checksum entry names and detects conflicts.
cmd/wfctl/plugin_checksum_test.go Adds parser tests for ./ normalization and conflict rejection.
cmd/wfctl/update_test.go Adds a regression test ensuring checksum verification accepts ./-prefixed asset entries.

Comment thread cmd/wfctl/plugin_checksum.go
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 7, 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

github-actions Bot commented Jun 7, 2026

⏱ Benchmark Results

No significant performance regressions detected.

benchstat comparison (baseline → PR)
## benchstat: baseline → PR
baseline-bench.txt:304: parsing iteration count: invalid syntax
baseline-bench.txt:342716: parsing iteration count: invalid syntax
baseline-bench.txt:661038: parsing iteration count: invalid syntax
baseline-bench.txt:967972: parsing iteration count: invalid syntax
baseline-bench.txt:1315670: parsing iteration count: invalid syntax
baseline-bench.txt:1632753: parsing iteration count: invalid syntax
benchmark-results.txt:304: parsing iteration count: invalid syntax
benchmark-results.txt:325583: parsing iteration count: invalid syntax
benchmark-results.txt:621885: parsing iteration count: invalid syntax
benchmark-results.txt:929590: parsing iteration count: invalid syntax
benchmark-results.txt:1243343: parsing iteration count: invalid syntax
benchmark-results.txt:1562355: 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 │       benchmark-results.txt        │
                            │       sec/op       │    sec/op     vs base              │
InterpreterCreation-4               7.331m ± 58%   8.741m ± 63%       ~ (p=0.699 n=6)
ComponentLoad-4                     3.533m ± 11%   3.673m ±  1%       ~ (p=0.065 n=6)
ComponentExecute-4                  1.940µ ±  2%   1.962µ ±  1%  +1.13% (p=0.041 n=6)
PoolContention/workers-1-4          1.083µ ±  6%   1.103µ ±  2%       ~ (p=0.071 n=6)
PoolContention/workers-2-4          1.071µ ±  2%   1.094µ ±  2%  +2.15% (p=0.037 n=6)
PoolContention/workers-4-4          1.072µ ±  0%   1.102µ ±  1%  +2.80% (p=0.002 n=6)
PoolContention/workers-8-4          1.074µ ±  1%   1.102µ ±  2%  +2.65% (p=0.002 n=6)
PoolContention/workers-16-4         1.081µ ±  3%   1.101µ ±  1%  +1.94% (p=0.043 n=6)
ComponentLifecycle-4                3.548m ±  1%   3.743m ±  1%  +5.48% (p=0.002 n=6)
SourceValidation-4                  2.284µ ±  0%   2.354µ ±  1%  +3.06% (p=0.002 n=6)
RegistryConcurrent-4                811.5n ±  4%   798.2n ±  2%  -1.63% (p=0.041 n=6)
LoaderLoadFromString-4              3.559m ±  0%   3.732m ±  0%  +4.86% (p=0.002 n=6)
geomean                             18.58µ         19.30µ        +3.85%

                            │ baseline-bench.txt │        benchmark-results.txt         │
                            │        B/op        │     B/op      vs base                │
InterpreterCreation-4               2.027Mi ± 0%   2.027Mi ± 0%       ~ (p=0.589 n=6)
ComponentLoad-4                     2.180Mi ± 0%   2.180Mi ± 0%  +0.00% (p=0.039 n=6)
ComponentExecute-4                  1.203Ki ± 0%   1.203Ki ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-1-4          1.203Ki ± 0%   1.203Ki ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-2-4          1.203Ki ± 0%   1.203Ki ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-4-4          1.203Ki ± 0%   1.203Ki ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-8-4          1.203Ki ± 0%   1.203Ki ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-16-4         1.203Ki ± 0%   1.203Ki ± 0%       ~ (p=1.000 n=6) ¹
ComponentLifecycle-4                2.183Mi ± 0%   2.183Mi ± 0%       ~ (p=0.697 n=6)
SourceValidation-4                  1.984Ki ± 0%   1.984Ki ± 0%       ~ (p=1.000 n=6) ¹
RegistryConcurrent-4                1.133Ki ± 0%   1.133Ki ± 0%       ~ (p=1.000 n=6) ¹
LoaderLoadFromString-4              2.182Mi ± 0%   2.182Mi ± 0%       ~ (p=0.556 n=6)
geomean                             15.25Ki        15.25Ki       +0.00%
¹ all samples are equal

                            │ baseline-bench.txt │        benchmark-results.txt        │
                            │     allocs/op      │  allocs/op   vs base                │
InterpreterCreation-4                15.68k ± 0%   15.68k ± 0%       ~ (p=1.000 n=6)
ComponentLoad-4                      18.02k ± 0%   18.02k ± 0%       ~ (p=1.000 n=6)
ComponentExecute-4                    25.00 ± 0%    25.00 ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-1-4            25.00 ± 0%    25.00 ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-2-4            25.00 ± 0%    25.00 ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-4-4            25.00 ± 0%    25.00 ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-8-4            25.00 ± 0%    25.00 ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-16-4           25.00 ± 0%    25.00 ± 0%       ~ (p=1.000 n=6) ¹
ComponentLifecycle-4                 18.07k ± 0%   18.07k ± 0%       ~ (p=1.000 n=6) ¹
SourceValidation-4                    32.00 ± 0%    32.00 ± 0%       ~ (p=1.000 n=6) ¹
RegistryConcurrent-4                  2.000 ± 0%    2.000 ± 0%       ~ (p=1.000 n=6) ¹
LoaderLoadFromString-4               18.06k ± 0%   18.06k ± 0%       ~ (p=1.000 n=6) ¹
geomean                               183.3         183.3       +0.00%
¹ all samples are equal

pkg: github.com/GoCodeAlone/workflow/middleware
                                  │ baseline-bench.txt │       benchmark-results.txt       │
                                  │       sec/op       │   sec/op     vs base              │
CircuitBreakerDetection-4                  284.4n ± 4%   289.1n ± 4%       ~ (p=0.132 n=6)
CircuitBreakerExecution_Success-4          21.46n ± 1%   21.44n ± 0%       ~ (p=0.223 n=6)
CircuitBreakerExecution_Failure-4          65.36n ± 1%   66.13n ± 0%  +1.18% (p=0.002 n=6)
geomean                                    73.61n        74.29n       +0.92%

                                  │ baseline-bench.txt │       benchmark-results.txt        │
                                  │        B/op        │    B/op     vs base                │
CircuitBreakerDetection-4                 144.0 ± 0%     144.0 ± 0%       ~ (p=1.000 n=6) ¹
CircuitBreakerExecution_Success-4         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
CircuitBreakerExecution_Failure-4         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
geomean                                              ²               +0.00%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                                  │ baseline-bench.txt │       benchmark-results.txt        │
                                  │     allocs/op      │ allocs/op   vs base                │
CircuitBreakerDetection-4                 1.000 ± 0%     1.000 ± 0%       ~ (p=1.000 n=6) ¹
CircuitBreakerExecution_Success-4         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
CircuitBreakerExecution_Failure-4         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
geomean                                              ²               +0.00%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

pkg: github.com/GoCodeAlone/workflow/module
                                 │ baseline-bench.txt │       benchmark-results.txt        │
                                 │       sec/op       │    sec/op     vs base              │
IaCStateBackend_InProcess-4              313.5n ± 27%   314.7n ± 40%       ~ (p=0.221 n=6)
IaCStateBackend_GRPC-4                   9.653m ±  3%   9.721m ±  4%       ~ (p=0.485 n=6)
JQTransform_Simple-4                     676.0n ± 33%   673.5n ± 34%       ~ (p=0.937 n=6)
JQTransform_ObjectConstruction-4         1.491µ ±  0%   1.523µ ±  5%  +2.11% (p=0.002 n=6)
JQTransform_ArraySelect-4                3.476µ ±  2%   3.526µ ±  1%  +1.45% (p=0.026 n=6)
JQTransform_Complex-4                    39.27µ ±  1%   40.30µ ±  1%  +2.60% (p=0.002 n=6)
JQTransform_Throughput-4                 1.806µ ±  0%   1.866µ ±  1%  +3.27% (p=0.002 n=6)
SSEPublishDelivery-4                     67.03n ±  1%   66.43n ±  1%  -0.90% (p=0.037 n=6)
geomean                                  3.871µ         3.915µ        +1.15%

                                 │ baseline-bench.txt │        benchmark-results.txt         │
                                 │        B/op        │     B/op      vs base                │
IaCStateBackend_InProcess-4             416.0 ±  0%       416.0 ± 0%       ~ (p=1.000 n=6) ¹
IaCStateBackend_GRPC-4                5.804Mi ± 11%     5.854Mi ± 8%       ~ (p=0.937 n=6)
JQTransform_Simple-4                  1.273Ki ±  0%     1.273Ki ± 0%       ~ (p=1.000 n=6) ¹
JQTransform_ObjectConstruction-4      1.773Ki ±  0%     1.773Ki ± 0%       ~ (p=1.000 n=6) ¹
JQTransform_ArraySelect-4             2.625Ki ±  0%     2.625Ki ± 0%       ~ (p=1.000 n=6) ¹
JQTransform_Complex-4                 16.31Ki ±  0%     16.31Ki ± 0%       ~ (p=1.000 n=6) ¹
JQTransform_Throughput-4              1.984Ki ±  0%     1.984Ki ± 0%       ~ (p=1.000 n=6) ¹
SSEPublishDelivery-4                    0.000 ±  0%       0.000 ± 0%       ~ (p=1.000 n=6) ¹
geomean                                             ²                 +0.11%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                                 │ baseline-bench.txt │        benchmark-results.txt        │
                                 │     allocs/op      │  allocs/op   vs base                │
IaCStateBackend_InProcess-4              2.000 ± 0%      2.000 ± 0%       ~ (p=1.000 n=6) ¹
IaCStateBackend_GRPC-4                  6.833k ± 0%     6.834k ± 0%       ~ (p=0.645 n=6)
JQTransform_Simple-4                     10.00 ± 0%      10.00 ± 0%       ~ (p=1.000 n=6) ¹
JQTransform_ObjectConstruction-4         15.00 ± 0%      15.00 ± 0%       ~ (p=1.000 n=6) ¹
JQTransform_ArraySelect-4                30.00 ± 0%      30.00 ± 0%       ~ (p=1.000 n=6) ¹
JQTransform_Complex-4                    328.0 ± 0%      328.0 ± 0%       ~ (p=1.000 n=6) ¹
JQTransform_Throughput-4                 17.00 ± 0%      17.00 ± 0%       ~ (p=1.000 n=6) ¹
SSEPublishDelivery-4                     0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=6) ¹
geomean                                             ²                +0.00%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

pkg: github.com/GoCodeAlone/workflow/schema
                                    │ baseline-bench.txt │       benchmark-results.txt        │
                                    │       sec/op       │    sec/op     vs base              │
SchemaValidation_Simple-4                    1.087µ ± 3%   1.096µ ± 20%       ~ (p=0.119 n=6)
SchemaValidation_AllFields-4                 1.657µ ± 3%   1.668µ ±  1%       ~ (p=0.394 n=6)
SchemaValidation_FormatValidation-4          1.596µ ± 2%   1.589µ ±  1%       ~ (p=0.147 n=6)
SchemaValidation_ManySchemas-4               1.800µ ± 3%   1.817µ ±  5%       ~ (p=0.310 n=6)
geomean                                      1.508µ        1.515µ        +0.49%

                                    │ baseline-bench.txt │       benchmark-results.txt        │
                                    │        B/op        │    B/op     vs base                │
SchemaValidation_Simple-4                   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
SchemaValidation_AllFields-4                0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
SchemaValidation_FormatValidation-4         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
SchemaValidation_ManySchemas-4              0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
geomean                                                ²               +0.00%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                                    │ baseline-bench.txt │       benchmark-results.txt        │
                                    │     allocs/op      │ allocs/op   vs base                │
SchemaValidation_Simple-4                   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
SchemaValidation_AllFields-4                0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
SchemaValidation_FormatValidation-4         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
SchemaValidation_ManySchemas-4              0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
geomean                                                ²               +0.00%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

pkg: github.com/GoCodeAlone/workflow/store
                                   │ baseline-bench.txt │        benchmark-results.txt        │
                                   │       sec/op       │    sec/op     vs base               │
EventStoreAppend_InMemory-4                1.143µ ± 41%   1.192µ ± 15%        ~ (p=0.485 n=6)
EventStoreAppend_SQLite-4                  2.572m ± 32%   1.459m ±  6%  -43.26% (p=0.002 n=6)
GetTimeline_InMemory/events-10-4           13.96µ ±  3%   15.67µ ±  3%  +12.26% (p=0.002 n=6)
GetTimeline_InMemory/events-50-4           79.86µ ±  3%   87.42µ ±  2%   +9.47% (p=0.002 n=6)
GetTimeline_InMemory/events-100-4          160.1µ ±  3%   176.9µ ±  3%  +10.52% (p=0.002 n=6)
GetTimeline_InMemory/events-500-4          633.2µ ±  1%   695.2µ ± 22%   +9.78% (p=0.002 n=6)
GetTimeline_InMemory/events-1000-4         1.291m ±  1%   1.400m ±  1%   +8.48% (p=0.002 n=6)
GetTimeline_SQLite/events-10-4             73.16µ ±  2%   81.28µ ±  1%  +11.11% (p=0.002 n=6)
GetTimeline_SQLite/events-50-4             217.9µ ±  1%   239.6µ ±  1%   +9.94% (p=0.002 n=6)
GetTimeline_SQLite/events-100-4            398.5µ ±  2%   430.5µ ±  1%   +8.04% (p=0.002 n=6)
GetTimeline_SQLite/events-500-4            1.795m ±  2%   1.930m ±  1%   +7.53% (p=0.002 n=6)
GetTimeline_SQLite/events-1000-4           3.555m ±  4%   3.798m ±  4%   +6.84% (p=0.002 n=6)
geomean                                    225.6µ         232.7µ         +3.16%

                                   │ baseline-bench.txt │        benchmark-results.txt         │
                                   │        B/op        │     B/op      vs base                │
EventStoreAppend_InMemory-4                  820.5 ± 7%     795.5 ± 9%       ~ (p=0.818 n=6)
EventStoreAppend_SQLite-4                  1.986Ki ± 2%   1.984Ki ± 1%       ~ (p=0.623 n=6)
GetTimeline_InMemory/events-10-4           7.953Ki ± 0%   7.953Ki ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_InMemory/events-50-4           46.62Ki ± 0%   46.62Ki ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_InMemory/events-100-4          94.48Ki ± 0%   94.48Ki ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_InMemory/events-500-4          472.8Ki ± 0%   472.8Ki ± 0%  -0.00% (p=0.015 n=6)
GetTimeline_InMemory/events-1000-4         944.3Ki ± 0%   944.3Ki ± 0%  -0.00% (p=0.032 n=6)
GetTimeline_SQLite/events-10-4             16.74Ki ± 0%   16.74Ki ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_SQLite/events-50-4             87.14Ki ± 0%   87.14Ki ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_SQLite/events-100-4            175.4Ki ± 0%   175.4Ki ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_SQLite/events-500-4            846.1Ki ± 0%   846.1Ki ± 0%  +0.00% (p=0.006 n=6)
GetTimeline_SQLite/events-1000-4           1.639Mi ± 0%   1.639Mi ± 0%  -0.00% (p=0.032 n=6)
geomean                                    67.56Ki        67.38Ki       -0.26%
¹ all samples are equal

                                   │ baseline-bench.txt │        benchmark-results.txt        │
                                   │     allocs/op      │  allocs/op   vs base                │
EventStoreAppend_InMemory-4                  7.000 ± 0%    7.000 ± 0%       ~ (p=1.000 n=6) ¹
EventStoreAppend_SQLite-4                    53.00 ± 2%    53.00 ± 0%       ~ (p=0.455 n=6)
GetTimeline_InMemory/events-10-4             125.0 ± 0%    125.0 ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_InMemory/events-50-4             653.0 ± 0%    653.0 ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_InMemory/events-100-4           1.306k ± 0%   1.306k ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_InMemory/events-500-4           6.514k ± 0%   6.514k ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_InMemory/events-1000-4          13.02k ± 0%   13.02k ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_SQLite/events-10-4               382.0 ± 0%    382.0 ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_SQLite/events-50-4              1.852k ± 0%   1.852k ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_SQLite/events-100-4             3.681k ± 0%   3.681k ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_SQLite/events-500-4             18.54k ± 0%   18.54k ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_SQLite/events-1000-4            37.29k ± 0%   37.29k ± 0%       ~ (p=1.000 n=6) ¹
geomean                                     1.162k        1.162k       +0.00%
¹ all samples are equal

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

@intel352 intel352 merged commit e4b1293 into main Jun 7, 2026
22 checks passed
@intel352 intel352 deleted the fix/wfctl-update-checksum-prefix branch June 7, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wfctl update rejects v0.75.0 checksum entries with ./ asset prefixes

2 participants