From 58830989428eaf9151177abeb756f31c47755596 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Wed, 15 Jan 2025 12:30:53 +0100 Subject: TreeStructureUtils: implement local computation of tree structure --- src/buildtool/tree_structure/tree_structure_utils.hpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/buildtool/tree_structure/tree_structure_utils.hpp') diff --git a/src/buildtool/tree_structure/tree_structure_utils.hpp b/src/buildtool/tree_structure/tree_structure_utils.hpp index 4f908640..7cecf7f8 100644 --- a/src/buildtool/tree_structure/tree_structure_utils.hpp +++ b/src/buildtool/tree_structure/tree_structure_utils.hpp @@ -17,6 +17,7 @@ #include #include +#include #include #include @@ -74,6 +75,22 @@ class TreeStructureUtils final { std::vector const& source_repos, IExecutionApi const& target_api) noexcept -> expected; + + /// \brief Find git tree locally and compute its tree structure. + /// \param tree Git tree to process + /// \param known_repositories Known git repositories to check + /// \param storage_config Storage to use for lookup and import. + /// \param tagging_lock Mutex to protect critical git operations + /// \return Digest of the tree structure that is available in + /// storage_config's git repo and in storage_config's CAS; std::nullopt if + /// the search failed to locate the tree's sources locally; an error string + /// on critical failure. + [[nodiscard]] static auto ComputeStructureLocally( + ArtifactDigest const& tree, + std::vector const& known_repositories, + StorageConfig const& storage_config, + gsl::not_null const& tagging_lock) + -> expected, std::string>; }; #endif // INCLUDED_SRC_BUILDTOOL_TREE_STRUCTURE_TREE_STRUCTURE_UTILS_HPP -- cgit v1.2.3