sourcegraph/dev/build-tracker
Vincent b3ba5ec9b4
Use new base image with curl from edge/main (#48144)
Use latest `curl` in our base-images
2023-02-23 19:40:07 +00:00
..
.gitignore feat(build-tracker): Adds a build-tracking service to provide better notifications about build failures (#39355) 2022-08-02 17:25:39 +00:00
build_test.go build-tracker: fix duplicate jobs being printed for failures (#44472) 2022-11-16 16:52:44 +02:00
BUILD.bazel bazel: introduce build files for Go (#46770) 2023-01-23 14:00:01 +01:00
build.go build-tracker: cache teammates and add a fixed a section (#47498) 2023-02-14 15:13:27 +02:00
build.sh Remove the custom built gitserver using Microsoft fork of git (continued) (#46121) 2023-01-05 16:02:07 +01:00
Dockerfile Use new base image with curl from edge/main (#48144) 2023-02-23 19:40:07 +00:00
main.go build-tracker: cache teammates and add a fixed a section (#47498) 2023-02-14 15:13:27 +02:00
README.md build-tracker: better handling of large job failures (#44825) 2022-11-25 19:38:22 +02:00
server_test.go build-tracker: cache teammates and add a fixed a section (#47498) 2023-02-14 15:13:27 +02:00
slack_test.go Migrate to autogold/v2 (needed by Bazel) (#47891) 2023-02-21 10:37:13 +01:00
slack.go build-tracker: fix new var assignment in loop (#47765) 2023-02-17 12:43:33 +02:00
util.go Add debug endpoint to buildtracker to get builds (#40549) 2022-08-18 20:50:18 +02:00

BUILD TRACKER

Build Tracker is a server that listens for build events from Buildkite and stores them in memory and sends notifications about builds if they've failed.

The server currently listens for two events:

  • build.finished
  • job.finished

For each job.finished event that is received, the corresponding build is updated with the job that has finished. On receipt of a build.finished event, the server will determine if the build has failed by going through all the contained jobs of the build. If one or more jobs have indeed failed, a notification will be sent over slack.

Deployment infrastructure

Build Tracker is deployed in the Buildkite kubernetes cluster of the Sourcegraph CI project on GCP. For more information on the deployment see infrastructure

Build

Execute the build.sh script which will build the docker container and push it to correct GCP registry. Once the image has been pushed the pod needs to be restarted so that it can pick up the new image!

Test

To run the tests execute go test .

Notification testing

To test the notifications that get sent over slack you can pass the flag -RunIntegrationTest as part of your test invocation, with some required configuration:

export SLACK_TOKEN='my valid token'
export BUILDKITE_WEBHOOK_TOKEN='optional'
export GITHUB_TOKEN='optional'
go test . -RunIntegrationTest

You can enable Slack client debugging by exporting the following environment variable BUILD_TRACKER_SLACK_DEBUG=1