From 44a2cb92064b270fad32bfe67a0f7803e11d5fe8 Mon Sep 17 00:00:00 2001
From: buero <buero@no-reply@meissa-gmbh.de>
Date: Mon, 20 Jan 2025 10:48:10 +0000
Subject: [PATCH 1/5] Update README.md

Added codeberg.org/meissa mirror
---
 README.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/README.md b/README.md
index 11df0d9..d812e71 100644
--- a/README.md
+++ b/README.md
@@ -191,6 +191,7 @@ provs-server.jar k3s -h
 Development happens at: https://repo.prod.meissa.de/meissa/provs
 
 Mirrors are:
+* https://codeberg.org/meissa/provs.git
 * https://gitlab.com/domaindrivenarchitecture/provs (CI issues and PR)
 * https://github.com/DomainDrivenArchitecture/provs
 

From b625d338e6f726a3290198c706ea68ab7af4300f Mon Sep 17 00:00:00 2001
From: ansgarz <ansgar.zwick@meissa.de>
Date: Mon, 20 Jan 2025 21:32:37 +0100
Subject: [PATCH 2/5] improve output, remove /bin/bash prefix

---
 .../domaindrivenarchitecture/provs/framework/core/Prov.kt | 4 +++-
 .../provs/framework/core/ProvTest.kt                      | 8 ++++----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/core/Prov.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/core/Prov.kt
index d4b764f..279b45d 100644
--- a/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/core/Prov.kt
+++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/core/Prov.kt
@@ -1,5 +1,6 @@
 package org.domaindrivenarchitecture.provs.framework.core
 
+import org.domaindrivenarchitecture.provs.framework.core.platforms.SHELL
 import org.domaindrivenarchitecture.provs.framework.core.platforms.UbuntuProv
 import org.domaindrivenarchitecture.provs.framework.core.processors.LocalProcessor
 import org.domaindrivenarchitecture.provs.framework.core.processors.Processor
@@ -325,7 +326,8 @@ open class Prov protected constructor(
                 ProvResult(false, err = "mode unknown")
             }
 
-        internalResults[resultIndex].provResult = returnValue
+        val resultValueWithCmdCleanedUp = returnValue.copy(cmd = returnValue.cmd?.replace("[" + SHELL + ", -c, ", "["))
+        internalResults[resultIndex].provResult = resultValueWithCmdCleanedUp
 
         // Add failure result to output if not yet included,
         // which is the case if the result was not part of another subtask but created and returned by the lambda itself.
