diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-01-10 16:44:42 +0100 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-01-26 14:51:43 +0100 |
commit | debbc9dd20156b5ba94946c4cc2f689a8e163a2b (patch) | |
tree | ba05d72f82a4a80bdedd8f5545a942a8b4b1821c /src/buildtool/serve_api/remote/source_tree_client.hpp | |
parent | 81ce4543ad0761adbf5a0dfcf94078b88aa88bc0 (diff) | |
download | justbuild-debbc9dd20156b5ba94946c4cc2f689a8e163a2b.tar.gz |
serve source tree: Client-side and API implementations of to_git pragma-related RPCs
Diffstat (limited to 'src/buildtool/serve_api/remote/source_tree_client.hpp')
-rw-r--r-- | src/buildtool/serve_api/remote/source_tree_client.hpp | 15 |
1 files changed, 15 insertions, 0 deletions
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<bool>; + + /// \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<justbuild::just_serve::SourceTree::Stub> stub_; Logger logger_{"RemoteSourceTreeClient"}; |