From bc13ef64895bdf6a9a7f441f9463b1755e814d2b Mon Sep 17 00:00:00 2001
From: iamashwin99 <ashwin-kumar.karnad@mpsd.mpg.de>
Date: Tue, 27 Jun 2023 12:17:44 +0200
Subject: [PATCH 1/3] log the spe_variables only if present

---
 src/mpsd_software_manager/mpsd_software.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/mpsd_software_manager/mpsd_software.py b/src/mpsd_software_manager/mpsd_software.py
index 97f32a5..03907f4 100755
--- a/src/mpsd_software_manager/mpsd_software.py
+++ b/src/mpsd_software_manager/mpsd_software.py
@@ -606,10 +606,11 @@ def record_script_execution_summary(
                 f.write(f"{datetime.datetime.now().isoformat()}, {cmd_line}\n")
                 # logs script version
                 f.write(f"MPSD Software manager version: {__version__}\n")
-                f.write(
-                    f"Spack environments branch: {spe_branch} "
-                    f"(commit hash: {spe_commit_hash})\n"
-                )
+                if spe_branch and spe_commit_hash:
+                    f.write(
+                        f"Spack environments branch: {spe_branch} "
+                        f"(commit hash: {spe_commit_hash})\n"
+                    )
 
 
 def clone_repo(
-- 
GitLab


From 4c0b59e709a160bc39c865874d222a94d9d835ef Mon Sep 17 00:00:00 2001
From: iamashwin99 <ashwin-kumar.karnad@mpsd.mpg.de>
Date: Tue, 27 Jun 2023 12:22:19 +0200
Subject: [PATCH 2/3] remove mpsd_release as its not used in
 execution_summary_logger

---
 src/mpsd_software_manager/mpsd_software.py | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/mpsd_software_manager/mpsd_software.py b/src/mpsd_software_manager/mpsd_software.py
index 03907f4..074129e 100755
--- a/src/mpsd_software_manager/mpsd_software.py
+++ b/src/mpsd_software_manager/mpsd_software.py
@@ -551,9 +551,7 @@ def run(*args, counter=[0], **kwargs):
     return process
 
 
-def record_script_execution_summary(
-    mpsd_release: str, root_dir: str, msg: str = None, **kwargs
-) -> None:
+def record_script_execution_summary(root_dir: str, msg: str = None, **kwargs) -> None:
     """Log the command used to build the package_set.
 
     It also logs information about the spack-environments branch and commit hash,
@@ -562,8 +560,6 @@ def record_script_execution_summary(
 
     Parameters
     ----------
-    - mpsd_release : str
-        The name of the release to install toolchains for.
     - root_dir : str
         The path to the directory where the scripts are located.
     - msg : str, optional
-- 
GitLab


From 0014485e5e6cbbf371ef158c3716fc05e41e9f30 Mon Sep 17 00:00:00 2001
From: iamashwin99 <ashwin-kumar.karnad@mpsd.mpg.de>
Date: Tue, 27 Jun 2023 12:24:13 +0200
Subject: [PATCH 3/3] update use of record_script_execution_summary

---
 src/mpsd_software_manager/mpsd_software.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/mpsd_software_manager/mpsd_software.py b/src/mpsd_software_manager/mpsd_software.py
index 074129e..fe2f99d 100755
--- a/src/mpsd_software_manager/mpsd_software.py
+++ b/src/mpsd_software_manager/mpsd_software.py
@@ -784,7 +784,7 @@ def prepare_environment(mpsd_release: str, root_dir: Path) -> List[str]:
         mpsd_release, root_dir
     )
     record_script_execution_summary(
-        mpsd_release, root_dir, spe_branch=spe_branch, spe_commit_hash=spe_commit_hash
+        root_dir, spe_branch=spe_branch, spe_commit_hash=spe_commit_hash
     )
     return available_package_sets
 
@@ -935,12 +935,10 @@ def install_environment(
 
             # log the command
             record_script_execution_summary(
-                mpsd_release,
                 root_dir,
                 msg=f"installing {package_set} and logging at {build_log_path}",
             )
             record_script_execution_summary(
-                mpsd_release,
                 root_dir,
                 msg=(
                     f"CMD: bash {spack_setup_script} {' '.join(install_flags)} "
-- 
GitLab