From 10eabcf67a3089ce9be57df2389ef6af0123eb8b Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Tue, 25 Feb 2025 10:14:53 +0100 Subject: Invocation meta-data: include repository-config digest To do so, extend multi-repo setup to also return the digest of the configuration file. --- src/other_tools/just_mr/launch.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/other_tools/just_mr/launch.cpp') diff --git a/src/other_tools/just_mr/launch.cpp b/src/other_tools/just_mr/launch.cpp index 8744ffa3..181fc003 100644 --- a/src/other_tools/just_mr/launch.cpp +++ b/src/other_tools/just_mr/launch.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include "fmt/chrono.h" @@ -86,7 +87,8 @@ auto CallJust(std::optional const& config_file, bool supports_remote_properties{false}; bool supports_serve{false}; bool supports_dispatch{false}; - std::optional mr_config_path{std::nullopt}; + std::optional> mr_config_pair{ + std::nullopt}; std::optional lock{}; if (subcommand and kKnownJustSubcommands.contains(*subcommand)) { @@ -105,7 +107,7 @@ auto CallJust(std::optional const& config_file, config_file, common_args.absent_repository_file); use_config = true; - mr_config_path = MultiRepoSetup(config, + mr_config_pair = MultiRepoSetup(config, common_args, setup_args, just_cmd_args, @@ -115,7 +117,7 @@ auto CallJust(std::optional const& config_file, storage, /*interactive=*/false, multi_repo_tool_name); - if (not mr_config_path) { + if (not mr_config_pair) { Logger::Log(LogLevel::Error, "Failed to setup config for calling \"{} {}\"", common_args.just_path @@ -141,7 +143,7 @@ auto CallJust(std::optional const& config_file, } if (use_config) { cmd.emplace_back("-C"); - cmd.emplace_back(mr_config_path->string()); + cmd.emplace_back(mr_config_pair->first.string()); } if (use_build_root and forward_build_root) { cmd.emplace_back("--local-build-root"); @@ -313,6 +315,9 @@ auto CallJust(std::optional const& config_file, auto meta = nlohmann::json::object(); meta["time"] = invocation_time; + if (mr_config_pair) { + meta["configuration"] = mr_config_pair->second; + } meta["cmdline"] = cmd; // "configuration" -- the blob-identifier of the multi-repo // configuration -- cgit v1.2.3