From debbc9dd20156b5ba94946c4cc2f689a8e163a2b Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Wed, 10 Jan 2024 16:44:42 +0100 Subject: serve source tree: Client-side and API implementations of to_git pragma-related RPCs --- src/buildtool/serve_api/remote/source_tree_client.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/buildtool/serve_api/remote/source_tree_client.hpp') diff --git a/src/buildtool/serve_api/remote/source_tree_client.hpp b/src/buildtool/serve_api/remote/source_tree_client.hpp index a76d4135..3ea1058b 100644 --- a/src/buildtool/serve_api/remote/source_tree_client.hpp +++ b/src/buildtool/serve_api/remote/source_tree_client.hpp @@ -78,6 +78,21 @@ class SourceTreeClient { /// \returns Flag to state whether tree is in remote CAS. [[nodiscard]] auto ServeTree(std::string const& tree_id) -> bool; + /// \brief Checks if the serve endpoint has a given tree locally available + /// and makes it available for a serve-orchestrated build. + /// \param[in] tree_id Identifier of the Git tree to look up. + /// \returns Flag to state whether tree is known or not, or nullopt on + /// errors. + [[nodiscard]] auto CheckRootTree(std::string const& tree_id) + -> std::optional; + + /// \brief Retrieve tree from the CAS of the associated remote-execution + /// endpoint and makes it available for a serve-orchestrated build. + /// \param[in] tree_id Identifier of the Git tree to retrieve. + /// \returns Flag to state whether tree was successfully imported into the + /// local Git storage or not. + [[nodiscard]] auto GetRemoteTree(std::string const& tree_id) -> bool; + private: std::unique_ptr stub_; Logger logger_{"RemoteSourceTreeClient"}; -- cgit v1.2.3