Skip to content

Fix keep_firing_for handling - #2012

Merged
prymitive merged 1 commit into
mainfrom
issue-2004
Oct 21, 2026
Merged

prymitive merged 1 commit into
mainfrom
issue-2004

Conversation

@prymitive

Copy link
Copy Markdown
Collaborator

Fixes #2004.

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

❗ Problems found.

Severity Number of problems
Information 5
Stats

Stat Value
Version v0.89.3-13-g0cc2bd10
Number of rules parsed 22
Number of rules checked 22
Number of problems found 5
Number of offline checks 5
Number of online checks 0
Checks duration 4ms

Problems

Information: problem reported by config rule (rule/report)
  ---> .github/pint/rules/reject.yml:4-10 -> `Bad Label Key` [+4 duplicates]
4 |   - alert: Bad Label Key
               ^^^^^^^^^^^^^ Rules in this file are intentionally broken for testing.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff             @@
##              main     #2012    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files          115       115            
  Lines        13880     13984   +104     
==========================================
+ Hits         13880     13984   +104     

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

@prymitive
prymitive enabled auto-merge October 21, 2026 16:46
@github-actions

Copy link
Copy Markdown

Benchmark diff:

goos: linux
goarch: amd64
pkg: github.com/cloudflare/pint/cmd/pint
cpu: AMD EPYC 9V74 80-Core Processor                
                             │   old.txt    │              new.txt               │
                             │    sec/op    │    sec/op     vs base              │
