Skip to content

Refactor offline checks#1915

Draft
prymitive wants to merge 1 commit into
mainfrom
offline
Draft

Refactor offline checks#1915
prymitive wants to merge 1 commit into
mainfrom
offline

Conversation

@prymitive

Copy link
Copy Markdown
Collaborator

No more online/offline checks, instead each check can see if --offline flag was passed or not.

@prymitive prymitive marked this pull request as draft July 6, 2026 11:01

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This pull request was validated by pint.

✔️ No problems found

Stats

Stat Value
Version v0.86.0-53-gb0dbe267
Number of rules parsed 22
Number of rules checked 22
Number of problems found 0
Number of checks 0
Checks duration 6ms

Problems

No problems reported

No more online/offline checks, instead each check can see if --offline flag was passed or not.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (c26677a) to head (b0dbe26).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1915   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          115       115           
  Lines        15270     15263    -7     
=========================================
- Hits         15270     15263    -7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Benchmark diff:

goos: linux
goarch: amd64
pkg: github.com/cloudflare/pint/cmd/pint
cpu: INTEL(R) XEON(R) PLATINUM 8573C
                             │   old.txt    │              new.txt               │
                             │    sec/op    │    sec/op     vs base              │
GlobFinder                     36.04m ± ∞ ¹   36.35m ± ∞ ¹  +0.86% (p=0.041 n=6)
GitFinder                      438.3m ± ∞ ¹   444.4m ± ∞ ¹  +1.40% (p=0.041 n=6)
Check/alerts/comparison        47.33µ ± ∞ ¹   47.44µ ± ∞ ¹       ~ (p=0.165 n=6)
Check/promql/regexp            1.532m ± ∞ ¹   1.559m ± ∞ ¹  +1.75% (p=0.009 n=6)
Check/promql/nan               1.844m ± ∞ ¹   1.892m ± ∞ ¹  +2.58% (p=0.002 n=6)
Check/group/interval           3.305µ ± ∞ ¹   3.308µ ± ∞ ¹       ~ (p=0.307 n=6)
Check/promql/offset            2.998m ± ∞ ¹   3.126m ± ∞ ¹  +4.27% (p=0.002 n=6)
Check/promql/range_query       3.035m ± ∞ ¹   3.136m ± ∞ ¹  +3.35% (p=0.002 n=6)
Check/promql/syntax            22.36µ ± ∞ ¹   22.31µ ± ∞ ¹  -0.22% (p=0.035 n=6)
Check/alerts/template          246.6m ± ∞ ¹   243.6m ± ∞ ¹       ~ (p=0.394 n=6)
Check/rule/dependency          23.33m ± ∞ ¹   24.45m ± ∞ ¹  +4.77% (p=0.002 n=6)
Check/promql/vector_matching   19.16m ± ∞ ¹   20.06m ± ∞ ¹  +4.69% (p=0.002 n=6)
Check/alerts/external_labels   51.14m ± ∞ ¹   51.83m ± ∞ ¹  +1.34% (p=0.041 n=6)
Check/alerts/absent            74.93µ ± ∞ ¹   76.52µ ± ∞ ¹  +2.13% (p=0.002 n=6)
Check/promql/features          88.41µ ± ∞ ¹   94.09µ ± ∞ ¹  +6.43% (p=0.002 n=6)
Check/alerts/count             13.10m ± ∞ ¹   13.94m ± ∞ ¹       ~ (p=0.240 n=6)
Check/alerts/for               163.0µ ± ∞ ¹   164.0µ ± ∞ ¹       ~ (p=0.310 n=6)
Check/promql/impossible        88.95µ ± ∞ ¹   92.59µ ± ∞ ¹  +4.09% (p=0.002 n=6)
Check/promql/rate              4.609m ± ∞ ¹   4.650m ± ∞ ¹       ~ (p=0.065 n=6)
Check/rule/duplicate           24.06m ± ∞ ¹   24.05m ± ∞ ¹       ~ (p=0.818 n=6)
Check/promql/counter           3.099m ± ∞ ¹   3.098m ± ∞ ¹       ~ (p=0.818 n=6)
Check/rule/reject              120.5µ ± ∞ ¹   123.0µ ± ∞ ¹  +2.09% (p=0.002 n=6)
Check/alerts/annotation        558.8µ ± ∞ ¹   570.6µ ± ∞ ¹  +2.11% (p=0.002 n=6)
Check/query/cost               26.09m ± ∞ ¹   25.21m ± ∞ ¹  -3.38% (p=0.002 n=6)
Check/promql/fragile           93.18µ ± ∞ ¹   98.18µ ± ∞ ¹  +5.36% (p=0.002 n=6)
Check/promql/series             1.097 ± ∞ ¹    1.094 ± ∞ ¹       ~ (p=0.818 n=6)
Check/labels/conflict          2.097m ± ∞ ¹   2.092m ± ∞ ¹       ~ (p=0.589 n=6)
Check/rule/label               1.808m ± ∞ ¹   1.784m ± ∞ ¹       ~ (p=0.818 n=6)
RuleIsIdentical                17.68m ± ∞ ¹   17.72m ± ∞ ¹       ~ (p=0.310 n=6)
GetChecksForEntry              251.5m ± ∞ ¹   268.5m ± ∞ ¹  +6.75% (p=0.009 n=6)
geomean                        2.716m         2.766m        +1.83%
¹ need >= 8 samples for confidence interval at level 0.99

                             │    old.txt    │                new.txt                │
                             │     B/op      │     B/op       vs base                │
