Skip to content

Pint failing to check indent issue with Github CI  #835

@AmandeepSaxena

Description

@AmandeepSaxena

We are using pint with github ci to check rules, following this the rule for which check ran:

- name: GO Routines alert
          interval: 1m
          rules:
            - alert: Increase in the number of go routines for Mozart
              expr: sum(increase(go_goroutines{k8s_pod=~"go-[a-zA-Z0-9]+-[a-zA-Z0-9]+"})) > 2000
              for: 5m
              labels:
                bu: payments
                pod: platforms
                service: go
                severity: critical
                live: "true"
                slack_channel: "#platforms_alerts"
              annotations:
                identifier: Increase in the number of go routines 
                description: Number of go routines on mozart "{{ $value }}"
                vajra_link: https://qs.razorpay.com/d/GRhQf8Vnk/mozart-dashboard?orgId=1&from=now-6h&to=now&viewPanel=63

following is the log of pipeline which ran this check

>>> GITHUB_WORKSPACE: /github/workspace
>>> Running steps for PR from trunk (not fork)
>>> BASE BRANCH: master
>>> PR BRANCH: AmandeepSaxena-patch-21
From https://github.com/razorpay/alert-rules
 * branch              master     -> FETCH_HEAD
Previous HEAD position was 5ac9f563 Merge 1a1d6f55f09ef159f1b5224b328be[7](https://github.com/razorpay/alert-rules/actions/runs/7271164954/job/19811360054?pr=7079#step:5:8)1602692f06 into 0[8](https://github.com/razorpay/alert-rules/actions/runs/7271164954/job/19811360054?pr=7079#step:5:9)5a8d70cc3d7287[9](https://github.com/razorpay/alert-rules/actions/runs/7271164954/job/19811360054?pr=7079#step:5:10)e28275e94f46896eead7025
Switched to a new branch 'master'
branch 'master' set up to track 'origin/master'.
From https://github.com/razorpay/alert-rules
 * branch              AmandeepSaxena-patch-21 -> FETCH_HEAD
Switched to a new branch 'AmandeepSaxena-patch-21'
branch 'AmandeepSaxena-patch-21' set up to track 'origin/AmandeepSaxena-patch-21'.
>>> Running: pint   ci --base-branch=master 
level=INFO msg="Loading configuration file" path=.pint.hcl
level=INFO msg="Finding all rules to check on current git branch" base=master
level=INFO msg="No rules found, skipping Prometheus discovery"
level=INFO msg="Setting GITHUB_PULL_REQUEST_NUMBER from GITHUB_REF env variable" pr=7079
level=INFO msg="Setting repository owner from GITHUB_REPOSITORY env variable" owner=razorpay
level=INFO msg="Setting repository name from GITHUB_REPOSITORY env variable" repo=alert-rules
level=INFO msg="Setting repository base URI from GITHUB_API_URL env variable" baseuri=https://api.github.com
level=INFO msg="Setting repository upload URI from GITHUB_API_URL env variable" uploaduri=https://api.github.com
level=INFO msg="Got HEAD commit from git" commit=1a1d6f55f09ef[15](https://github.com/razorpay/alert-rules/actions/runs/7271164954/job/19811360054?pr=7079#step:5:16)9f1b5224b328be7[16](https://github.com/razorpay/alert-rules/actions/runs/7271164954/job/19811360054?pr=7079#step:5:17)02692f06
level=INFO msg="Creating pull request review" repo=razorpay/alert-rules commit=1a1d6f55f09ef159f1b5224b328be71602692f06
level=INFO msg="Pull request review created" status="[20](https://github.com/razorpay/alert-rules/actions/runs/7271164954/job/19811360054?pr=7079#step:5:21)0 OK"
level=INFO msg="Creating review comments"

following is the config file .pint.hcl

rule {
  match {
    kind = "alerting"
  }
reject "(?i)^.*\\{\\{\\s\\$\\svalue\\s\\}\\}.*$" {
  severity          = "bug"
  annotation_keys   = true
  annotation_values = true
  #[ check applied only to alerting rules with annotations "description" field where: Value= {{ $value }} ]
}
}
#Path for ci
ci {
  include    = [ "rules/*" ]
} 

While running pint with same config file on my local system I am getting following error
./pint --config .pint.hcl lint rules.yaml

level=info msg="Loading configuration file" path=.pint.hcl
rules.yaml:14 Fatal: did not find expected key (yaml/parse)
 14 |           vajra_link: https://qs.razorpay.com/d/LZG3AQxmk/kubernetes-prod-blue?orgId=1&fullscreen&panelId=6

level=info msg="Problems found" Fatal=1
level=fatal msg="Execution completed with error(s)" error="found 1 problem(s) with severity Bug or higher"

Any idea why this is happening? I am unable to debug this issue.
on local system I am using following version
v0.43.1-10-g948facf (revision: 948facf)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions