Skip to content

Commit 47465fa

Browse files
Set BUILDBUDDY_RUN_ID env var (#11584)
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?
1 parent d952b50 commit 47465fa

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

enterprise/server/cmd/ci_runner/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,7 @@ func run() error {
725725
}
726726
ws.rootDir = rootDir
727727
os.Setenv("BUILDBUDDY_CI_RUNNER_ROOT_DIR", rootDir)
728+
os.Setenv(ci_runner_env.BuildBuddyRunIDEnvVarName, runID)
728729

729730
// Bazel needs a HOME dir; ensure that one is set.
730731
if err := ensureHomeDir(); err != nil {

enterprise/server/util/ci_runner_env/ci_runner_env.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package ci_runner_env
33
const (
44
BuildBuddyAPIKeyEnvVarName = "BUILDBUDDY_API_KEY"
55
BuildBuddyInvocationIDEnvVarName = "BUILDBUDDY_INVOCATION_ID"
6+
BuildBuddyRunIDEnvVarName = "BUILDBUDDY_RUN_ID"
67

78
BBGrpcClientOriginEnvVarName = "BB_GRPC_CLIENT_ORIGIN"
89
BBGrpcClientIdentityEnvVarName = "BB_GRPC_CLIENT_IDENTITY"

0 commit comments

Comments
 (0)