reapi: favor platform set in Action over Command #7661
Merged
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.
In REAPI v2.2, the usage of platform in Command was deprecated over in Action. Although most of the older REAPI clients, such as Bazel, are setting it in both, newer clients such as Buck2 would only set it in Action message.
This change replace most of existing command.GetPlatform() calls with action.GetPlatform() while using the command value as fallback.
This was heavily inspired by #7550, but with a few more changes.
I tried a simpler approach where we overwrite command.platform with action.platform, but because we read the original protos by digest in ExecutionServer.markTaskComplete, this doesn't work.
Closes buildbuddy-io/buildbuddy-internal#3863