Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

fix(build-tracker): Failed back-compat doesn't count towards branch-locking quota#63911

Merged
BolajiOlajide merged 6 commits into
mainfrom
bo/build-tracker-acknowledge-backcompat-failures
Jul 25, 2024
Merged

fix(build-tracker): Failed back-compat doesn't count towards branch-locking quota#63911
BolajiOlajide merged 6 commits into
mainfrom
bo/build-tracker-acknowledge-backcompat-failures

Conversation

@BolajiOlajide

@BolajiOlajide BolajiOlajide commented Jul 18, 2024

Copy link
Copy Markdown
Contributor

Closes DINF-51

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

We instead do a walkthrough of all the jobs associated with a build to figure out 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

Changelog

@BolajiOlajide BolajiOlajide self-assigned this Jul 18, 2024
@cla-bot cla-bot Bot added the cla-signed label Jul 18, 2024
Comment thread dev/build-tracker/main.go
logger.Info("config loaded from environment", log.Object("config", log.String("SlackChannel", config.SlackChannel), log.Bool("Production", config.Production)))

bqWriter, err := contract.BigQuery.GetTableWriter(context.Background(), "agent_status")
bqWriter, err := contract.BigQuery.GetTableWriter(ctx, "agent_status")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be intentional, but I noticed we were creating a new context here instead of using the one from the service for getting the table writer for big query.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jac @bobheadxi whats the lifetime on the ctx passed to Initialize? Is this change safe?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that should be fine. The context passed to initialize is a context.Background()

Comment thread go.mod
github.com/aws/smithy-go v1.13.5
github.com/beevik/etree v1.3.0
github.com/buildkite/go-buildkite/v3 v3.0.1
github.com/buildkite/go-buildkite/v3 v3.11.0

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TriggeredFrom on builds wasn't available in the previous version of this library, which is why I had to update it.

@BolajiOlajide BolajiOlajide requested a review from a team July 18, 2024 13:41
@BolajiOlajide BolajiOlajide marked this pull request as ready for review July 18, 2024 14:11
@BolajiOlajide BolajiOlajide merged commit 20b858f into main Jul 25, 2024
@BolajiOlajide BolajiOlajide deleted the bo/build-tracker-acknowledge-backcompat-failures branch July 25, 2024 11:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants