-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RB] Try to set default branch env var for better snapshot matching #6085
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @maggie-lou and the rest of your teammates on Graphite |
8ea4b07
to
7cb3f4b
Compare
@@ -197,6 +188,13 @@ func (r *runnerService) createAction(ctx context.Context, req *rnpb.RunRequest, | |||
}) | |||
} | |||
|
|||
for k, v := range req.GetEnv() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When generating fallback snapshot keys, we only look at cmd.EnvironmentVariables, and not at the --env_overrides flag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense - do we need env_overrides
anymore after this change or can we remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No we don't. Cleaned up in workflow service too. Don't know why I didn't implement this way to begin with...
7cb3f4b
to
a058436
Compare
@@ -22,7 +22,7 @@ jobs: | |||
|
|||
- name: Test | |||
run: | | |||
bb remote test //... \ | |||
bb remote --env=GIT_REPO_DEFAULT_BRANCH=master test //... \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert before merging?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The remote bazel code determines the default branch from the local git state. The github runner only checks out one commit, so we'd have to do that hacky thing where we briefly checkout master in order to take advantage of that. It's easier to just explicitly pass the flag
@@ -197,6 +188,13 @@ func (r *runnerService) createAction(ctx context.Context, req *rnpb.RunRequest, | |||
}) | |||
} | |||
|
|||
for k, v := range req.GetEnv() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense - do we need env_overrides
anymore after this change or can we remove it?
a058436
to
2230f19
Compare
2230f19
to
499c827
Compare
The snapshot key is based off the git branch. If we do not have a snapshot for a branch, we support falling back to snapshots for default branches, as specified in the
GIT_REPO_DEFAULT_BRANCH
andGIT_BASE_BRANCH
env vars.This change will enable more snapshot hits.
Related issues: N/A