summaryrefslogtreecommitdiff
path: root/src/buildtool/serve_api/remote/serve_api.hpp
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-10-24 11:21:23 +0200
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-10-25 13:00:43 +0200
commitb98addc8f8e3e62e1213cd967f20aa631057f84e (patch)
treed4e7399fc4a02fa4e0e0684a1cdfa2bfa35673c3 /src/buildtool/serve_api/remote/serve_api.hpp
parent4018960c59d3fd0702c714e404ac913b2e83c3f5 (diff)
downloadjustbuild-b98addc8f8e3e62e1213cd967f20aa631057f84e.tar.gz
serve service: Respond with digest for blob and tree checks
...to be able to interrogate remotes irrespective of protocol. When serve endpoint is active, it will provide the correct digest with which to interrogate the remote endpoint. Otherwise, for a compatible remote check the file mappings for the correct digest. The serve service proto file is updated accordingly.
Diffstat (limited to 'src/buildtool/serve_api/remote/serve_api.hpp')
-rw-r--r--src/buildtool/serve_api/remote/serve_api.hpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/buildtool/serve_api/remote/serve_api.hpp b/src/buildtool/serve_api/remote/serve_api.hpp
index ee60f4f1..64e39092 100644
--- a/src/buildtool/serve_api/remote/serve_api.hpp
+++ b/src/buildtool/serve_api/remote/serve_api.hpp
@@ -104,13 +104,13 @@ class ServeApi final {
return stc_.ServeForeignFileTree(content, name, executable);
}
- [[nodiscard]] auto ContentInRemoteCAS(
- std::string const& content) const noexcept -> bool {
+ [[nodiscard]] auto ContentInRemoteCAS(std::string const& content)
+ const noexcept -> expected<ArtifactDigest, GitLookupError> {
return stc_.ServeContent(content);
}
- [[nodiscard]] auto TreeInRemoteCAS(
- std::string const& tree_id) const noexcept -> bool {
+ [[nodiscard]] auto TreeInRemoteCAS(std::string const& tree_id)
+ const noexcept -> expected<ArtifactDigest, GitLookupError> {
return stc_.ServeTree(tree_id);
}