Skip to content

Set BUILDBUDDY_RUN_ID env var#11584

Merged
tylerwilliams merged 1 commit intomasterfrom
parent_run_id
Mar 16, 2026
Merged

Set BUILDBUDDY_RUN_ID env var#11584
tylerwilliams merged 1 commit intomasterfrom
parent_run_id

Conversation

@tylerwilliams
Copy link
Member

@tylerwilliams tylerwilliams commented Mar 13, 2026

I think this should be set in the env so that non-bazel tools can pick it up and send it back via PARENT_RUN_ID metadata to show up as linked workflow child invocations. LMK if there's a better way / something I'm missing here?

@tylerwilliams tylerwilliams requested a review from bduffany March 13, 2026 05:48
Copy link
Member

@bduffany bduffany left a comment

Choose a reason for hiding this comment

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

I think you're looking for BUILDBUDDY_INVOCATION_ID which should already be set to the parent invocation ID? It gets set in the Action proto I think, at least for workflows. It doesn't look like we set it for remote bazel though.

Copy link
Member

@bduffany bduffany left a comment

Choose a reason for hiding this comment

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

ah nvm I guess we do need this because it's how we disambiguate child invocations in the case of retries. Maybe @maggie-lou can take another look at this though because I think she added that linkage originally

const (
BuildBuddyAPIKeyEnvVarName = "BUILDBUDDY_API_KEY"
BuildBuddyInvocationIDEnvVarName = "BUILDBUDDY_INVOCATION_ID"
BuildBuddyRunIDEnvVarName = "BUILDBUDDY_RUN_ID"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Rename to BUILDBUDDY_PARENT_RUN_ID?

Copy link
Member

@bduffany bduffany Mar 16, 2026

Choose a reason for hiding this comment

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

I think BUILDBUDDY_RUN_ID might be more consistent with the existing BUILDBUDDY_INVOCATION_ID ? since both are referring to the parent ci_runner run / invocation

Copy link
Member Author

Choose a reason for hiding this comment

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

That's what I was inspired by. Cool with either but I was trying to match what we ahve.

Copy link
Collaborator

@maggie-lou maggie-lou left a comment

Choose a reason for hiding this comment

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

This looks right to me. How will ninja emit this metadata to the BES?

The inner workflow job will look for this env var and if it's set will send it up in the build metadata. Does that seem ok?

@tylerwilliams tylerwilliams merged commit 47465fa into master Mar 16, 2026
12 checks passed
@tylerwilliams tylerwilliams deleted the parent_run_id branch March 16, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants