Repository navigation
fix(buildkite): handle null build metadata without panicking - #834
Open
Tmwakalasya wants to merge 5 commits into
Open
Tmwakalasya wants to merge 5 commits into
Tmwakalasya wants to merge 5 commits into
Conversation
Tmwakalasya
requested review from
a team,
behinddwalls and
sbalabanov
as code owners
October 11, 2026 03:54
behinddwalls
approved these changes
Oct 16, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why?
A Buildkite response containing JSON
nullin the metadata environment variable makesDecodeMetadataEnvreturn a nil map without an error. Both the SubmitQueue and Stovepipe runners then panic whenStatusadds the build URL to that map.This is a defensive response-handling fix: the normal Trigger path omits absent metadata rather than generating
null.What?
Normalize a successfully decoded nil map to an empty, writable map in the shared decoder. Preserve the existing decode-error behavior and document the successful-return contract.
Expand the empty-metadata test to cover absent metadata, an empty string, an empty object, JSON null, and null surrounded by whitespace. Each successful result must support adding metadata. Existing populated-map and malformed-JSON coverage remains in place.
Test Plan
./tool/bazel test //platform/buildkite:go_default_test //submitqueue/extension/buildrunner/buildkite:go_default_test //stovepipe/extension/buildrunner/buildkite:go_default_test --test_output=errors.go vet -mod=readonly ./platform/buildkite ./submitqueue/extension/buildrunner/buildkite ./stovepipe/extension/buildrunner/buildkite.make fmt lint check-tidy check-gazelleandgit diff --cached --check.Issue
No linked issue. Found while tracing Buildkite metadata decoding and status polling.