From 66df7f4956c6fe1823eb43d31c3cbac7d8716125 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Wed, 24 Jan 2024 17:09:01 +0100 Subject: just-mr: Failure in serve api root tree requests should be fatal The requests to retrieve the tree of a commit, archive, or distdir also set up those trees in a way that the serve endpoint can later build against them, besides allowing just-mr to set up roots locally. Therefore, if the witnessing entity (Git commit, content blob, or distdir, respectively) is known to the serve endpoint, then failing to set up the root tree there should result in a failure also of the just-mr setup on the client side. --- src/buildtool/serve_api/remote/serve_api.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/buildtool/serve_api/remote/serve_api.hpp') diff --git a/src/buildtool/serve_api/remote/serve_api.hpp b/src/buildtool/serve_api/remote/serve_api.hpp index 44169223..23b8904b 100644 --- a/src/buildtool/serve_api/remote/serve_api.hpp +++ b/src/buildtool/serve_api/remote/serve_api.hpp @@ -44,7 +44,7 @@ class ServeApi final { [[nodiscard]] static auto RetrieveTreeFromCommit( std::string const& commit, std::string const& subdir = ".", - bool sync_tree = false) -> std::optional { + bool sync_tree = false) -> std::variant { return Instance().stc_->ServeCommitTree(commit, subdir, sync_tree); } @@ -53,7 +53,7 @@ class ServeApi final { std::string const& archive_type = "archive", std::string const& subdir = ".", std::optional const& resolve_symlinks = std::nullopt, - bool sync_tree = false) -> std::optional { + bool sync_tree = false) -> std::variant { return Instance().stc_->ServeArchiveTree( content, archive_type, subdir, resolve_symlinks, sync_tree); } @@ -61,7 +61,7 @@ class ServeApi final { [[nodiscard]] static auto RetrieveTreeFromDistdir( std::shared_ptr> const& distfiles, - bool sync_tree = false) -> std::optional { + bool sync_tree = false) -> std::variant { return Instance().stc_->ServeDistdirTree(distfiles, sync_tree); } -- cgit v1.2.3