Skip to content

Commit 92ea8bf

Browse files
authored
Merge pull request #1333 from cloudflare/vals
Remove value from reports
2 parents e869de2 + eb26b05 commit 92ea8bf

File tree

7 files changed

+26
-26
lines changed

7 files changed

+26
-26
lines changed

cmd/pint/tests/0007_alerts.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ Bug: required annotation not set (alerts/annotation)
3838
Warning: invalid label value (rule/label)
3939
---> rules/0001.yml:14
4040
14 | severity: bad
41-
^^^ `severity` label value `bad` must match `^critical|warning|info$`.
41+
^^^ `severity` label value must match `^critical|warning|info$`.
4242

4343
Bug: invalid annotation value (alerts/annotation)
4444
---> rules/0001.yml:16
4545
16 | url: bad
46-
^^^ `url` annotation value `bad` must match `^https://wiki.example.com/page/(.+).html$`.
46+
^^^ `url` annotation value must match `^https://wiki.example.com/page/(.+).html$`.
4747

4848
Fatal: template syntax error (alerts/template)
4949
---> rules/0002.yml:5

cmd/pint/tests/0058_templated_check.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Bug: required annotation not set (alerts/annotation)
1616
Bug: invalid annotation value (alerts/annotation)
1717
---> rules/0001.yml:12
1818
12 | alert_for: 4m
19-
^^ `alert_for` annotation value `4m` must match `^{{ $for }}$`.
19+
^^ `alert_for` annotation value must match `^{{ $for }}$`.
2020

2121
level=INFO msg="Problems found" Bug=2
2222
level=ERROR msg="Execution completed with error(s)" err="found 1 problem(s) with severity Bug or higher"

cmd/pint/tests/0137_annotation_regex_key_fail.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ level=INFO msg="Checking Prometheus rules" entries=1 workers=10 online=true
99
Bug: invalid annotation value (alerts/annotation)
1010
---> rules/0001.yml:4
1111
4 | annotation_foo: foo
12-
^^^ `annotation_.*` annotation value `foo` must match `^bar$`.
12+
^^^ `annotation_.*` annotation value must match `^bar$`.
1313

1414
level=INFO msg="Problems found" Bug=1
1515
level=ERROR msg="Execution completed with error(s)" err="found 1 problem(s) with severity Bug or higher"

