diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-12-11 12:25:55 +0100 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-12-12 14:37:18 +0100 |
commit | 93b92ef2669bed7345eadabbf71ee30c4b7929af (patch) | |
tree | 3da25625b7a3335e88f4bf94e2080ee28ce84d36 /src/buildtool/serve_api/serve_service/target.hpp | |
parent | e6123964c4470426a444d190ed5b1c58a74b7731 (diff) | |
download | justbuild-93b92ef2669bed7345eadabbf71ee30c4b7929af.tar.gz |
serve target: Move server-side helper methods in own library
Diffstat (limited to 'src/buildtool/serve_api/serve_service/target.hpp')
-rw-r--r-- | src/buildtool/serve_api/serve_service/target.hpp | 34 |
1 files changed, 2 insertions, 32 deletions
diff --git a/src/buildtool/serve_api/serve_service/target.hpp b/src/buildtool/serve_api/serve_service/target.hpp index 5cb18426..b8257152 100644 --- a/src/buildtool/serve_api/serve_service/target.hpp +++ b/src/buildtool/serve_api/serve_service/target.hpp @@ -18,12 +18,13 @@ #include <filesystem> #include <memory> #include <optional> +#include <string> #include "gsl/gsl" #include "justbuild/just_serve/just_serve.grpc.pb.h" #include "src/buildtool/common/remote/remote_common.hpp" -#include "src/buildtool/common/repository_config.hpp" #include "src/buildtool/execution_api/common/create_execution_api.hpp" +#include "src/buildtool/execution_api/common/execution_api.hpp" #include "src/buildtool/execution_api/remote/config.hpp" #include "src/buildtool/logging/logger.hpp" @@ -77,37 +78,6 @@ class TargetService final : public justbuild::just_serve::Target::Service { // used for storing and retrieving target-level cache entries gsl::not_null<IExecutionApi::Ptr> const local_api_{ CreateExecutionApi(std::nullopt)}; - - /// \brief Check if tree exists in the given repository. - [[nodiscard]] static auto IsTreeInRepo( - std::string const& tree_id, - std::filesystem::path const& repo_path, - std::shared_ptr<Logger> const& logger) -> bool; - - /// \brief For a given tree id, find the known repository that can serve it. - [[nodiscard]] static auto GetServingRepository( - std::string const& tree_id, - std::shared_ptr<Logger> const& logger) - -> std::optional<std::filesystem::path>; - - /// \brief Parse the stored repository configuration blob and populate the - /// RepositoryConfig instance. - /// \returns nullopt on success, error message as a string otherwise. - [[nodiscard]] static auto DetermineRoots( - std::string const& main_repo, - std::filesystem::path const& repo_config_path, - gsl::not_null<RepositoryConfig*> const& repository_config, - std::shared_ptr<Logger> const& logger) -> std::optional<std::string>; - - /// \brief Get the blob content at given path inside a Git tree. - /// \returns If tree found, pair of "no-internal-errors" flag and content of - /// blob at the path specified if blob exists, nullopt otherwise. - [[nodiscard]] static auto GetBlobContent( - std::filesystem::path const& repo_path, - std::string const& tree_id, - std::string const& rel_path, - std::shared_ptr<Logger> const& logger) - -> std::optional<std::pair<bool, std::optional<std::string>>>; }; #endif // INCLUDED_SRC_BUILD_SERVE_API_SERVE_SERVICE_TARGET_HPP |