Skip to content

wfctl: skip background update check in CI and throttle to once per day#568

Merged
intel352 merged 2 commits into
mainfrom
copilot/fix-firewall-rule-issues
May 6, 2026
Merged

wfctl: skip background update check in CI and throttle to once per day#568
intel352 merged 2 commits into
mainfrom
copilot/fix-firewall-rule-issues

Conversation

Copilot AI commented May 6, 2026

Copy link
Copy Markdown
Contributor

checkForUpdateNotice() fires a GitHub API call on every wfctl invocation, hitting api.github.com even inside firewalled CI environments (GitHub Actions, etc.) and on every single command rather than periodically.

Changes

  • CI skipcheckForUpdateNotice now returns immediately when CI or GITHUB_ACTIONS is set, covering GitHub Actions and virtually all other CI systems.
  • Daily throttle — Adds a timestamp cache file at ~/.cache/wfctl/last_update_check. The background check is skipped if it ran within the last 24 hours, avoiding an API call on every command invocation.
  • Test isolation — Adds updateCheckCachePathOverride (mirrors the existing githubReleasesURLOverride pattern) so tests redirect the cache to a temp directory.
// Now skipped when CI or GITHUB_ACTIONS is set, or check ran <24h ago
func checkForUpdateNotice() <-chan struct{} {
    done := make(chan struct{})
    if os.Getenv(envNoUpdateCheck) != "" || version == "dev" ||
        os.Getenv(envCI) != "" || os.Getenv(envGitHubActions) != "" {
        close(done)
        return done
    }
    if !shouldCheckForUpdate() { // reads ~/.cache/wfctl/last_update_check
        close(done)
        return done
    }
    go func() {
        defer close(done)
        markUpdateChecked() // write timestamp before network call
        // ... fetch and print notice
    }()
    return done
}

Copilot AI self-assigned this May 6, 2026
Copilot AI review requested due to automatic review settings May 6, 2026 13:54
Copilot AI review requested due to automatic review settings May 6, 2026 13:54
Copilot AI linked an issue May 6, 2026 that may be closed by this pull request
@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown

⏱ Benchmark Results

No significant performance regressions detected.

benchstat comparison (baseline → PR)
## benchstat: baseline → PR
baseline-bench.txt:260: parsing iteration count: invalid syntax
baseline-bench.txt:322893: parsing iteration count: invalid syntax
baseline-bench.txt:588733: parsing iteration count: invalid syntax
baseline-bench.txt:1048508: parsing iteration count: invalid syntax
baseline-bench.txt:1321998: parsing iteration count: invalid syntax
baseline-bench.txt:1565755: parsing iteration count: invalid syntax
benchmark-results.txt:260: parsing iteration count: invalid syntax
benchmark-results.txt:330957: parsing iteration count: invalid syntax
benchmark-results.txt:671116: parsing iteration count: invalid syntax
benchmark-results.txt:998249: parsing iteration count: invalid syntax
benchmark-results.txt:1384851: parsing iteration count: invalid syntax
benchmark-results.txt:1987219: 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.372m ± 65%
ComponentLoad-4                     3.666m ±  2%
ComponentExecute-4                  1.963µ ±  1%
PoolContention/workers-1-4          1.095µ ±  3%
PoolContention/workers-2-4          1.089µ ±  2%
PoolContention/workers-4-4          1.100µ ±  2%
PoolContention/workers-8-4          1.092µ ±  2%
PoolContention/workers-16-4         1.100µ ±  5%
ComponentLifecycle-4                3.662m ±  1%
SourceValidation-4                  2.293µ ±  1%
RegistryConcurrent-4                811.5n ±  4%
LoaderLoadFromString-4              3.793m ±  2%
geomean                             18.73µ

                            │ 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: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz
                            │ benchmark-results.txt │
                            │        sec/op         │
InterpreterCreation-4                 3.219m ± 185%
ComponentLoad-4                       3.389m ±   0%
ComponentExecute-4                    1.840µ ±   2%
PoolContention/workers-1-4            1.177µ ±   1%
PoolContention/workers-2-4            1.186µ ±   1%
PoolContention/workers-4-4            1.184µ ±   1%
PoolContention/workers-8-4            1.169µ ±   3%
PoolContention/workers-16-4           1.172µ ±   0%
ComponentLifecycle-4                  3.391m ±   0%
SourceValidation-4                    2.193µ ±   1%
RegistryConcurrent-4                  855.1n ±   9%
LoaderLoadFromString-4                3.422m ±   1%
geomean                               17.77µ

                            │ 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.2n ± 1%
CircuitBreakerExecution_Success-4          21.54n ± 0%
CircuitBreakerExecution_Failure-4          65.82n ± 0%
geomean                                    74.12n

                                  │ 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: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz
                                  │ benchmark-results.txt │
                                  │        sec/op         │
CircuitBreakerDetection-4                     425.5n ± 4%
CircuitBreakerExecution_Success-4             55.39n ± 0%
CircuitBreakerExecution_Failure-4             62.93n ± 0%
geomean                                       114.0n

                                  │ 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                     909.2n ± 27%