GlobFinder                     30.52m ± ∞ ¹   30.82m ± ∞ ¹  +0.99% (p=0.002 n=6)
GitFinder                      472.3m ± ∞ ¹   472.2m ± ∞ ¹       ~ (p=0.699 n=6)
Check/group/interval           3.663µ ± ∞ ¹   3.667µ ± ∞ ¹       ~ (p=0.372 n=6)
Check/promql/rate              4.664m ± ∞ ¹   4.628m ± ∞ ¹       ~ (p=0.937 n=6)
Check/alerts/external_labels   36.19m ± ∞ ¹   36.67m ± ∞ ¹  +1.33% (p=0.041 n=6)
Check/promql/features          68.12µ ± ∞ ¹   63.94µ ± ∞ ¹  -6.13% (p=0.002 n=6)
Check/alerts/for               111.6µ ± ∞ ¹   117.1µ ± ∞ ¹  +4.87% (p=0.002 n=6)
Check/alerts/comparison        26.96µ ± ∞ ¹   25.21µ ± ∞ ¹  -6.50% (p=0.002 n=6)
Check/promql/regexp            1.136m ± ∞ ¹   1.153m ± ∞ ¹  +1.52% (p=0.002 n=6)
Check/promql/impossible        74.36µ ± ∞ ¹   72.08µ ± ∞ ¹  -3.06% (p=0.002 n=6)
Check/labels/conflict          1.705m ± ∞ ¹   1.702m ± ∞ ¹       ~ (p=0.589 n=6)
Check/promql/counter           2.433m ± ∞ ¹   2.297m ± ∞ ¹       ~ (p=0.065 n=6)
Check/rule/label               1.100m ± ∞ ¹   1.087m ± ∞ ¹  -1.16% (p=0.041 n=6)
Check/promql/fragile           74.10µ ± ∞ ¹   71.44µ ± ∞ ¹  -3.60% (p=0.002 n=6)
Check/promql/vector_matching   14.49m ± ∞ ¹   14.42m ± ∞ ¹       ~ (p=0.180 n=6)
Check/promql/range_query       2.538m ± ∞ ¹   2.491m ± ∞ ¹  -1.85% (p=0.002 n=6)
Check/alerts/absent            52.11µ ± ∞ ¹   50.92µ ± ∞ ¹  -2.28% (p=0.002 n=6)
Check/rule/reject              134.2µ ± ∞ ¹   133.2µ ± ∞ ¹  -0.74% (p=0.009 n=6)
Check/alerts/annotation        461.3µ ± ∞ ¹   456.1µ ± ∞ ¹  -1.14% (p=0.002 n=6)
Check/query/cost               13.74m ± ∞ ¹   13.97m ± ∞ ¹  +1.68% (p=0.002 n=6)
Check/promql/syntax            9.321µ ± ∞ ¹   9.436µ ± ∞ ¹  +1.24% (p=0.002 n=6)
Check/promql/series            946.0m ± ∞ ¹   943.6m ± ∞ ¹       ~ (p=0.818 n=6)
Check/promql/offset            2.574m ± ∞ ¹   2.487m ± ∞ ¹  -3.39% (p=0.002 n=6)
Check/rule/duplicate           12.13m ± ∞ ¹   12.14m ± ∞ ¹       ~ (p=0.937 n=6)
Check/alerts/count             9.111m ± ∞ ¹   8.295m ± ∞ ¹  -8.95% (p=0.002 n=6)
Check/alerts/template          195.1m ± ∞ ¹   186.6m ± ∞ ¹  -4.35% (p=0.002 n=6)
Check/rule/dependency          18.50m ± ∞ ¹   16.93m ± ∞ ¹  -8.47% (p=0.004 n=6)
Check/promql/nan               2.041m ± ∞ ¹   2.031m ± ∞ ¹       ~ (p=0.240 n=6)
RuleIsIdentical                11.77m ± ∞ ¹   11.87m ± ∞ ¹  +0.87% (p=0.004 n=6)
GetChecksForEntry              157.2m ± ∞ ¹   157.2m ± ∞ ¹       ~ (p=0.485 n=6)
geomean                        2.067m         2.034m        -1.60%
¹ 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.264 n=6)
GitFinder                      25.93Mi ± ∞ ¹   25.93Mi ± ∞ ¹       ~ (p=0.937 n=6)
Check/group/interval             0.000 ± ∞ ¹     0.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/rate              406.6Ki ± ∞ ¹   406.6Ki ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/alerts/external_labels   18.67Mi ± ∞ ¹   18.67Mi ± ∞ ¹       ~ (p=1.000 n=6)
Check/promql/features            0.000 ± ∞ ¹     0.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/alerts/for               88.41Ki ± ∞ ¹   88.41Ki ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/alerts/comparison          352.0 ± ∞ ¹     352.0 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/regexp            477.6Ki ± ∞ ¹   477.6Ki ± ∞ ¹       ~ (p=1.000 n=6)
Check/promql/impossible          704.0 ± ∞ ¹     704.0 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/labels/conflict          275.8Ki ± ∞ ¹   275.8Ki ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/counter           455.1Ki ± ∞ ¹   455.1Ki ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/rule/label               685.7Ki ± ∞ ¹   685.7Ki ± ∞ ¹       ~ (p=0.455 n=6)
Check/promql/fragile           15.50Ki ± ∞ ¹   15.50Ki ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/vector_matching   8.204Mi ± ∞ ¹   8.204Mi ± ∞ ¹       ~ (p=0.394 n=6)
Check/promql/range_query       418.0Ki ± ∞ ¹   418.0Ki ± ∞ ¹       ~ (p=1.000 n=6)
Check/alerts/absent            3.812Ki ± ∞ ¹   3.812Ki ± ∞ ¹       ~ (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               525.0Ki ± ∞ ¹   525.0Ki ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/syntax              0.000 ± ∞ ¹     0.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/series            98.53Mi ± ∞ ¹   98.53Mi ± ∞ ¹       ~ (p=0.905 n=6)
Check/promql/offset            418.5Ki ± ∞ ¹   418.5Ki ± ∞ ¹  +0.00% (p=0.002 n=6)
Check/rule/duplicate             0.000 ± ∞ ¹     0.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/alerts/count             1.379Mi ± ∞ ¹   1.379Mi ± ∞ ¹  +0.00% (p=0.002 n=6)
Check/alerts/template          113.1Mi ± ∞ ¹   113.1Mi ± ∞ ¹  +0.00% (p=0.002 n=6)
Check/rule/dependency          15.90Mi ± ∞ ¹   15.90Mi ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/nan               191.6Ki ± ∞ ¹   191.6Ki ± ∞ ¹       ~ (p=1.000 n=6) ²
RuleIsIdentical                  0.000 ± ∞ ¹     0.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
GetChecksForEntry              100.1Mi ± ∞ ¹   100.1Mi ± ∞ ¹  -0.00% (p=0.019 n=6)
geomean                                    ³                  +0.00%               ³
¹ 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=0.455 n=6)
GitFinder                      244.4k ± ∞ ¹   244.4k ± ∞ ¹       ~ (p=1.000 n=6)
Check/group/interval            0.000 ± ∞ ¹    0.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/rate              8.858k ± ∞ ¹   8.858k ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/alerts/external_labels   321.8k ± ∞ ¹   321.8k ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/features           0.000 ± ∞ ¹    0.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/alerts/for               1.476k ± ∞ ¹   1.476k ± ∞ ¹       ~ (p=1.000 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/impossible         5.000 ± ∞ ¹    5.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/labels/conflict          5.724k ± ∞ ¹   5.724k ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/counter           24.14k ± ∞ ¹   24.14k ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/rule/label               11.45k ± ∞ ¹   11.45k ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/fragile            246.0 ± ∞ ¹    246.0 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/vector_matching   92.03k ± ∞ ¹   92.03k ± ∞ ¹       ~ (p=1.000 n=6)
Check/promql/range_query       12.41k ± ∞ ¹   12.41k ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/alerts/absent             76.00 ± ∞ ¹    76.00 ± ∞ ¹       ~ (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/syntax             0.000 ± ∞ ¹    0.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/series            1.418M ± ∞ ¹   1.418M ± ∞ ¹       ~ (p=1.000 n=6)
Check/promql/offset            12.42k ± ∞ ¹   12.42k ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/rule/duplicate            0.000 ± ∞ ¹    0.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/alerts/count             32.44k ± ∞ ¹   32.44k ± ∞ ¹       ~ (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/nan               3.652k ± ∞ ¹   3.652k ± ∞ ¹       ~ (p=1.000 n=6) ²
RuleIsIdentical                 0.000 ± ∞ ¹    0.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
GetChecksForEntry              1.645M ± ∞ ¹   1.645M ± ∞ ¹       ~ (p=0.545 n=6)
geomean                                   ³                 +0.00%               ³
¹ 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    9.302µ ± ∞ ¹   9.150µ ± ∞ ¹       ~ (p=0.065 n=6)
InjectDiagnosticsShortExpr   954.9n ± ∞ ¹   958.7n ± ∞ ¹       ~ (p=0.071 n=6)
geomean                      2.980µ         2.962µ        -0.62%
¹ 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   14.29m ± ∞ ¹   14.39m ± ∞ ¹  ~ (p=0.180 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.290 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   825.9µ ± ∞ ¹   829.3µ ± ∞ ¹  +0.41% (p=0.004 n=6)
¹ need >= 8 samples for confidence interval at level 0.99

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

             │   old.txt    │             new.txt             │
             │  allocs/op   │  allocs/op    vs base           │
LabelsSource   7.370k ± ∞ ¹   7.370k ± ∞ ¹  ~ (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   85.97n ± ∞ ¹   86.26n ± ∞ ¹  +0.34% (p=0.004 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

@prymitive
prymitive disabled auto-merge October 21, 2026 16:47
@prymitive
prymitive merged commit 08fc34d into main Oct 21, 2026
20 checks passed
@prymitive
prymitive deleted the issue-2004 branch October 21, 2026 16:47
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.

alerts/count adds keep_firing_for to for, so alerts using it are undercounted

2 participants