GlobFinder                     12.77Mi ± ∞ ¹   12.77Mi ± ∞ ¹       ~ (p=0.108 n=6)
GitFinder                      25.94Mi ± ∞ ¹   25.94Mi ± ∞ ¹       ~ (p=0.485 n=6)
Check/alerts/comparison          352.0 ± ∞ ¹     352.0 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/regexp            477.6Ki ± ∞ ¹   477.6Ki ± ∞ ¹  -0.00% (p=0.002 n=6)
Check/promql/nan               191.6Ki ± ∞ ¹   191.6Ki ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/group/interval             0.000 ± ∞ ¹     0.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/offset            418.5Ki ± ∞ ¹   418.5Ki ± ∞ ¹  -0.00% (p=0.002 n=6)
Check/promql/range_query       418.0Ki ± ∞ ¹   418.0Ki ± ∞ ¹       ~ (p=0.232 n=6)
Check/promql/syntax              0.000 ± ∞ ¹     0.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/alerts/template          112.8Mi ± ∞ ¹   112.8Mi ± ∞ ¹  -0.00% (p=0.002 n=6)
Check/rule/dependency          15.90Mi ± ∞ ¹   15.90Mi ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/vector_matching   8.181Mi ± ∞ ¹   8.181Mi ± ∞ ¹       ~ (p=0.937 n=6)
Check/alerts/external_labels   18.58Mi ± ∞ ¹   18.58Mi ± ∞ ¹  -0.00% (p=0.002 n=6)
Check/alerts/absent            3.812Ki ± ∞ ¹   3.812Ki ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/features            0.000 ± ∞ ¹     0.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/alerts/count             1.466Mi ± ∞ ¹   1.510Mi ± ∞ ¹       ~ (p=0.699 n=6)
Check/alerts/for               88.41Ki ± ∞ ¹   88.41Ki ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/impossible          704.0 ± ∞ ¹     704.0 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/rate              379.1Ki ± ∞ ¹   379.1Ki ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/rule/duplicate             0.000 ± ∞ ¹     0.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/counter           455.1Ki ± ∞ ¹   455.1Ki ± ∞ ¹       ~ (p=0.061 n=6)
Check/rule/reject                0.000 ± ∞ ¹     0.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/alerts/annotation          0.000 ± ∞ ¹     0.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/query/cost               525.0Ki ± ∞ ¹   525.0Ki ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/fragile           15.50Ki ± ∞ ¹   15.50Ki ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/series            98.53Mi ± ∞ ¹   98.53Mi ± ∞ ¹       ~ (p=0.167 n=6)
Check/labels/conflict          275.8Ki ± ∞ ¹   275.8Ki ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/rule/label               685.7Ki ± ∞ ¹   685.7Ki ± ∞ ¹       ~ (p=1.000 n=6) ²
RuleIsIdentical                  0.000 ± ∞ ¹     0.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
GetChecksForEntry              99.93Mi ± ∞ ¹   99.93Mi ± ∞ ¹       ~ (p=0.299 n=6)
geomean                                    ³                  +0.10%               ³
¹ need >= 8 samples for confidence interval at level 0.99
² all samples are equal
³ summaries must be >0 to compute geomean

                             │   old.txt    │               new.txt                │
                             │  allocs/op   │  allocs/op    vs base                │