JQTransform_ObjectConstruction-4         1.512µ ±  1%
JQTransform_ArraySelect-4                3.434µ ±  1%
JQTransform_Complex-4                    40.00µ ±  1%
JQTransform_Throughput-4                 1.867µ ±  1%
SSEPublishDelivery-4                     72.96n ±  1%
geomean                                  1.718µ

                                 │ 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: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz
                                 │ benchmark-results.txt │
                                 │        sec/op         │
JQTransform_Simple-4                        875.3n ± 28%
JQTransform_ObjectConstruction-4            1.444µ ±  1%
JQTransform_ArraySelect-4                   3.084µ ±  0%
JQTransform_Complex-4                       34.50µ ±  1%
JQTransform_Throughput-4                    1.758µ ±  1%
SSEPublishDelivery-4                        71.77n ±  1%
geomean                                     1.603µ

                                 │ 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.103µ ± 2%
SchemaValidation_AllFields-4                 1.672µ ± 3%
SchemaValidation_FormatValidation-4          1.586µ ± 1%
SchemaValidation_ManySchemas-4               1.810µ ± 3%
geomean                                      1.517µ

                                    │ 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: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz
                                    │ benchmark-results.txt │
                                    │        sec/op         │
SchemaValidation_Simple-4                       1.017µ ± 1%
SchemaValidation_AllFields-4                    1.504µ ± 6%
SchemaValidation_FormatValidation-4             1.463µ ± 1%
SchemaValidation_ManySchemas-4                  1.486µ ± 3%
geomean                                         1.350µ

                                    │ 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.188µ ±  9%
EventStoreAppend_SQLite-4                  1.356m ±  4%
GetTimeline_InMemory/events-10-4           13.74µ ±  6%
GetTimeline_InMemory/events-50-4           77.54µ ± 20%
GetTimeline_InMemory/events-100-4          123.7µ ±  1%
GetTimeline_InMemory/events-500-4          633.9µ ±  1%
GetTimeline_InMemory/events-1000-4         1.299m ±  1%
GetTimeline_SQLite/events-10-4             109.0µ ±  1%
GetTimeline_SQLite/events-50-4             251.4µ ±  1%
GetTimeline_SQLite/events-100-4            423.8µ ±  1%
GetTimeline_SQLite/events-500-4            1.798m ±  1%
GetTimeline_SQLite/events-1000-4           3.531m ±  1%
geomean                                    220.0µ

                                   │ baseline-bench.txt │
                                   │        B/op        │
EventStoreAppend_InMemory-4                  786.5 ± 9%
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.33Ki

                                   │ 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: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz
                                   │ benchmark-results.txt │
                                   │        sec/op         │
EventStoreAppend_InMemory-4                   1.126µ ±  4%
EventStoreAppend_SQLite-4                     869.3µ ±  1%
GetTimeline_InMemory/events-10-4              13.45µ ±  2%
GetTimeline_InMemory/events-50-4              75.65µ ±  3%
GetTimeline_InMemory/events-100-4             150.6µ ±  3%
GetTimeline_InMemory/events-500-4             712.4µ ± 17%
GetTimeline_InMemory/events-1000-4            1.209m ±  2%
GetTimeline_SQLite/events-10-4                80.18µ ±  1%
GetTimeline_SQLite/events-50-4                228.2µ ±  1%
GetTimeline_SQLite/events-100-4               412.0µ ±  1%
GetTimeline_SQLite/events-500-4               1.868m ±  1%
GetTimeline_SQLite/events-1000-4              3.648m ±  1%
geomean                                       208.2µ

                                   │ benchmark-results.txt │
                                   │         B/op          │
EventStoreAppend_InMemory-4                    833.0 ± 10%
EventStoreAppend_SQLite-4                    1.986Ki ±  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.65Ki

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

- Add CI env var detection (CI, GITHUB_ACTIONS) to checkForUpdateNotice
- Add daily throttle using ~/.cache/wfctl/last_update_check timestamp file
- Add shouldCheckForUpdate / markUpdateChecked helpers
- Add updateCheckCachePathOverride for test isolation
- Add tests for CI skip, daily throttle (skips/allows), cache helpers

Agent-Logs-Url: https://github.com/GoCodeAlone/workflow/sessions/1b76a0f8-1d93-46f5-81aa-791f5f2e9b4d

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 6, 2026 14:10
Copilot AI changed the title [WIP] Fix wfctl triggering firewall rules wfctl: skip background update check in CI and throttle to once per day May 6, 2026
Copilot AI requested a review from intel352 May 6, 2026 14:12
@intel352 intel352 marked this pull request as ready for review May 6, 2026 18:11
Copilot AI review requested due to automatic review settings May 6, 2026 18:11
@intel352 intel352 merged commit 93eebc0 into main May 6, 2026
19 checks passed
@intel352 intel352 deleted the copilot/fix-firewall-rule-issues branch May 6, 2026 18:12
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 triggers firewall

2 participants