Skip to content

Update rule_label.go#1696

Merged
prymitive merged 1 commit intocloudflare:mainfrom
QtRoS:patch-1
Feb 2, 2026
Merged

Update rule_label.go#1696
prymitive merged 1 commit intocloudflare:mainfrom
QtRoS:patch-1

Conversation

@QtRoS
Copy link
Contributor

@QtRoS QtRoS commented Jan 30, 2026

Fixing panic

runtime error: invalid memory address or nil pointer dereference
/usr/local/go/src/runtime/panic.go:262 runtime.panicmem()
/usr/local/go/src/runtime/signal_unix.go:925 runtime.sigpanic()
/build/pint/checks/rule_label.go:107 

It happens when group has labels but recording rule hasn't.

Fixing panic

```
runtime error: invalid memory address or nil pointer dereference
/usr/local/go/src/runtime/panic.go:262 runtime.panicmem()
/usr/local/go/src/runtime/signal_unix.go:925 runtime.sigpanic()
/build/pint/checks/rule_label.go:107 
```
@QtRoS QtRoS requested a review from prymitive as a code owner January 30, 2026 14:33
@prymitive
Copy link
Collaborator

Thanks, can you share a test rule file so I can add a test for this?

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.56%. Comparing base (de975ad) to head (d744047).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1696   +/-   ##
=======================================
  Coverage   99.56%   99.56%           
=======================================
  Files         109      109           
  Lines       13203    13203           
=======================================
  Hits        13146    13146           
  Misses         32       32           
  Partials       25       25           

☔ View full report in Codecov by Sentry.
📢 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.

@QtRoS
Copy link
Contributor Author

QtRoS commented Jan 30, 2026

@prymitive sure!

Pint rule:

rule {
  match {
    kind = "recording"
    # I guess you can omit this
    name = "alert:[\\w\\-]+:[\\w\\-]+"
  }

  label "service" {
    severity = "bug"
    required = true
  }
}

Recording rule:

groups:
- name: has group but no local
  labels:
   some: random
  rules:
  - record: alert:http_success_rate:ratio_2m
    expr: sum by(job) (up == 1)

I think this MRE will be good enough.

@prymitive prymitive merged commit 1ac48eb into cloudflare:main Feb 2, 2026
17 checks passed
@QtRoS
Copy link
Contributor Author

QtRoS commented Feb 2, 2026

TY 🚀

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.

3 participants