summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2023-12-19 15:47:58 +0100
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-01-08 17:07:01 +0100
commit4606302a46f8448fb7db0a1f73fcaa61eeffc8e6 (patch)
tree6823a4e003ecdc8f15bd1bcf27f195bb42765b45
parentd2265d407b389a97d587d4f44395182395ff1c24 (diff)
downloadjustbuild-4606302a46f8448fb7db0a1f73fcaa61eeffc8e6.tar.gz
just_serve.proto: Add 'tree of a distdir' request
-rw-r--r--src/buildtool/serve_api/serve_service/just_serve.proto53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/buildtool/serve_api/serve_service/just_serve.proto b/src/buildtool/serve_api/serve_service/just_serve.proto
index 0fd38ab3..a97aeb47 100644
--- a/src/buildtool/serve_api/serve_service/just_serve.proto
+++ b/src/buildtool/serve_api/serve_service/just_serve.proto
@@ -129,6 +129,52 @@ message ServeArchiveTreeResponse {
}
// A request message for
+// [TargetLevelCache.ServeDistdirTree][justbuild.just_serve.TargetLevelCache.ServeDistdirTree].
+message ServeDistdirTreeRequest {
+ // A distfile item.
+ message Distfile {
+ // The name of the distfile.
+ string name = 1;
+
+ // The git blob identifier of the distfile content.
+ string content = 2;
+ }
+
+ // The list of distfiles.
+ repeated Distfile distfiles = 1;
+
+ // If set to true and all distfile blobs are found, the resulting tree
+ // and all the content blobs will be uploaded to the remote-execution
+ // end point.
+ bool sync_tree = 2;
+}
+
+// A response message for
+// [TargetLevelCache.ServeDistdirTree][justbuild.just_serve.TargetLevelCache.ServeDistdirTree].
+message ServeDistdirTreeResponse {
+ // The requested Git tree hash.
+ string tree = 1;
+
+ enum ServeDistdirTreeStatus{
+ // All good
+ OK = 0;
+
+ // Failed to upload content blobs remotely
+ SYNC_ERROR = 1;
+
+ // At least one content blob is missing
+ NOT_FOUND = 2;
+
+ // Internally, something is very broken
+ INTERNAL_ERROR = 3;
+ }
+
+ // If the status has a code `OK` or `SYNC_ERROR`, the tree is correct.
+ // For any other value, the `tree` field is not set.
+ ServeDistdirTreeStatus status = 2;
+}
+
+// A request message for
// [TargetLevelCache.ServeContent][justbuild.just_serve.TargetLevelCache.ServeContent].
message ServeContentRequest {
// The git blob identifier of the archive.
@@ -197,6 +243,13 @@ service SourceTree {
// There are no method-specific errors.
rpc ServeArchiveTree(ServeArchiveTreeRequest) returns (ServeArchiveTreeResponse) {}
+ // Compute the Git-tree identifier for the tree containing the content
+ // blobs of a list of distfiles. The implementation must only return the
+ // tree identifier if ALL content blobs are known.
+ //
+ // There are no method-specific errors.
+ rpc ServeDistdirTree(ServeDistdirTreeRequest) returns (ServeDistdirTreeResponse) {}
+
// Make the blob identifier of an archive content available in
// remote CAS, if blob is known.
//