-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #939 from cloudflare/blame
Better git blame handling
- Loading branch information
Showing
56 changed files
with
1,367 additions
and
593 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
http response prometheus /api/v1/status/flags 200 {"status":"success","data":{"storage.tsdb.retention.time": "1d"}} | ||
http response prometheus /api/v1/metadata 200 {"status":"success","data":{}} | ||
http response prometheus /api/v1/status/config 200 {"status":"success","data":{"yaml":"global:\n scrape_interval: 1m\n"}} | ||
http response prometheus /api/v1/query_range 200 {"status":"success","data":{"resultType":"matrix","result":[]}} | ||
http response prometheus /api/v1/query 200 {"status":"success","data":{"resultType":"vector","result":[]}} | ||
http start prometheus 127.0.0.1:7171 | ||
|
||
mkdir testrepo | ||
cd testrepo | ||
exec git init --initial-branch=main . | ||
|
||
cp ../src/.pint.hcl . | ||
cp ../src/v1.yaml rules.yaml | ||
env GIT_AUTHOR_NAME=pint | ||
env GIT_AUTHOR_EMAIL=pint@example.com | ||
env GIT_COMMITTER_NAME=pint | ||
env GIT_COMMITTER_EMAIL=pint@example.com | ||
exec git add . | ||
exec git commit -am 'import rules and config' | ||
|
||
exec git checkout -b pr | ||
|
||
cp ../src/v2.yaml rules.yaml | ||
exec git commit -am 'v2' | ||
|
||
exec git mv rules.yaml renamed.yaml | ||
exec git commit -am 'v3' | ||
|
||
pint.error --no-color ci | ||
! stdout . | ||
cmp stderr ../stderr.txt | ||
|
||
-- stderr.txt -- | ||
level=INFO msg="Loading configuration file" path=.pint.hcl | ||
level=INFO msg="Finding all rules to check on current git branch" base=main | ||
level=INFO msg="Configured new Prometheus server" name=prom uris=1 uptime=up tags=[] include=["^.*.yaml$"] exclude=[] | ||
level=WARN msg="No results for Prometheus uptime metric, you might have set uptime config option to a missing metric, please check your config" name=prom metric=up | ||
level=WARN msg="Using dummy Prometheus uptime metric results with no gaps" name=prom metric=up | ||
level=INFO msg="Problems found" Bug=1 | ||
renamed.yaml:2 Bug: `prom` Prometheus server at http://127.0.0.1:7171 didn't have any series for `foo` metric in the last 1w. (promql/series) | ||
2 | expr: sum(foo) | ||
|
||
level=ERROR msg="Fatal error" err="problems found" | ||
-- src/v1.yaml -- | ||
- record: rule1 | ||
# pint disable promql/series | ||
expr: sum(foo) | ||
-- src/v2.yaml -- | ||
- record: rule1 | ||
expr: sum(foo) | ||
-- src/.pint.hcl -- | ||
ci { | ||
baseBranch = "main" | ||
} | ||
parser { | ||
relaxed = [".*"] | ||
} | ||
prometheus "prom" { | ||
uri = "http://127.0.0.1:7171" | ||
failover = [] | ||
timeout = "5s" | ||
required = true | ||
include = [".*.yaml"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
mkdir testrepo | ||
cd testrepo | ||
exec git init --initial-branch=main . | ||
|
||
mkdir rules1 rules2 | ||
cp ../src/alert.yml rules1/alert.yml | ||
cp ../src/record.yml rules1/record.yml | ||
exec ln -s ../rules1/alert.yml rules2/alert.yml | ||
exec ln -s ../rules1/record.yml rules2/record.yml | ||
cp ../src/.pint.hcl . | ||
env GIT_AUTHOR_NAME=pint | ||
env GIT_AUTHOR_EMAIL=pint@example.com | ||
env GIT_COMMITTER_NAME=pint | ||
env GIT_COMMITTER_EMAIL=pint@example.com | ||
exec git add . | ||
exec git commit -am 'import rules and config' | ||
|
||
exec git checkout -b v2 | ||
exec git rm -fr rules2 | ||
exec git commit -am 'v2' | ||
|
||
pint.ok -l error --offline --no-color ci | ||
! stdout . | ||
cmp stderr ../stderr.txt | ||
|
||
-- stderr.txt -- | ||
-- src/alert.yml -- | ||
groups: | ||
- name: g1 | ||
rules: | ||
- alert: Alert | ||
expr: 'up:sum == 0' | ||
annotations: | ||
summary: 'Service is down' | ||
-- src/record.yml -- | ||
groups: | ||
- name: g1 | ||
rules: | ||
- record: up:sum | ||
expr: sum(up) | ||
-- src/.pint.hcl -- | ||
ci { | ||
baseBranch = "main" | ||
} | ||
prometheus "prom1" { | ||
uri = "http://127.0.0.1:7172/1" | ||
timeout = "5s" | ||
required = true | ||
include = ["rules1/.*"] | ||
} | ||
prometheus "prom2" { | ||
uri = "http://127.0.0.1:7172/2" | ||
timeout = "5s" | ||
required = true | ||
include = ["rules2/.*"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.