summaryrefslogtreecommitdiff
path: root/src/buildtool/serve_api/serve_service/source_tree.hpp
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-01-24 14:45:05 +0100
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-01-26 14:51:43 +0100
commit81ce4543ad0761adbf5a0dfcf94078b88aa88bc0 (patch)
treeef80aef191855d57e4e54b8471a8d1ff672c218e /src/buildtool/serve_api/serve_service/source_tree.hpp
parentdf026580219894134e5329dfff3ed1bb2f7d52c1 (diff)
downloadjustbuild-81ce4543ad0761adbf5a0dfcf94078b88aa88bc0.tar.gz
serve source tree: Server-side implementation of to_git pragma-related RPCs
Diffstat (limited to 'src/buildtool/serve_api/serve_service/source_tree.hpp')
-rw-r--r--src/buildtool/serve_api/serve_service/source_tree.hpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/buildtool/serve_api/serve_service/source_tree.hpp b/src/buildtool/serve_api/serve_service/source_tree.hpp
index 8dd4021e..b17bdcf9 100644
--- a/src/buildtool/serve_api/serve_service/source_tree.hpp
+++ b/src/buildtool/serve_api/serve_service/source_tree.hpp
@@ -47,6 +47,11 @@ class SourceTreeService final
using ServeContentResponse = ::justbuild::just_serve::ServeContentResponse;
using ServeTreeResponse = ::justbuild::just_serve::ServeTreeResponse;
+ using CheckRootTreeResponse =
+ ::justbuild::just_serve::CheckRootTreeResponse;
+ using GetRemoteTreeResponse =
+ ::justbuild::just_serve::GetRemoteTreeResponse;
+
// Retrieve the Git-subtree identifier from a given Git commit.
//
// There are no method-specific errors.
@@ -91,6 +96,27 @@ class SourceTreeService final
const ::justbuild::just_serve::ServeTreeRequest* request,
ServeTreeResponse* response) -> ::grpc::Status override;
+ // Checks if a Git-tree is locally known and, if found, makes it available
+ // in a location where this serve instance can build against.
+ // The implementation should not interrogate the associated remote-execution
+ // endpoint at any point during the completion of this request.
+ //
+ // There are no method-specific errors.
+ auto CheckRootTree(
+ ::grpc::ServerContext* context,
+ const ::justbuild::just_serve::CheckRootTreeRequest* request,
+ CheckRootTreeResponse* response) -> ::grpc::Status override;
+
+ // Retrieves a given Git-tree from the CAS of the associated
+ // remote-execution endpoint and makes it available in a location where this
+ // serve instance can build against.
+ //
+ // There are no method-specific errors.
+ auto GetRemoteTree(
+ ::grpc::ServerContext* context,
+ const ::justbuild::just_serve::GetRemoteTreeRequest* request,
+ GetRemoteTreeResponse* response) -> ::grpc::Status override;
+
private:
mutable std::shared_mutex mutex_;
std::shared_ptr<Logger> logger_{std::make_shared<Logger>("serve-service")};