http response bitbucket /rest/api/1.0/projects/prometheus/repos/rules/commits/.*/pull-requests 200 {}
http start bitbucket 127.0.0.1:6274

mkdir testrepo
cd testrepo
exec git init --initial-branch=main .

cp ../src/v1.yml rules.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
cp ../src/v2.yml rules.yml
exec git commit -am 'v2'

env BITBUCKET_AUTH_TOKEN="12345"
exec pint -l debug --no-color ci
! stdout .
stderr 'timeout=1d'

-- src/v1.yml --
- alert: rule1
  expr: sum(foo) by(job) > 0

-- src/v2.yml --
- alert: rule1
  expr: sum(foo) by(job) > 0
- alert: rule2
  expr: sum(foo) by(job) > 0

-- src/.pint.hcl --
parser {
  relaxed = [".*"]
}
ci {
  baseBranch = "main"
}
repository {
  bitbucket {
    uri        = "http://127.0.0.1:6274"
    timeout    = "1d"
    project    = "prometheus"
    repository = "rules"
  }
}