diff --git a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/core/ProvTest.kt b/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/core/ProvTest.kt
index 051fe2e..5ecdc98 100644
--- a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/core/ProvTest.kt
+++ b/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/core/ProvTest.kt
@@ -318,10 +318,10 @@ internal class ProvTest {
                     "--->  \u001B[92mSuccess\u001B[0m -- testMethodForOutputTest_with_mode_requireLast (requireLast) \n" +
                     "------>  \u001B[93mFAILED\u001B[0m  -- checkPrereq_evaluateToFailure (requireLast)  -- Error: This is a test error.\n" +
                     "------>  \u001B[92mSuccess\u001B[0m -- sh \n" +
-                    "--------->  \u001B[92mSuccess\u001B[0m -- cmd [/bin/bash, -c, echo -Start test-]\n" +
-                    "--------->  \u001B[92mSuccess\u001B[0m -- cmd [/bin/bash, -c, echo Some output]\n" +
+                    "--------->  \u001B[92mSuccess\u001B[0m -- cmd [echo -Start test-]\n" +
+                    "--------->  \u001B[92mSuccess\u001B[0m -- cmd [echo Some output]\n" +
                     "------>  \u001B[92mSuccess\u001B[0m -- sh \n" +
-                    "--------->  \u001B[92mSuccess\u001B[0m -- cmd [/bin/bash, -c, echo -End test-]\n" +
+                    "--------->  \u001B[92mSuccess\u001B[0m -- cmd [echo -End test-]\n" +
                     "----------------------------------------------------------------------------------------------------\n" +
                     "Overall >  \u001B[92mSuccess\u001B[0m\n" +
                     "============================================ SUMMARY END ===========================================\n" +
@@ -363,7 +363,7 @@ internal class ProvTest {
                     "------>  \u001B[91mFAILED\u001B[0m  -- sub1 \n" +
                     "--------->  \u001B[92mSuccess\u001B[0m -- testMethodForOutputTest_nested_with_failure \n" +
                     "--------->  \u001B[91mFAILED\u001B[0m  -- <<returned result>>  -- Error: Iamanerrormessage\n" +
-                    "------>  \u001B[92mSuccess\u001B[0m -- cmd [/bin/bash, -c, echo -End test-]\n" +
+                    "------>  \u001B[92mSuccess\u001B[0m -- cmd [echo -End test-]\n" +
                     "----------------------------------------------------------------------------------------------------\n" +
                     "Overall >  \u001B[91mFAILED\u001B[0m \n" +
                     "============================================ SUMMARY END ===========================================\n" +

From d6d7c5d5bbd7bf8268151fa8689686ccd23675a2 Mon Sep 17 00:00:00 2001
From: ansgarz <ansgar.zwick@meissa.de>
Date: Wed, 22 Jan 2025 21:03:15 +0100
Subject: [PATCH 3/5] [skip ci] improve output for returned result

---
 .../domaindrivenarchitecture/provs/framework/core/Prov.kt  | 7 +++++--
 .../provs/framework/core/ProvTest.kt                       | 4 ++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/core/Prov.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/core/Prov.kt
index 279b45d..2b059c8 100644
--- a/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/core/Prov.kt
+++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/core/Prov.kt
@@ -326,7 +326,10 @@ open class Prov protected constructor(
                 ProvResult(false, err = "mode unknown")
             }
 
-        val resultValueWithCmdCleanedUp = returnValue.copy(cmd = returnValue.cmd?.replace("[" + SHELL + ", -c, ", "["))
+        // removes potential prefix from cmd in ProvResult, e.g. removes "/bin/bash -c "
+        fun cleanedResult(result: ProvResult): ProvResult { return result.copy(cmd = returnValue.cmd?.replace("[" + SHELL + ", -c, ", "[")) }
+
+        val resultValueWithCmdCleanedUp = cleanedResult(returnValue)
         internalResults[resultIndex].provResult = resultValueWithCmdCleanedUp
 
         // Add failure result to output if not yet included,
@@ -335,7 +338,7 @@ open class Prov protected constructor(
         // whereas the failure results may have a useful error message, which should be in the output.
         // Only direct result objects are added, but not result objects that were passed from a subtask as they are already handled in the subtask.
         if (!resultOfTaskLambda.success && (resultIndex < internalResults.size - 1) && (resultOfTaskLambda != internalResults[resultIndex + 1].provResult)) {
-            internalResults.add(ResultLine(level + 1, "<<returned result>>", resultOfTaskLambda))
+            internalResults.add(ResultLine(level + 1, name + " (returned result)", cleanedResult(resultOfTaskLambda)))
         }
 
         if (level == 0) {
diff --git a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/core/ProvTest.kt b/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/core/ProvTest.kt
index 5ecdc98..387a2a7 100644
--- a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/core/ProvTest.kt
+++ b/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/core/ProvTest.kt
@@ -362,7 +362,7 @@ internal class ProvTest {
                     "--->  \u001B[91mFAILED\u001B[0m  -- testMethodForOutputTest_nested_with_failure \n" +
                     "------>  \u001B[91mFAILED\u001B[0m  -- sub1 \n" +
                     "--------->  \u001B[92mSuccess\u001B[0m -- testMethodForOutputTest_nested_with_failure \n" +
-                    "--------->  \u001B[91mFAILED\u001B[0m  -- <<returned result>>  -- Error: Iamanerrormessage\n" +
+                    "--------->  \u001B[91mFAILED\u001B[0m  -- sub1 (returned result)  -- Error: Iamanerrormessage\n" +
                     "------>  \u001B[92mSuccess\u001B[0m -- cmd [echo -End test-]\n" +
                     "----------------------------------------------------------------------------------------------------\n" +
                     "Overall >  \u001B[91mFAILED\u001B[0m \n" +
@@ -734,7 +734,7 @@ internal class ProvTest {
                     "------>  \u001B[92mSuccess\u001B[0m -- sub2e-task \n" +
                     "--------->  \u001B[92mSuccess\u001B[0m -- addResultToEval \n" +
                     "------>  \u001B[91mFAILED\u001B[0m  -- sub2f-taskWithResult  -- Error: returned-result - error msg C should be once in output - at the end of sub3taskWithResult \n" +
-                    "------>  \u001B[91mFAILED\u001B[0m  -- <<returned result>>  -- Error: returned-result - error msg D should be once in output - at the end of sub1 \n" +
+                    "------>  \u001B[91mFAILED\u001B[0m  -- sub1 (returned result)  -- Error: returned-result - error msg D should be once in output - at the end of sub1 \n" +
                     "----------------------------------------------------------------------------------------------------\n" +
                     "Overall >  \u001B[91mFAILED\u001B[0m \n" +
                     "============================================ SUMMARY END ===========================================\n" +

From 545ad0e2ee8e0bbf6e0214585bb3355393b0b9cf Mon Sep 17 00:00:00 2001
From: ansgarz <ansgar.zwick@meissa.de>
Date: Wed, 22 Jan 2025 21:03:30 +0100
Subject: [PATCH 4/5] release: 0.39.5

---
 build.gradle | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build.gradle b/build.gradle
index 443f992..b103490 100644
--- a/build.gradle
+++ b/build.gradle
@@ -16,7 +16,7 @@ plugins {
 apply plugin: "maven-publish"
 
 
-version = "0.39.5-SNAPSHOT"
+version = "0.39.5"
 group = "org.domaindrivenarchitecture.provs"
 
 

From 01afab3f504d0b52e452615641e8144973fa0902 Mon Sep 17 00:00:00 2001
From: ansgarz <ansgar.zwick@meissa.de>
Date: Wed, 22 Jan 2025 21:03:30 +0100
Subject: [PATCH 5/5] bump version to: 0.39.6-SNAPSHOT

---
 build.gradle | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build.gradle b/build.gradle
index b103490..eb3a9f9 100644
--- a/build.gradle
+++ b/build.gradle
@@ -16,7 +16,7 @@ plugins {
 apply plugin: "maven-publish"
 
 
-version = "0.39.5"
+version = "0.39.6-SNAPSHOT"
 group = "org.domaindrivenarchitecture.provs"