diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-01-24 17:09:01 +0100 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-01-31 17:15:46 +0100 |
commit | 66df7f4956c6fe1823eb43d31c3cbac7d8716125 (patch) | |
tree | 3f8bf106b3e189eeb4cfa01f97e8f9bb18678406 /src/buildtool/serve_api/remote/serve_api.hpp | |
parent | 3dc81b4b5a89f4e37af45ec9954723c79c3017cf (diff) | |
download | justbuild-66df7f4956c6fe1823eb43d31c3cbac7d8716125.tar.gz |
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.
Diffstat (limited to 'src/buildtool/serve_api/remote/serve_api.hpp')
-rw-r--r-- | src/buildtool/serve_api/remote/serve_api.hpp | 6 |
1 files changed, 3 insertions, 3 deletions
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<std::string> { + bool sync_tree = false) -> std::variant<bool, std::string> { 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<PragmaSpecial> const& resolve_symlinks = std::nullopt, - bool sync_tree = false) -> std::optional<std::string> { + bool sync_tree = false) -> std::variant<bool, std::string> { 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<std::unordered_map<std::string, std::string>> const& distfiles, - bool sync_tree = false) -> std::optional<std::string> { + bool sync_tree = false) -> std::variant<bool, std::string> { return Instance().stc_->ServeDistdirTree(distfiles, sync_tree); } |