From 57edc4cbc764a9815f4990c54111e6ee9bcc8081 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Tue, 18 Feb 2025 09:50:34 +0100 Subject: {MR}GitApi: Drop inheritance --- src/buildtool/execution_api/serve/mr_git_api.hpp | 97 +----------------------- 1 file changed, 4 insertions(+), 93 deletions(-) (limited to 'src/buildtool/execution_api/serve/mr_git_api.hpp') diff --git a/src/buildtool/execution_api/serve/mr_git_api.hpp b/src/buildtool/execution_api/serve/mr_git_api.hpp index 6b5292c8..f78e1530 100644 --- a/src/buildtool/execution_api/serve/mr_git_api.hpp +++ b/src/buildtool/execution_api/serve/mr_git_api.hpp @@ -15,72 +15,23 @@ #ifndef INCLUDED_SRC_BUILDTOOL_EXECUTION_API_SERVE_MR_GIT_API_HPP #define INCLUDED_SRC_BUILDTOOL_EXECUTION_API_SERVE_MR_GIT_API_HPP -#include -#include -#include -#include -#include -#include #include #include "gsl/gsl" #include "src/buildtool/common/artifact.hpp" -#include "src/buildtool/common/artifact_digest.hpp" #include "src/buildtool/common/repository_config.hpp" -#include "src/buildtool/execution_api/common/artifact_blob.hpp" -#include "src/buildtool/execution_api/common/execution_action.hpp" #include "src/buildtool/execution_api/common/execution_api.hpp" -#include "src/buildtool/execution_engine/dag/dag.hpp" #include "src/buildtool/storage/config.hpp" -/// \brief Multi-repo-specific implementation of the abstract Execution API. -/// Handles interaction between the Git CAS and another api, irrespective of the -/// remote-execution protocol used. This instance cannot create actions or store -/// anything to the Git CAS, but has access to local storages. -class MRGitApi final : public IExecutionApi { +/// \brief Handles interaction between the Git CAS and another api, irrespective +/// of the remote-execution protocol used. +class MRGitApi final { public: MRGitApi(gsl::not_null const& repo_config, gsl::not_null const& native_storage_config, StorageConfig const* compatible_storage_config = nullptr, IExecutionApi const* compatible_local_api = nullptr) noexcept; - /// \brief Not supported. - [[nodiscard]] auto CreateAction( - ArtifactDigest const& /*root_digest*/, - std::vector const& /*command*/, - std::string const& /*cwd*/, - std::vector const& /*output_files*/, - std::vector const& /*output_dirs*/, - std::map const& /*env_vars*/, - std::map const& /*properties*/) const noexcept - -> IExecutionAction::Ptr final { - // Execution not supported. - return nullptr; - } - - /// \brief Not supported. - // NOLINTNEXTLINE(google-default-arguments) - [[nodiscard]] auto RetrieveToPaths( - std::vector const& /*artifacts_info*/, - std::vector const& /*output_paths*/, - IExecutionApi const* /*alternative*/ = nullptr) const noexcept - -> bool final { - // Retrieval to paths not suported. - return false; - } - - /// \brief Not supported. - // NOLINTNEXTLINE(google-default-arguments) - [[nodiscard]] auto RetrieveToFds( - std::vector const& /*artifacts_info*/, - std::vector const& /*fds*/, - bool /*raw_tree*/, - IExecutionApi const* /*alternative*/ = nullptr) const noexcept - -> bool final { - // Retrieval to file descriptors not supported. - return false; - } - /// \brief Passes artifacts from Git CAS to specified (remote) api. In /// compatible mode, it must rehash the native digests to be able to upload /// to a compatible remote. Expects native digests. @@ -88,47 +39,7 @@ class MRGitApi final : public IExecutionApi { /// same digest type. [[nodiscard]] auto RetrieveToCas( std::vector const& artifacts_info, - IExecutionApi const& api) const noexcept -> bool final; - - /// \brief Not supported. - [[nodiscard]] auto RetrieveToMemory( - Artifact::ObjectInfo const& /*artifact_info*/) const noexcept - -> std::optional final { - // Retrieval to memory not supported. - return std::nullopt; - } - - /// \brief Not supported. - // NOLINTNEXTLINE(google-default-arguments) - [[nodiscard]] auto Upload(std::unordered_set&& /*blobs*/, - bool /*skip_find_missing*/ = false) const noexcept - -> bool final { - // Upload not suppoorted. - return false; - } - - /// \brief Not supported. - [[nodiscard]] auto UploadTree( - std::vector const& /*artifacts*/) - const noexcept -> std::optional final { - // Upload tree not supported. - return std::nullopt; - } - - /// \brief Not supported. - [[nodiscard]] auto IsAvailable( - ArtifactDigest const& /*digest*/) const noexcept -> bool final { - // Not supported. - return false; - } - - /// \brief Not implemented. - [[nodiscard]] auto GetMissingDigests( - std::unordered_set const& /*digests*/) const noexcept - -> std::unordered_set final { - // Not supported. - return {}; - } + IExecutionApi const& api) const noexcept -> bool; private: gsl::not_null repo_config_; -- cgit v1.2.3