Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions cmd/pint/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,15 @@ func actionCI(ctx context.Context, c *cli.Command) error {

timeout, _ := time.ParseDuration(meta.cfg.Repository.BitBucket.Timeout)
br := reporter.NewBitBucketReporter(
version,
meta.cfg.Repository.BitBucket.URI,
timeout,
token,
meta.cfg.Repository.BitBucket.Project,
meta.cfg.Repository.BitBucket.Repository,
meta.cfg.Repository.BitBucket.MaxComments,
c.Bool(showDupsFlag),
git.RunGit,
)
reps = append(reps, br)
reps = append(reps, reporter.NewCommentReporter(br, c.Bool(showDupsFlag)))
}

if meta.cfg.Repository != nil && meta.cfg.Repository.GitLab != nil {
Expand Down
65 changes: 0 additions & 65 deletions cmd/pint/tests/0031_ci_bitbucket.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
http response bitbucket /rest/insights/1.0/projects/prometheus/repos/rules/commits/.*/reports/pint 200 OK
http response bitbucket /rest/api/1.0/projects/prometheus/repos/rules/commits/.*/pull-requests 200 {}
http start bitbucket 127.0.0.1:6031

Expand Down Expand Up @@ -55,72 +54,8 @@ repository {
}

-- bitbucket.expected --
DELETE /rest/insights/1.0/projects/prometheus/repos/rules/commits/.*/reports/pint
Accept-Encoding: gzip
Authorization: Bearer "12345"
Content-Type: application/json

PUT /rest/insights/1.0/projects/prometheus/repos/rules/commits/.*/reports/pint
Accept-Encoding: gzip
Authorization: Bearer "12345"
Content-Type: application/json
--- BODY ---
reporter: Prometheus rule linter
title: pint unknown
result: PASS
details: |-
pint is a Prometheus rule linter/validator.
It will inspect all Prometheus recording and alerting rules for problems that could prevent these from working correctly.
Checks can be either offline (static checks using only rule definition) or online (validate rule against live Prometheus server).
link: https://cloudflare.github.io/pint/
data:
- value: 2
title: Number of rules parsed
type: NUMBER
- value: 2
title: Number of rules checked
type: NUMBER
- value: 2
title: Number of problems found
type: NUMBER
- value: 9
title: Number of offline checks
type: NUMBER
- value: 0
title: Number of online checks
type: NUMBER
- value: 0
title: Checks duration
type: DURATION
--- END ---

GET /rest/api/1.0/projects/prometheus/repos/rules/commits/.*/pull-requests
Accept-Encoding: gzip
Authorization: Bearer "12345"
Content-Type: application/json

DELETE /rest/insights/1.0/projects/prometheus/repos/rules/commits/.*/reports/pint
Accept-Encoding: gzip
Authorization: Bearer "12345"
Content-Type: application/json

POST /rest/insights/1.0/projects/prometheus/repos/rules/commits/.*/reports/pint
Accept-Encoding: gzip
Authorization: Bearer "12345"
Content-Type: application/json
--- BODY ---
annotations:
- path: rules.yml
message: "Problem reported on unmodified line 2, annotation moved here: alerts/comparison: always firing alert"
severity: LOW
type: CODE_SMELL
link: https://cloudflare.github.io/pint/checks/alerts/comparison.html
line: 3
- path: rules.yml
message: "alerts/for: redundant field with default value"
severity: LOW
type: CODE_SMELL
link: https://cloudflare.github.io/pint/checks/alerts/for.html
line: 3
--- END ---

45 changes: 0 additions & 45 deletions cmd/pint/tests/0068_skip_ci.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
http response bitbucket /rest/insights/1.0/projects/prometheus/repos/rules/commits/.*/reports/pint 200 OK
http response bitbucket /rest/api/1.0/projects/prometheus/repos/rules/commits/.*/pull-requests 200 {}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this?

http start bitbucket 127.0.0.1:6068

Expand Down Expand Up @@ -54,52 +53,8 @@ repository {
}

-- bitbucket.expected --
DELETE /rest/insights/1.0/projects/prometheus/repos/rules/commits/.*/reports/pint
Accept-Encoding: gzip
Authorization: Bearer "12345"
Content-Type: application/json

PUT /rest/insights/1.0/projects/prometheus/repos/rules/commits/.*/reports/pint
Accept-Encoding: gzip
Authorization: Bearer "12345"
Content-Type: application/json
--- BODY ---
reporter: Prometheus rule linter
title: pint unknown
result: PASS
details: |-
pint is a Prometheus rule linter/validator.
It will inspect all Prometheus recording and alerting rules for problems that could prevent these from working correctly.
Checks can be either offline (static checks using only rule definition) or online (validate rule against live Prometheus server).
link: https://cloudflare.github.io/pint/
data:
- value: 0
title: Number of rules parsed
type: NUMBER
- value: 0
title: Number of rules checked
type: NUMBER
- value: 0
title: Number of problems found
type: NUMBER
- value: 0
title: Number of offline checks
type: NUMBER
- value: 0
title: Number of online checks
type: NUMBER
- value: 0
title: Checks duration
type: DURATION
--- END ---

GET /rest/api/1.0/projects/prometheus/repos/rules/commits/.*/pull-requests
Accept-Encoding: gzip
Authorization: Bearer "12345"
Content-Type: application/json

DELETE /rest/insights/1.0/projects/prometheus/repos/rules/commits/.*/reports/pint
Accept-Encoding: gzip
Authorization: Bearer "12345"
Content-Type: application/json

89 changes: 0 additions & 89 deletions cmd/pint/tests/0069_bitbucket_unmodified.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
http response bitbucket /rest/insights/1.0/projects/prometheus/repos/rules/commits/.*/reports/pint 200 OK
http response bitbucket /rest/api/1.0/projects/prometheus/repos/rules/commits/.*/pull-requests 200 {}
http start bitbucket 127.0.0.1:6069

Expand Down Expand Up @@ -73,96 +72,8 @@ repository {
}

-- bitbucket.expected --
DELETE /rest/insights/1.0/projects/prometheus/repos/rules/commits/.*/reports/pint
Accept-Encoding: gzip
Authorization: Bearer "12345"
Content-Type: application/json

PUT /rest/insights/1.0/projects/prometheus/repos/rules/commits/.*/reports/pint
Accept-Encoding: gzip
Authorization: Bearer "12345"
Content-Type: application/json
--- BODY ---
reporter: Prometheus rule linter
title: pint unknown
result: PASS
details: |-
pint is a Prometheus rule linter/validator.
It will inspect all Prometheus recording and alerting rules for problems that could prevent these from working correctly.
Checks can be either offline (static checks using only rule definition) or online (validate rule against live Prometheus server).
link: https://cloudflare.github.io/pint/
data:
- value: 4
title: Number of rules parsed
type: NUMBER
- value: 4
title: Number of rules checked
type: NUMBER
- value: 6
title: Number of problems found
type: NUMBER
- value: 20
title: Number of offline checks
type: NUMBER
- value: 0
title: Number of online checks
type: NUMBER
- value: 0
title: Checks duration
type: DURATION
--- END ---

GET /rest/api/1.0/projects/prometheus/repos/rules/commits/.*/pull-requests
Accept-Encoding: gzip
Authorization: Bearer "12345"
Content-Type: application/json

DELETE /rest/insights/1.0/projects/prometheus/repos/rules/commits/.*/reports/pint
Accept-Encoding: gzip
Authorization: Bearer "12345"
Content-Type: application/json

POST /rest/insights/1.0/projects/prometheus/repos/rules/commits/.*/reports/pint
Accept-Encoding: gzip
Authorization: Bearer "12345"
Content-Type: application/json
--- BODY ---
annotations:
- path: rules.yml
message: "Problem reported on unmodified line 2, annotation moved here: alerts/comparison: always firing alert"
severity: LOW
type: CODE_SMELL
link: https://cloudflare.github.io/pint/checks/alerts/comparison.html
line: 1
- path: rules.yml
message: "Problem reported on unmodified line 2, annotation moved here: promql/regexp: redundant regexp"
severity: LOW
type: CODE_SMELL
link: https://cloudflare.github.io/pint/checks/promql/regexp.html
line: 1
- path: rules.yml
message: "alerts/for: redundant field with default value"
severity: LOW
type: CODE_SMELL
link: https://cloudflare.github.io/pint/checks/alerts/for.html
line: 3
- path: rules.yml
message: "Problem reported on unmodified line 5, annotation moved here: alerts/comparison: always firing alert"
severity: LOW
type: CODE_SMELL
link: https://cloudflare.github.io/pint/checks/alerts/comparison.html
line: 4
- path: rules.yml
message: "Problem reported on unmodified line 5, annotation moved here: promql/regexp: redundant regexp"
severity: LOW
type: CODE_SMELL
link: https://cloudflare.github.io/pint/checks/promql/regexp.html
line: 4
- path: rules.yml
message: "Problem reported on unmodified line 6, annotation moved here: alerts/for: redundant field with default value"
severity: LOW
type: CODE_SMELL
link: https://cloudflare.github.io/pint/checks/alerts/for.html
line: 4
--- END ---

59 changes: 0 additions & 59 deletions cmd/pint/tests/0070_bitbucket_strict.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
http response bitbucket /rest/insights/1.0/projects/prometheus/repos/rules/commits/.*/reports/pint 200 OK
http response bitbucket /rest/api/1.0/projects/prometheus/repos/rules/commits/.*/pull-requests 200 {}
http start bitbucket 127.0.0.1:6070

Expand Down Expand Up @@ -53,66 +52,8 @@ repository {
}

-- bitbucket.expected --
DELETE /rest/insights/1.0/projects/prometheus/repos/rules/commits/.*/reports/pint
Accept-Encoding: gzip
Authorization: Bearer "12345"
Content-Type: application/json

PUT /rest/insights/1.0/projects/prometheus/repos/rules/commits/.*/reports/pint
Accept-Encoding: gzip
Authorization: Bearer "12345"
Content-Type: application/json
--- BODY ---
reporter: Prometheus rule linter
title: pint unknown
result: FAIL
details: |-
pint is a Prometheus rule linter/validator.
It will inspect all Prometheus recording and alerting rules for problems that could prevent these from working correctly.
Checks can be either offline (static checks using only rule definition) or online (validate rule against live Prometheus server).
link: https://cloudflare.github.io/pint/
data:
- value: 1
title: Number of rules parsed
type: NUMBER
- value: 1
title: Number of rules checked
type: NUMBER
- value: 1
title: Number of problems found
type: NUMBER
- value: 1
title: Number of offline checks
type: NUMBER
- value: 0
title: Number of online checks
type: NUMBER
- value: 0
title: Checks duration
type: DURATION
--- END ---

GET /rest/api/1.0/projects/prometheus/repos/rules/commits/.*/pull-requests
Accept-Encoding: gzip
Authorization: Bearer "12345"
Content-Type: application/json

DELETE /rest/insights/1.0/projects/prometheus/repos/rules/commits/.*/reports/pint
Accept-Encoding: gzip
Authorization: Bearer "12345"
Content-Type: application/json

POST /rest/insights/1.0/projects/prometheus/repos/rules/commits/.*/reports/pint
Accept-Encoding: gzip
Authorization: Bearer "12345"
Content-Type: application/json
--- BODY ---
annotations:
- path: rules.yml
message: "Problem reported on unmodified line 1, annotation moved here: yaml/parse: top level field must be a groups key, got list"
severity: HIGH
type: BUG
link: https://cloudflare.github.io/pint/checks/yaml/parse.html
line: 3
--- END ---

Loading
Loading