From 81ce4543ad0761adbf5a0dfcf94078b88aa88bc0 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Wed, 24 Jan 2024 14:45:05 +0100 Subject: serve source tree: Server-side implementation of to_git pragma-related RPCs --- .../serve_api/serve_service/source_tree.hpp | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/buildtool/serve_api/serve_service/source_tree.hpp') 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_{std::make_shared("serve-service")}; -- cgit v1.2.3