GlobFinder                     197.8k ± ∞ ¹   197.8k ± ∞ ¹       ~ (p=1.000 n=6) ²
GitFinder                      244.4k ± ∞ ¹   244.4k ± ∞ ¹       ~ (p=0.340 n=6)
Check/alerts/comparison         4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/regexp            8.587k ± ∞ ¹   8.587k ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/nan               3.652k ± ∞ ¹   3.652k ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/group/interval            0.000 ± ∞ ¹    0.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/offset            12.42k ± ∞ ¹   12.42k ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/range_query       12.41k ± ∞ ¹   12.41k ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/syntax             0.000 ± ∞ ¹    0.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/alerts/template          1.046M ± ∞ ¹   1.046M ± ∞ ¹  -0.00% (p=0.002 n=6)
Check/rule/dependency          7.632k ± ∞ ¹   7.632k ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/vector_matching   90.51k ± ∞ ¹   90.51k ± ∞ ¹       ~ (p=0.058 n=6)
Check/alerts/external_labels   321.8k ± ∞ ¹   321.8k ± ∞ ¹  -0.00% (p=0.002 n=6)
Check/alerts/absent             76.00 ± ∞ ¹    76.00 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/features           0.000 ± ∞ ¹    0.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/alerts/count             33.58k ± ∞ ¹   34.16k ± ∞ ¹       ~ (p=0.896 n=6)
Check/alerts/for               1.476k ± ∞ ¹   1.476k ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/impossible         5.000 ± ∞ ¹    5.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/rate              8.202k ± ∞ ¹   8.202k ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/rule/duplicate            0.000 ± ∞ ¹    0.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/counter           24.14k ± ∞ ¹   24.14k ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/rule/reject               0.000 ± ∞ ¹    0.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/alerts/annotation         0.000 ± ∞ ¹    0.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/query/cost               7.624k ± ∞ ¹   7.624k ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/fragile            246.0 ± ∞ ¹    246.0 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/series            1.418M ± ∞ ¹   1.418M ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/labels/conflict          5.724k ± ∞ ¹   5.724k ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/rule/label               11.45k ± ∞ ¹   11.45k ± ∞ ¹       ~ (p=1.000 n=6) ²
RuleIsIdentical                 0.000 ± ∞ ¹    0.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
GetChecksForEntry              1.654M ± ∞ ¹   1.654M ± ∞ ¹       ~ (p=1.000 n=6)
geomean                                   ³                 +0.06%               ³
¹ need >= 8 samples for confidence interval at level 0.99
² all samples are equal
³ summaries must be >0 to compute geomean

pkg: github.com/cloudflare/pint/internal/diags
                           │   old.txt    │              new.txt               │
                           │    sec/op    │    sec/op     vs base              │
InjectDiagnosticsLongExpr    7.741µ ± ∞ ¹   7.760µ ± ∞ ¹       ~ (p=0.420 n=6)
InjectDiagnosticsShortExpr   1.198µ ± ∞ ¹   1.202µ ± ∞ ¹  +0.33% (p=0.041 n=6)
geomean                      3.045µ         3.054µ        +0.29%
¹ need >= 8 samples for confidence interval at level 0.99

                           │    old.txt    │                new.txt                │
                           │     B/op      │     B/op       vs base                │
