sourcegraph/dev/sg
Bolaji Olajide 20b858f6c3
fix(build-tracker): Failed back-compat doesn't count towards branch-locking quota (#63911)
Closes
[DINF-51](https://linear.app/sourcegraph/issue/DINF-51/failed-back-compat-doesnt-count-towards-branch-locking-quota)

## Context

If a back-compat step on main fails, the build is marked as having
failed. However, we don't treat that as a failure in build-tracker,
resulting in no #buildkite-main post and not counting towards failed
build quota for locking main.

The reason why this was happening is that the Backcompat build wasn't
linked to the main Sourcegraph build in anyway. However, when a
backcompat fails the main build reflects the status of this failure, but
we do not use this field when determining the status of a build, so it
doesn't work for our use case.

![CleanShot 2024-07-18 at 15 04
15@2x](https://github.com/user-attachments/assets/9553330a-ad98-45cc-b4ce-03a22ca1b99d)

We [instead do a walkthrough of all the jobs associated with a build to
figure
out](https://sourcegraph.sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/dev/build-tracker/main.go?L349-372)
if the build has failed, fixed or is passing.

With this logic, it means we have to link the steps from child builds
that a particular build triggers to it's parent.

## Test plan

* Create a build that'll have backcompat failing
* The build tracker event associated with the main build will be
reported with a state of failed to buildkite.

![CleanShot 2024-07-18 at 15 10
45@2x](https://github.com/user-attachments/assets/1bf503ab-0020-47bf-9512-b3a9ee5d4e36)


## Changelog

<!-- OPTIONAL; info at
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c
-->
2024-07-25 06:45:09 -05:00
..
buf lib/enterpriseportal: initial service API for RFC 885 (#62263) 2024-05-15 12:58:55 -07:00
ci feat(sg: add list-build subcommand to ci (#63071) 2024-06-04 13:41:44 +02:00
cloudsqlproxy feat/sg/msp: helpful error on cloudsqlproxy port conflict (#63830) 2024-07-15 11:32:37 -07:00
dependencies feat(ci): Adds playwright tests for sveltekit to bazel (#62560) 2024-06-06 12:45:05 -06:00
enterprise feat/sg: allow sg commands to default to local-dev SAMS-dev credentials (#63883) 2024-07-19 11:25:26 -07:00
internal fix(build-tracker): Failed back-compat doesn't count towards branch-locking quota (#63911) 2024-07-25 06:45:09 -05:00
interrupt fix(sg): reduce max interrupt count and os.Exit always (#63516) 2024-06-28 10:27:02 +02:00
linters enterprise-portal: implement basic MSP IAM and RPCs (#63173) 2024-06-19 21:46:48 -04:00
msp feat/sg/msp: helpful error on cloudsqlproxy port conflict (#63830) 2024-07-15 11:32:37 -07:00
root sg gen / bazel: port generation of reference from go to bazel (#55256) 2023-07-25 12:59:39 +00:00
sams feat/sg: add 'sg sams client create' (#63885) 2024-07-19 13:41:28 -07:00
.gitignore
analytics.go feat(sg): sqlite-backed local store for sg analytics (#63578) 2024-07-09 12:47:49 +02:00
bootstrap.sh sg: pass parameters from bootstrap.sh (#43628) 2022-10-31 11:13:37 +02:00
BUILD.bazel chore/sg: remove 'sg telemetry' and related docs (#63763) 2024-07-10 17:25:04 -07:00
checks.go [sg] Watch config files (#61669) 2024-04-22 09:32:21 -07:00
Dockerfile ci: enable bazel builds for docker images (#51241) 2023-04-28 10:41:13 +02:00
generates.go sg gen buf: fix completions (#62555) 2024-05-08 10:58:55 -07:00
live.go sg: fix live command after ci build version update (#48116) 2023-02-23 14:50:47 +00:00
main_test.go chore/sg: clean up help formatting (#63860) 2024-07-16 12:01:06 -07:00
main.go fix(sg): do not try to publish analytics when it is disabled (#63800) 2024-07-12 12:45:08 +02:00
os.go dev/sg: remove globalConf, extract Config into sgconf (#33882) 2022-04-14 09:01:54 -07:00
OWNERS chore: links/ownership devx->dev-infra (#58999) 2023-12-14 15:07:20 +00:00
README.md fix: update links for dev docs (#62758) 2024-05-17 13:47:34 +02:00
sg_audit.go fix: update links for dev docs (#62758) 2024-05-17 13:47:34 +02:00
sg_backport.go chore/sg: clean up help formatting (#63860) 2024-07-16 12:01:06 -07:00
sg_bazel.go fix(sg): conditionally show protips (#63541) 2024-06-28 12:11:07 +02:00
sg_cloud.go sg: cloud - move all cloud ephemeral commands to a sub command ephemeral (#62569) 2024-05-15 15:10:15 +02:00
sg_cody_gateway.go feat(sg): add command to generate a dotcom user gateway access token (#63125) 2024-06-07 10:40:51 +00:00
sg_db.go chore(local): simplify 'sg db' inline help (#63344) 2024-06-19 14:56:13 +00:00
sg_deploy.go sg msp: initial prototype (#55905) 2023-09-07 17:24:34 -07:00
sg_doctor.go sg-binary-release: stamp with GitHub release name (#62176) 2024-04-25 08:10:55 -07:00
sg_embeddings_qa.go bazel: add no-localhost-guard lint to nogo (#59144) 2023-12-21 16:30:33 +00:00
sg_generate.go sg: improve positional completions (#58569) 2023-11-27 16:30:59 -08:00
sg_help.go sg msp: initial prototype (#55905) 2023-09-07 17:24:34 -07:00
sg_images_test.go feat(sg): add images [list|build] command (#62030) 2024-04-19 11:41:41 +00:00
sg_images.go chore/sg: clean up help formatting (#63860) 2024-07-16 12:01:06 -07:00
sg_insights.go logger: update log lib and remove use of description (#57690) 2023-10-18 17:29:08 +02:00
sg_install.go sg msp: initial prototype (#55905) 2023-09-07 17:24:34 -07:00
sg_lint.go Fix minor 'sg lint --help' issue(?) (#62308) 2024-04-30 21:49:48 +00:00
sg_live.go sg: improve positional completions (#58569) 2023-11-27 16:30:59 -08:00
sg_logo.go Replace all traditional for-loops (#60988) 2024-03-11 16:05:47 +02:00
sg_migration.go logger: update log lib and remove use of description (#57690) 2023-10-18 17:29:08 +02:00
sg_monitoring.go fix: update links for dev docs (#62758) 2024-05-17 13:47:34 +02:00
sg_ops.go sg: detect and use dockerhub registry (#61592) 2024-04-04 14:25:29 +00:00
sg_page.go logger: update log lib and remove use of description (#57690) 2023-10-18 17:29:08 +02:00
sg_rfc.go [sg] Make rfc command use private RFCs by default (#63902) 2024-07-18 14:12:28 +02:00
sg_run.go chore/sg: clean up help formatting (#63860) 2024-07-16 12:01:06 -07:00
sg_secret.go chore(local): make sg handle empty secret file gracefully (#63614) 2024-07-03 14:14:38 +00:00
sg_security.go feat(sg/repoferee): add security command with repo-report subcommand to fetch latest repoferee report (#62735) 2024-05-16 19:21:13 +02:00
sg_setup.go remove more remannts of OSS build (#58253) 2023-11-10 07:59:03 +00:00
sg_src.go misc fixes to text and error message copy (#58543) 2023-11-23 22:52:42 -08:00
sg_start_test.go fix(local): fix race in sg_start_test.go (#63642) 2024-07-04 19:11:10 +02:00
sg_start.go feat/sg: support correct completions on 'sg start -cmd' (#63861) 2024-07-16 12:11:11 -07:00
sg_teammate.go chore(local): simplify sg teammate (#63667) 2024-07-09 10:29:37 +02:00
sg_tests.go SG Docker Commands (#61140) 2024-03-14 21:19:47 +00:00
sg_update.go feat(sg): sqlite-backed local store for sg analytics (#63578) 2024-07-09 12:47:49 +02:00
sg_version.go sg-binary-release: stamp with GitHub release name (#62176) 2024-04-25 08:10:55 -07:00
sg_wolfi.go Build images end-to-end using Bazel v2 (#61845) 2024-04-12 16:18:43 +01:00
sg.config.example.yaml remove more remannts of OSS build (#58253) 2023-11-10 07:59:03 +00:00
sg.doctor.yaml sg: embed sg.doctor.yaml and make output stable (#60964) 2024-03-08 20:00:04 +02:00
VISION.md fix: update links for dev docs (#62758) 2024-05-17 13:47:34 +02:00

sg - the Sourcegraph developer tool

          _____                    _____
         /\    \                  /\    \
        /::\    \                /::\    \
       /::::\    \              /::::\    \
      /::::::\    \            /::::::\    \
     /:::/\:::\    \          /:::/\:::\    \
    /:::/__\:::\    \        /:::/  \:::\    \
    \:::\   \:::\    \      /:::/    \:::\    \
  ___\:::\   \:::\    \    /:::/    / \:::\    \
 /\   \:::\   \:::\    \  /:::/    /   \:::\ ___\
/::\   \:::\   \:::\____\/:::/____/  ___\:::|    |
\:::\   \:::\   \::/    /\:::\    \ /\  /:::|____|
 \:::\   \:::\   \/____/  \:::\    /::\ \::/    /
  \:::\   \:::\    \       \:::\   \:::\ \/____/
   \:::\   \:::\____\       \:::\   \:::\____\
    \:::\  /:::/    /        \:::\  /:::/    /
     \:::\/:::/    /          \:::\/:::/    /
      \::::::/    /            \::::::/    /
       \::::/    /              \::::/    /
        \::/    /                \::/____/
         \/____/

sg is the CLI tool that Sourcegraph developers can use to develop Sourcegraph. Learn more about it here.