Skip to content

Improve git changes detection - #2031

Merged
prymitive merged 5 commits into
mainfrom
changes
Nov 11, 2026
Merged

prymitive merged 5 commits into
mainfrom
changes

Conversation

@prymitive

Copy link
Copy Markdown
Collaborator

No description provided.

target is more clear what it's for
Describe() now gets HEAD and its parents with
`git rev-list --parents -n 1 HEAD`. If HEAD has two parents, and the
first parent is an ancestor of the target branch, then HEAD is a merge
into the target branch. In this case pint uses the second parent, which
is the last commit on the branch. In all other cases pint uses HEAD,
including a normal branch checkout and a merge of main into the branch.

Describe() now takes the target branch, because it needs the target
branch to make this check.

@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.4-37-g533f8157
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 5ms

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

codecov-commenter commented Nov 11, 2026 •

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #2031   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          115       115           
  Lines        13947     13923   -24     
=========================================
- Hits         13947     13923   -24     

☔ 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 Nov 11, 2026 •

Copy link
Copy Markdown

Benchmark diff:

goos: linux
goarch: amd64
pkg: github.com/cloudflare/pint/cmd/pint
cpu: AMD EPYC 7763 64-Core Processor                
                             │   old.txt    │               new.txt               │
                             │    sec/op    │    sec/op      vs base              │
