sourcegraph/dev/buildchecker
Jean-Hadrien Chabran 252637fdd1
dev: remove deadlink from buildchecker (#59118)
* dev: remove deadlink from buildchecker

* dev: doc that buildchecker is a GHA
2023-12-20 09:50:07 +00:00
..
testdata/TestRepoBranchLocker Update marketing website link in monorepo (#58449) 2023-12-01 22:22:34 +00:00
branch_test.go buildchecker: update lock/unlock api for buildchecker (#57581) 2023-10-13 11:01:33 +02:00
branch.go buildchecker: update lock/unlock api for buildchecker (#57581) 2023-10-13 11:01:33 +02:00
BUILD.bazel Cleanup: replace a few custom functions with pointers.DerefZero (#58619) 2023-11-28 17:33:18 -07:00
checker_test.go fix(buildchecker): do not consider cron builds (#38152) 2022-07-04 17:01:15 +02:00
checker.go Cleanup: use new go 1.21 features (#58617) 2023-11-28 13:49:38 -07:00
failures_test.go buildchecker: return first N builds in series of failures (#29930) 2022-01-19 20:34:39 +00:00
failures.go Cleanup: replace a few custom functions with pointers.DerefZero (#58619) 2023-11-28 17:33:18 -07:00
history_test.go dev/buildchecker: add ability to export history to honeycomb (#31360) 2022-02-24 14:50:35 -08:00
history.go dev/buildchecker: add ability to export history to honeycomb (#31360) 2022-02-24 14:50:35 -08:00
main.go [chore] Use consistent go-github versioning (#57391) 2023-10-06 10:48:18 +02:00
OWNERS chore: links/ownership devx->dev-infra (#58999) 2023-12-14 15:07:20 +00:00
README.md dev: remove deadlink from buildchecker (#59118) 2023-12-20 09:50:07 +00:00
report.go remove okayhq usage in buildchecker (#50107) 2023-03-30 14:53:20 +02:00
run-check.sh buildchecker: require explicit 'check', add discussion channel (#29934) 2022-01-19 11:22:08 -08:00
run-week-history.sh dev/buildchecker: unify reporting runs, remove top-level slack token requirement (#38020) 2022-06-30 14:04:38 -07:00
slack_test.go dev: remove deadlink from buildchecker (#59118) 2023-12-20 09:50:07 +00:00
slack.go dev: remove deadlink from buildchecker (#59118) 2023-12-20 09:50:07 +00:00

buildchecker buildchecker

buildchecker is designed to respond to periods of consecutive build failures on a Buildkite pipeline. Owned by the DevInfra team.

More documentation for Sourcegraph teammates is available in theCI incidents playbook.

Buildchecker is deployed as a GitHub Action.

Usage

Available commands:

Check

Checks for a series of build failures that exceed the configured threshold, locks the target branch, and posts various updates to Slack.

go run ./dev/buildchecker/ check # directly
./dev/buildchecker/run-check.sh  # using wrapper script

Also see the buildchecker GitHub Action workflow where buildchecker check is run on an automated basis.

History

Writes aggregated historical data, including the builds it finds, to a few files.

go run ./dev/buildchecker \
  -buildkite.token=$BUILDKITE_TOKEN \
  -builds.write-to=".tmp/builds.json" \
  -csv.write-to=".tmp/" \
  -failures.timeout=999 \
  -created.from="2021-08-01" \
  history

To load builds from a file instead of fetching from Buildkite, use -builds.load-from="$FILE".

You can also send metrics to Honeycomb with -honeycomb.dataset and -honeycomb.token:

go run ./dev/buildchecker \
  -builds.load-from=".tmp/builds.json" \
  -failures.timeout=999 \
  -created.from="2021-08-01" \
  -honeycomb.dataset="buildkite-history" \
  -honeycomb.token=$HONEYCOMB_TOKEN \
  history

Tokens

Buildkite API token

Required for all buildchecker commands, except for buildchecker history -load-from.

  1. Go over your personal settings
  2. Create a new token with the following permissions:
  • check sourcegraph organization
  • read_builds
  • read_pipelines

Development

  • branch_test.go contains integration tests against the GitHub API. Normally runs against recordings in testdata - to update testdata, run the tests with the -update flag.
  • All other tests are strictly unit tests.