aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSon Luong Ngoc <sluongng@gmail.com>2024-04-09 15:50:18 +0200
committerGitHub <noreply@github.com>2024-04-09 09:50:18 -0400
commit1f36c310b28d762b258ea577ed08e8203274efae (patch)
treeb8c9f672d249ccdb0a9371aee040643b3075ebcf
parent7f51b3676b5d19df726783d9a861e45d7389b5ae (diff)
downloadbazelbuild-remote-apis-1f36c310b28d762b258ea577ed08e8203274efae.tar.gz
Support digest functions in remote_asset API (#286)upstream-main
* Support digest functions in remote_asset API * Add digest_function to response and directory rpc * change digest_function in responses to bool * Revert "change digest_function in responses to bool" This reverts commit a7496382b94f838b9001b6300ba515870b2ba05b. --------- Co-authored-by: Tyler Williams <williams.tyler@gmail.com>
-rw-r--r--build/bazel/remote/asset/v1/remote_asset.proto46
1 files changed, 46 insertions, 0 deletions
diff --git a/build/bazel/remote/asset/v1/remote_asset.proto b/build/bazel/remote/asset/v1/remote_asset.proto
index b1454b6..c896ec4 100644
--- a/build/bazel/remote/asset/v1/remote_asset.proto
+++ b/build/bazel/remote/asset/v1/remote_asset.proto
@@ -201,6 +201,11 @@ message FetchBlobRequest {
//
// Specified qualifier names *MUST* be unique.
repeated Qualifier qualifiers = 5;
+
+ // The digest function the server must use to compute the digest.
+ //
+ // If unset, the server SHOULD default to SHA256.
+ build.bazel.remote.execution.v2.DigestFunction.Value digest_function = 6;
}
// A response message for
@@ -234,6 +239,15 @@ message FetchBlobResponse {
// The result of the fetch, if the status had code `OK`.
// The digest of the file's contents, available for download through the CAS.
build.bazel.remote.execution.v2.Digest blob_digest = 5;
+
+ // This field SHOULD be set to the digest function that was used by the server
+ // to compute [FetchBlobResponse.blob_digest].
+ // Clients could use this to determine whether the server honors
+ // [FetchBlobRequest.digest_function] that was set in the request.
+ //
+ // If unset, clients SHOULD default to use SHA256 regardless of the requested
+ // [FetchBlobRequest.digest_function].
+ build.bazel.remote.execution.v2.DigestFunction.Value digest_function = 6;
}
// A request message for
@@ -282,6 +296,11 @@ message FetchDirectoryRequest {
//
// Specified qualifier names *MUST* be unique.
repeated Qualifier qualifiers = 5;
+
+ // The digest function the server must use to compute the digest.
+ //
+ // If unset, the server SHOULD default to SHA256.
+ build.bazel.remote.execution.v2.DigestFunction.Value digest_function = 6;
}
// A response message for
@@ -316,6 +335,15 @@ message FetchDirectoryResponse {
// the root digest of a directory tree, suitable for fetching via
// [ContentAddressableStorage.GetTree].
build.bazel.remote.execution.v2.Digest root_directory_digest = 5;
+
+ // This field SHOULD be set to the digest function that was used by the server
+ // to compute [FetchBlobResponse.root_directory_digest].
+ // Clients could use this to determine whether the server honors
+ // [FetchDirectoryRequest.digest_function] that was set in the request.
+ //
+ // If unset, clients SHOULD default to use SHA256 regardless of the requested
+ // [FetchDirectoryRequest.digest_function].
+ build.bazel.remote.execution.v2.DigestFunction.Value digest_function = 6;
}
// The Push service is complementary to the Fetch, and allows for
@@ -402,6 +430,15 @@ message PushBlobRequest {
// indirectly referencing unavailable blobs.
repeated build.bazel.remote.execution.v2.Digest references_blobs = 6;
repeated build.bazel.remote.execution.v2.Digest references_directories = 7;
+
+ // The digest function that was used to compute the blob digest.
+ //
+ // If the digest function used is one of MD5, MURMUR3, SHA1, SHA256,
+ // SHA384, SHA512, or VSO, the client MAY leave this field unset. In
+ // that case the server SHOULD infer the digest function using the
+ // length of the action digest hash and the digest functions announced
+ // in the server's capabilities.
+ build.bazel.remote.execution.v2.DigestFunction.Value digest_function = 8;
}
// A response message for
@@ -442,6 +479,15 @@ message PushDirectoryRequest {
// indirectly referencing unavailable blobs.
repeated build.bazel.remote.execution.v2.Digest references_blobs = 6;
repeated build.bazel.remote.execution.v2.Digest references_directories = 7;
+
+ // The digest function that was used to compute blob digests.
+ //
+ // If the digest function used is one of MD5, MURMUR3, SHA1, SHA256,
+ // SHA384, SHA512, or VSO, the client MAY leave this field unset. In
+ // that case the server SHOULD infer the digest function using the
+ // length of the action digest hash and the digest functions announced
+ // in the server's capabilities.
+ build.bazel.remote.execution.v2.DigestFunction.Value digest_function = 8;
}
// A response message for