cloudflare / pint

Prometheus rule linter/validator
https://cloudflare.github.io/pint/
Apache License 2.0
857 stars 52 forks source link

github reporter ci mode failure #1120

Open dennybaa opened 2 days ago

dennybaa commented 2 days ago

When comments are present in YAML pint prepares reporter somehow:

appsops/iaas/monitoring/rules/source/vmcluster.yaml:1 Fatal: YAML parser returned an error when reading this file: `error at line 12: invalid group key concurrency`. (yaml/parse)
 1 | # ref: https://raw.githubusercontent.com/VictoriaMetrics/VictoriaMetrics/master/deployment/docker/alerts-cluster.yml****

This this fails:

 level=ERROR msg="Failed to create a new comment" reporter=GitHub path=appsops/iaas/monitoring/rules/source/vmcluster.yaml line=1 err="POST https://api.github.com/repos/p2p-org/iaas-platform/pulls/167/comments: 422 Validation Failed [{Resource:PullRequestReviewComment Field:pull_request_review_thread.line Code:custom Message:pull_request_review_thread.line must be part of the diff} {Resource:PullRequestReviewComment Field:pull_request_review_thread.diff_hunk Code:missing_field Message:}]"
level=ERROR msg="Execution completed with error(s)" err="submitting reports: POST https://api.github.com/repos/p2p-org/iaas-platform/pulls/167/comments: 422 Validation Failed [{Resource:PullRequestReviewComment Field:pull_request_review_thread.line Code:custom Message:pull_request_review_thread.line must be part of the diff} {Resource:PullRequestReviewComment Field:pull_request_review_thread.diff_hunk Code:missing_field Message:}]"

removing comments solves the comment issue. Also could we have ignoring keys configurable such as groups[].labels or groups[].concurency ?

dennybaa commented 2 days ago

image