bazelbuild / remote-apis-sdks

This repository contains client libraries for the Remote Execution API https://github.com/bazelbuild/remote-apis
Apache License 2.0
49 stars 51 forks source link

digest function capability check does not consider all available ExecutionCapabilities.DigestFunctions #605

Open werkt opened 4 days ago

werkt commented 4 days ago

remote-apis-sdks' capabilities verification test only observes the ExecutionCapabilities.DigestFunction response to capabilities for compatibility, which reclient relies upon.

This prevents servers which indicate multiple DigestFunctions in the same record from using reclient (and other remote-api-sdks consumers) with any of the available DigestFunctions.

https://github.com/bazelbuild/remote-apis-sdks/blob/master/go/pkg/digest/digest.go#L182

This should be testing for the specified digest function presence in DigestFunctions, and using it, likely ignoring the legacy digest_function field. See the comments around these fields and their evolution here: https://github.com/bazelbuild/remote-apis/blob/main/build/bazel/remote/execution/v2/remote_execution.proto#L2062-L2091

mrahs commented 4 days ago

Thank you for surfacing this limitation. It looks like the remote execution API has been updated after the implementation in this SDK. I'd be happy to review a PR to support the newer API.