Repository: bacalhau-project/bacalhau (language: python)

Issue:
external exec bid strategy error message formatted incorrectly
To reproduce:
```
bacalhau docker run --network=full ubuntu:latest -- "bash" "-c" "apt-get -y update; apt-get -y install curl && curl -sL https://get.bacalhau.org/install.sh | bash"
Job successfully submitted. Job ID: 6bab483f-f759-4957-bf48-34fcecfe4941
Checking job status... (Enter Ctrl+C to exit at any time, your job will continue running):

	Communicating with the network  ................  done ✅  0.1s
	   Creating job for submission  ................  err  ❌  0.6s

Error submitting job: not enough nodes to run job. requested: 1, available: 0. 
	Node QmSD38wH: job rejected
	Node QmRHRr8c: job rejected
	Node QmcC3xif: job rejected
	Node QmbxGSsM: job rejected
	Node QmeXjeQD: job rejected
	Node QmPLPUUj: job rejected
Job Results By Node:
• Node QmSD38wH, QmbxGSsM, QmeXjeQD, QmRHRr8c, QmPLPUUj: this node does not accept jobs where external command '\x01' returns exit code %!d(MISSING). bid rejected
• Node QmcC3xif: networking is enabled: false. bid rejected
```
incorrect formatting: `• Node QmSD38wH, QmbxGSsM, QmeXjeQD, QmRHRr8c, QmPLPUUj: this node does not accept jobs where external command '\x01' returns exit code %!d(MISSING). bid rejected`


Discussion / hints:

Fix patch:
diff --git a/pkg/bidstrategy/semantic/external_exec.go b/pkg/bidstrategy/semantic/external_exec.go
index 0ed5ad96dd..1a4606f97b 100644
--- a/pkg/bidstrategy/semantic/external_exec.go
+++ b/pkg/bidstrategy/semantic/external_exec.go
@@ -69,5 +69,5 @@ func (s *ExternalCommandStrategy) ShouldBid(
 	}
 
 	exitCode := cmd.ProcessState.ExitCode()
-	return bidstrategy.NewBidResponse(exitCode == 0, exitCodeReason, exitCode), nil
+	return bidstrategy.NewBidResponse(exitCode == 0, exitCodeReason, s.command, exitCode), nil
 }


Test patch:
diff --git a/pkg/bidstrategy/semantic/external_exec_test.go b/pkg/bidstrategy/semantic/external_exec_test.go
index 2d452a9d63..97553786b1 100644
--- a/pkg/bidstrategy/semantic/external_exec_test.go
+++ b/pkg/bidstrategy/semantic/external_exec_test.go
@@ -14,34 +14,32 @@ import (
 func TestJobSelectionExec(t *testing.T) {
 	testCases := []struct {
 		name           string
-		failMode       bool
+		testCommand    string
 		expectedResult bool
+		expectedReason string
 	}{
 		{
 			"fail the response and don't select the job",
-			true,
+			"exit 1",
 			false,
+			"this node does not accept jobs where external command \"exit 1\" returns exit code 1",
 		},
 		{
 			"succeed the response and select the job",
-			false,
+			"exit 0",
 			true,
+			"this node does accept jobs where external command \"exit 0\" returns exit code 0",
 		},
 	}
 
 	for _, test := range testCases {
 		t.Run(test.name, func(t *testing.T) {
-			command := "exit 0"
-			if test.failMode {
-				command = "exit 1"
-			}
-			params := semantic.ExternalCommandStrategyParams{
-				Command: command,
-			}
+			params := semantic.ExternalCommandStrategyParams{Command: test.testCommand}
 			strategy := semantic.NewExternalCommandStrategy(params)
 			result, err := strategy.ShouldBid(context.Background(), getBidStrategyRequest(t))
 			require.NoError(t, err)
 			require.Equal(t, test.expectedResult, result.ShouldBid)
+			require.Equal(t, test.expectedReason, result.Reason)
 		})
 	}
 }