GlobFinder                     41.17m ± ∞ ¹    40.91m ± ∞ ¹       ~ (p=0.589 n=6)
GitFinder                      582.1m ± ∞ ¹    581.7m ± ∞ ¹       ~ (p=0.937 n=6)
Check/alerts/for               148.8µ ± ∞ ¹    152.6µ ± ∞ ¹  +2.55% (p=0.002 n=6)
Check/promql/regexp            1.506m ± ∞ ¹    1.443m ± ∞ ¹  -4.16% (p=0.002 n=6)
Check/promql/impossible        95.28µ ± ∞ ¹    98.56µ ± ∞ ¹  +3.45% (p=0.002 n=6)
Check/promql/series             1.162 ± ∞ ¹     1.180 ± ∞ ¹       ~ (p=0.394 n=6)
Check/promql/offset            3.308m ± ∞ ¹    3.265m ± ∞ ¹       ~ (p=0.065 n=6)
Check/rule/duplicate           16.71m ± ∞ ¹    17.04m ± ∞ ¹  +2.00% (p=0.002 n=6)
Check/promql/features          99.68µ ± ∞ ¹   100.81µ ± ∞ ¹       ~ (p=0.065 n=6)
Check/alerts/count             11.68m ± ∞ ¹    11.45m ± ∞ ¹  -1.97% (p=0.015 n=6)
Check/promql/syntax            11.83µ ± ∞ ¹    11.93µ ± ∞ ¹  +0.85% (p=0.002 n=6)
Check/rule/dependency          22.71m ± ∞ ¹    23.35m ± ∞ ¹       ~ (p=0.310 n=6)
Check/promql/nan               2.521m ± ∞ ¹    2.481m ± ∞ ¹       ~ (p=0.132 n=6)
Check/promql/rate              6.120m ± ∞ ¹    6.118m ± ∞ ¹       ~ (p=0.699 n=6)
Check/labels/conflict          2.184m ± ∞ ¹    2.197m ± ∞ ¹       ~ (p=0.132 n=6)
Check/rule/reject              186.3µ ± ∞ ¹    185.8µ ± ∞ ¹  -0.26% (p=0.045 n=6)
Check/alerts/annotation        583.5µ ± ∞ ¹    576.9µ ± ∞ ¹  -1.12% (p=0.009 n=6)
Check/rule/label               1.504m ± ∞ ¹    1.420m ± ∞ ¹  -5.56% (p=0.015 n=6)
Check/alerts/template          257.4m ± ∞ ¹    241.0m ± ∞ ¹  -6.36% (p=0.002 n=6)
Check/promql/fragile           103.2µ ± ∞ ¹    102.3µ ± ∞ ¹       ~ (p=0.394 n=6)
Check/promql/vector_matching   21.01m ± ∞ ¹    20.75m ± ∞ ¹       ~ (p=0.394 n=6)
Check/promql/range_query       3.399m ± ∞ ¹    3.314m ± ∞ ¹       ~ (p=0.065 n=6)
Check/promql/counter           3.212m ± ∞ ¹    3.144m ± ∞ ¹  -2.11% (p=0.026 n=6)
Check/alerts/absent            77.54µ ± ∞ ¹    78.06µ ± ∞ ¹       ~ (p=0.065 n=6)
Check/alerts/comparison        51.73µ ± ∞ ¹    51.89µ ± ∞ ¹       ~ (p=0.699 n=6)
Check/group/interval           4.491µ ± ∞ ¹    4.488µ ± ∞ ¹       ~ (p=1.000 n=6)
Check/alerts/external_labels   49.09m ± ∞ ¹    48.96m ± ∞ ¹       ~ (p=1.000 n=6)
Check/query/cost               20.17m ± ∞ ¹    20.32m ± ∞ ¹       ~ (p=0.699 n=6)
RuleIsIdentical                14.56m ± ∞ ¹    14.52m ± ∞ ¹       ~ (p=0.937 n=6)
GetChecksForEntry              231.4m ± ∞ ¹    223.4m ± ∞ ¹  -3.47% (p=0.002 n=6)
geomean                        2.779m          2.762m        -0.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.225 n=6)
GitFinder                      26.01Mi ± ∞ ¹   26.05Mi ± ∞ ¹       ~ (p=0.132 n=6)
Check/alerts/for               88.41Ki ± ∞ ¹   88.41Ki ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/regexp            491.7Ki ± ∞ ¹   491.7Ki ± ∞ ¹  -0.00% (p=0.013 n=6)
Check/promql/impossible          704.0 ± ∞ ¹     704.0 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/series            98.54Mi ± ∞ ¹   98.54Mi ± ∞ ¹       ~ (p=1.000 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/promql/features            0.000 ± ∞ ¹     0.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/alerts/count             1.379Mi ± ∞ ¹   1.379Mi ± ∞ ¹  +0.00% (p=0.015 n=6)
Check/promql/syntax              0.000 ± ∞ ¹     0.000 ± ∞ ¹       ~ (p=1.000 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) ²
Check/promql/rate              406.6Ki ± ∞ ¹   406.6Ki ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/labels/conflict          275.8Ki ± ∞ ¹   275.8Ki ± ∞ ¹       ~ (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/rule/label               685.7Ki ± ∞ ¹   685.7Ki ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/alerts/template          113.1Mi ± ∞ ¹   113.1Mi ± ∞ ¹  +0.00% (p=0.002 n=6)
Check/promql/fragile           15.50Ki ± ∞ ¹   15.50Ki ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/vector_matching   8.245Mi ± ∞ ¹   8.245Mi ± ∞ ¹       ~ (p=0.132 n=6)
Check/promql/range_query       418.0Ki ± ∞ ¹   418.0Ki ± ∞ ¹       ~ (p=1.000 n=6)
Check/promql/counter           455.1Ki ± ∞ ¹   455.1Ki ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/alerts/absent            3.812Ki ± ∞ ¹   3.812Ki ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/alerts/comparison          352.0 ± ∞ ¹     352.0 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/group/interval             0.000 ± ∞ ¹     0.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/alerts/external_labels   18.67Mi ± ∞ ¹   18.67Mi ± ∞ ¹       ~ (p=0.892 n=6)
Check/query/cost               525.0Ki ± ∞ ¹   525.0Ki ± ∞ ¹       ~ (p=1.000 n=6) ²
RuleIsIdentical                  0.000 ± ∞ ¹     0.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
GetChecksForEntry              100.1Mi ± ∞ ¹   100.1Mi ± ∞ ¹       ~ (p=0.061 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=1.000 n=6)
GitFinder                      246.3k ± ∞ ¹   246.0k ± ∞ ¹  -0.13% (p=0.002 n=6)
Check/alerts/for               1.476k ± ∞ ¹   1.476k ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/regexp            8.910k ± ∞ ¹   8.910k ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/impossible         5.000 ± ∞ ¹    5.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/series            1.419M ± ∞ ¹   1.419M ± ∞ ¹       ~ (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/promql/features           0.000 ± ∞ ¹    0.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/alerts/count             32.44k ± ∞ ¹   32.44k ± ∞ ¹       ~ (p=1.000 n=6)
Check/promql/syntax             0.000 ± ∞ ¹    0.000 ± ∞ ¹       ~ (p=1.000 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) ²
Check/promql/rate              8.858k ± ∞ ¹   8.858k ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/labels/conflict          5.724k ± ∞ ¹   5.724k ± ∞ ¹       ~ (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/rule/label               11.45k ± ∞ ¹   11.45k ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/alerts/template          1.046M ± ∞ ¹   1.046M ± ∞ ¹  +0.00% (p=0.002 n=6)
Check/promql/fragile            246.0 ± ∞ ¹    246.0 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/vector_matching   92.74k ± ∞ ¹   92.74k ± ∞ ¹       ~ (p=0.273 n=6)
Check/promql/range_query       12.41k ± ∞ ¹   12.41k ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/promql/counter           24.14k ± ∞ ¹   24.14k ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/alerts/absent             76.00 ± ∞ ¹    76.00 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/alerts/comparison         4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/group/interval            0.000 ± ∞ ¹    0.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/alerts/external_labels   321.8k ± ∞ ¹   321.8k ± ∞ ¹       ~ (p=1.000 n=6) ²
Check/query/cost               7.624k ± ∞ ¹   7.624k ± ∞ ¹       ~ (p=1.000 n=6) ²
RuleIsIdentical                 0.000 ± ∞ ¹    0.000 ± ∞ ¹       ~ (p=1.000 n=6) ²
GetChecksForEntry              1.645M ± ∞ ¹   1.645M ± ∞ ¹       ~ (p=0.121 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    8.915µ ± ∞ ¹   8.922µ ± ∞ ¹       ~ (p=1.000 n=6)
InjectDiagnosticsShortExpr   1.371µ ± ∞ ¹   1.373µ ± ∞ ¹       ~ (p=0.509 n=6)
geomean                      3.496µ         3.500µ        +0.12%
¹ 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   19.88m ± ∞ ¹   19.91m ± ∞ ¹  ~ (p=1.000 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.675 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.249m ± ∞ ¹   1.256m ± ∞ ¹  ~ (p=0.093 n=6)
¹ need >= 8 samples for confidence interval at level 0.99

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

             │   old.txt    │             new.txt             │
             │  allocs/op   │  allocs/op    vs base           │
LabelsSource   7.376k ± ∞ ¹   7.376k ± ∞ ¹  ~ (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   105.6n ± ∞ ¹   105.9n ± ∞ ¹  ~ (p=0.186 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 marked this pull request as ready for review November 11, 2026 14:12
@prymitive
prymitive merged commit 16d643e into main Nov 11, 2026
20 checks passed
@prymitive
prymitive deleted the changes branch November 11, 2026 14:50
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