InjectDiagnosticsLongExpr    3.578Ki ± ∞ ¹   3.578Ki ± ∞ ¹       ~ (p=1.000 n=6) ²
InjectDiagnosticsShortExpr     304.0 ± ∞ ¹     304.0 ± ∞ ¹       ~ (p=1.000 n=6) ²
geomean                      1.031Ki         1.031Ki        +0.00%
¹ need >= 8 samples for confidence interval at level 0.99
² all samples are equal

                           │   old.txt   │               new.txt               │
                           │  allocs/op  │  allocs/op   vs base                │
InjectDiagnosticsLongExpr    39.00 ± ∞ ¹   39.00 ± ∞ ¹       ~ (p=1.000 n=6) ²
InjectDiagnosticsShortExpr   13.00 ± ∞ ¹   13.00 ± ∞ ¹       ~ (p=1.000 n=6) ²
geomean                      22.52         22.52        +0.00%
¹ need >= 8 samples for confidence interval at level 0.99
² all samples are equal

pkg: github.com/cloudflare/pint/internal/parser
      │   old.txt    │            new.txt            │
      │    sec/op    │    sec/op     vs base         │
Parse   17.94m ± ∞ ¹   17.83m ± ∞ ¹  ~ (p=0.240 n=6)
¹ need >= 8 samples for confidence interval at level 0.99

      │    old.txt    │            new.txt             │
      │     B/op      │     B/op       vs base         │
Parse   6.385Mi ± ∞ ¹   6.385Mi ± ∞ ¹  ~ (p=0.372 n=6)
¹ need >= 8 samples for confidence interval at level 0.99

      │   old.txt    │            new.txt            │
      │  allocs/op   │  allocs/op    vs base         │
Parse   102.8k ± ∞ ¹   102.8k ± ∞ ¹  ~ (p=1.000 n=6)
¹ need >= 8 samples for confidence interval at level 0.99

pkg: github.com/cloudflare/pint/internal/parser/source
             │   old.txt    │              new.txt               │
             │    sec/op    │    sec/op     vs base              │
LabelsSource   1.108m ± ∞ ¹   1.097m ± ∞ ¹  -1.00% (p=0.009 n=6)
¹ need >= 8 samples for confidence interval at level 0.99

             │    old.txt    │            new.txt             │
             │     B/op      │     B/op       vs base         │
LabelsSource   755.0Ki ± ∞ ¹   755.0Ki ± ∞ ¹  ~ (p=0.848 n=6)
¹ need >= 8 samples for confidence interval at level 0.99

             │   old.txt    │             new.txt             │
             │  allocs/op   │  allocs/op    vs base           │
LabelsSource   7.251k ± ∞ ¹   7.251k ± ∞ ¹  ~ (p=1.000 n=6) ²
¹ need >= 8 samples for confidence interval at level 0.99
² all samples are equal

pkg: github.com/cloudflare/pint/internal/promapi
                  │   old.txt    │              new.txt               │
                  │    sec/op    │    sec/op     vs base              │
QueryCacheOnlySet   116.9n ± ∞ ¹   117.4n ± ∞ ¹  +0.43% (p=0.015 n=6)
¹ need >= 8 samples for confidence interval at level 0.99

                  │   old.txt   │            new.txt             │
                  │    B/op     │    B/op      vs base           │
QueryCacheOnlySet   64.00 ± ∞ ¹   64.00 ± ∞ ¹  ~ (p=1.000 n=6) ²
¹ need >= 8 samples for confidence interval at level 0.99
² all samples are equal

                  │   old.txt   │            new.txt             │
                  │  allocs/op  │  allocs/op   vs base           │
QueryCacheOnlySet   1.000 ± ∞ ¹   1.000 ± ∞ ¹  ~ (p=1.000 n=6) ²
¹ need >= 8 samples for confidence interval at level 0.99
² all samples are equal

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