internal/checks/alerts_annotation.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func (c AnnotationCheck) checkValue(rule parser.Rule, value string, ann *parser.
145145
Severity: c.severity,
146146
Diagnostics: []diags.Diagnostic{
147147
{
148-
Message: fmt.Sprintf("`%s` annotation value `%s` must match `%s`.", c.keyRe.original, value, c.valueRe.anchored),
148+
Message: fmt.Sprintf("`%s` annotation value must match `%s`.", c.keyRe.original, c.valueRe.anchored),
149149
Pos: ann.Pos,
150150
FirstColumn: 1,
151151
LastColumn: len(ann.Value),
@@ -182,7 +182,7 @@ func (c AnnotationCheck) checkValue(rule parser.Rule, value string, ann *parser.
182182
Severity: c.severity,
183183
Diagnostics: []diags.Diagnostic{
184184
{
185-
Message: fmt.Sprintf("`%s` annotation value `%s` is not one of valid values.", c.keyRe.original, value),
185+
Message: fmt.Sprintf("`%s` annotation value is not one of valid values.", c.keyRe.original),
186186
Pos: ann.Pos,
187187
FirstColumn: 1,
188188
LastColumn: len(ann.Value),

internal/checks/alerts_annotation_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ func TestAnnotationCheck(t *testing.T) {
147147
Severity: checks.Warning,
148148
Diagnostics: []diags.Diagnostic{
149149
{
150-
Message: "`severity` annotation value `bar` must match `^critical$`.",
150+
Message: "`severity` annotation value must match `^critical$`.",
151151
},
152152
},
153153
},
@@ -169,7 +169,7 @@ func TestAnnotationCheck(t *testing.T) {
169169
Severity: checks.Warning,
170170
Diagnostics: []diags.Diagnostic{
171171
{
172-
Message: "`severity` annotation value `bar` must match `^critical$`.",
172+
Message: "`severity` annotation value must match `^critical$`.",
173173
},
174174
},
175175
},
@@ -218,7 +218,7 @@ func TestAnnotationCheck(t *testing.T) {
218218
Severity: checks.Bug,
219219
Diagnostics: []diags.Diagnostic{
220220
{
221-
Message: "`for` annotation value `4m` must match `^{{ $for }}$`.",
221+
Message: "`for` annotation value must match `^{{ $for }}$`.",
222222
},
223223
},
224224
},
@@ -258,7 +258,7 @@ func TestAnnotationCheck(t *testing.T) {
258258
Severity: checks.Warning,
259259
Diagnostics: []diags.Diagnostic{
260260
{
261-
Message: "`annotation_.*` annotation value `bar` must match `^critical$`.",
261+
Message: "`annotation_.*` annotation value must match `^critical$`.",
262262
},
263263
},
264264
},
@@ -280,7 +280,7 @@ func TestAnnotationCheck(t *testing.T) {
280280
Severity: checks.Warning,
281281
Diagnostics: []diags.Diagnostic{
282282
{
283-
Message: "`annotation_.*` annotation value `bar` must match `^critical$`.",
283+
Message: "`annotation_.*` annotation value must match `^critical$`.",
284284
},
285285
},
286286
},
@@ -303,7 +303,7 @@ func TestAnnotationCheck(t *testing.T) {
303303
Severity: checks.Bug,
304304
Diagnostics: []diags.Diagnostic{
305305
{
306-
Message: "`components` annotation value `db` must match `^api|memcached$`.",
306+
Message: "`components` annotation value must match `^api|memcached$`.",
307307
},
308308
},
309309
},
@@ -334,7 +334,7 @@ func TestAnnotationCheck(t *testing.T) {
334334
Severity: checks.Bug,
335335
Diagnostics: []diags.Diagnostic{
336336
{
337-
Message: "`components` annotation value `db` is not one of valid values.",
337+
Message: "`components` annotation value is not one of valid values.",
338338
},
339339
},
340340
},

internal/checks/rule_label.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ func (c LabelCheck) checkValue(rule parser.Rule, value string, lab *parser.YamlN
205205
Severity: c.severity,
206206
Diagnostics: []diags.Diagnostic{
207207
{
208-
Message: fmt.Sprintf("`%s` label value `%s` must match `%s`.", c.keyRe.original, value, c.valueRe.anchored),
208+
Message: fmt.Sprintf("`%s` label value must match `%s`.", c.keyRe.original, c.valueRe.anchored),
209209
Pos: lab.Pos,
210210
FirstColumn: 1,
211211
LastColumn: len(lab.Value),
@@ -242,7 +242,7 @@ func (c LabelCheck) checkValue(rule parser.Rule, value string, lab *parser.YamlN
242242
Severity: c.severity,
243243
Diagnostics: []diags.Diagnostic{
244244
{
245-
Message: fmt.Sprintf("`%s` label value `%s` is not one of valid values.", c.keyRe.original, value),
245+
Message: fmt.Sprintf("`%s` label value is not one of valid values.", c.keyRe.original),
246246
Pos: lab.Pos,
247247
FirstColumn: 1,
248248
LastColumn: len(lab.Value),

internal/checks/rule_label_test.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ func TestLabelCheck(t *testing.T) {
147147
Severity: checks.Warning,
148148
Diagnostics: []diags.Diagnostic{
149149
{
150-
Message: "`severity` label value `warning` must match `^critical$`.",
150+
Message: "`severity` label value must match `^critical$`.",
151151
},
152152
},
153153
},
@@ -169,7 +169,7 @@ func TestLabelCheck(t *testing.T) {
169169
Severity: checks.Warning,
170170
Diagnostics: []diags.Diagnostic{
171171
{
172-
Message: "`severity` label value `warning` must match `^critical$`.",
172+
Message: "`severity` label value must match `^critical$`.",
173173
},
174174
},
175175
},
@@ -200,7 +200,7 @@ func TestLabelCheck(t *testing.T) {
200200
Severity: checks.Warning,
201201
Diagnostics: []diags.Diagnostic{
202202
{
203-
Message: "`priority` label value `2a` must match `^(1|2|3)$`.",
203+
Message: "`priority` label value must match `^(1|2|3)$`.",
204204
},
205205
},
206206
},
@@ -230,7 +230,7 @@ func TestLabelCheck(t *testing.T) {
230230
Severity: checks.Warning,
231231
Diagnostics: []diags.Diagnostic{
232232
{
233-
Message: "`priority` label value `2a` must match `^(1|2|3)$`.",
233+
Message: "`priority` label value must match `^(1|2|3)$`.",
234234
},
235235
},
236236
},
@@ -343,7 +343,7 @@ func TestLabelCheck(t *testing.T) {
343343
Severity: checks.Warning,
344344
Diagnostics: []diags.Diagnostic{
345345
{
346-
Message: "`severity` label value `warning` must match `^critical|info$`.",
346+
Message: "`severity` label value must match `^critical|info$`.",
347347
},
348348
},
349349
},
@@ -365,7 +365,7 @@ func TestLabelCheck(t *testing.T) {
365365
Severity: checks.Warning,
366366
Diagnostics: []diags.Diagnostic{
367367
{
368-
Message: "`severity` label value `warning` must match `^critical|info$`.",
368+
Message: "`severity` label value must match `^critical|info$`.",
369369
},
370370
},
371371
},
@@ -432,7 +432,7 @@ func TestLabelCheck(t *testing.T) {
432432
Severity: checks.Warning,
433433
Diagnostics: []diags.Diagnostic{
434434
{
435-
Message: "`for` label value `must wait 5m to fire` must match `^must wait {{$for}} to fire$`.",
435+
Message: "`for` label value must match `^must wait {{$for}} to fire$`.",
436436
},
437437
},
438438
},
@@ -454,7 +454,7 @@ func TestLabelCheck(t *testing.T) {
454454
Severity: checks.Bug,
455455
Diagnostics: []diags.Diagnostic{
456456
{
457-
Message: "`components` label value `db` must match `^api|memcached$`.",
457+
Message: "`components` label value must match `^api|memcached$`.",
458458
},
459459
},
460460
},
@@ -485,7 +485,7 @@ func TestLabelCheck(t *testing.T) {
485485
Severity: checks.Bug,
486486
Diagnostics: []diags.Diagnostic{
487487
{
488-
Message: "`components` label value `db` is not one of valid values.",
488+
Message: "`components` label value is not one of valid values.",
489489
},
490490
},
491491
},
@@ -507,7 +507,7 @@ func TestLabelCheck(t *testing.T) {
507507
Severity: checks.Bug,
508508
Diagnostics: []diags.Diagnostic{
509509
{
510-
Message: "`components` label value `db` must match `^api|memcached$`.",
510+
Message: "`components` label value must match `^api|memcached$`.",
511511
},
512512
},
513513
},
@@ -538,7 +538,7 @@ func TestLabelCheck(t *testing.T) {
538538
Severity: checks.Warning,
539539
Diagnostics: []diags.Diagnostic{
540540
{
541-
Message: "`components` label value `db` is not one of valid values.",
541+
Message: "`components` label value is not one of valid values.",
542542
},
543543
},
544544
},

0 commit comments

Comments
 (0)