8000 fix(api): do not prefix non cds parameters (#4175) · ovh/cds@81c39cb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 81c39cb

Browse files
authored
fix(api): do not prefix non cds parameters (#4175)
1 parent 173f46f commit 81c39cb

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

engine/api/workflow/process_node_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,6 +1316,7 @@ func TestGitParamOn2ApplicationSameRepo(t *testing.T) {
13161316
var manualEvent sdk.WorkflowNodeRunManual
13171317
manualEvent.Payload = map[string]string{
13181318
"git.branch": "feat/branch",
1319+
"my.value": "bar",
13191320
}
13201321

13211322
opts := &sdk.WorkflowRunPostHandlerOption{
@@ -1336,13 +1337,16 @@ func TestGitParamOn2ApplicationSameRepo(t *testing.T) {
13361337
assert.Equal(t, "mylastcommit", mapParams["git.hash"])
13371338
assert.Equal(t, "steven.guiheux", mapParams["git.author"])
13381339
assert.Equal(t, "super commit", mapParams["git.message"])
1340+
assert.Equal(t, "bar", mapParams["my.value"])
13391341

13401342
mapParams2 := sdk.ParametersToMap(wr.WorkflowNodeRuns[w.WorkflowData.Node.Triggers[0].ChildNode.ID][0].BuildParameters)
13411343
t.Logf("%+v", mapParams2)
13421344
assert.Equal(t, "feat/branch", mapParams2["git.branch"])
13431345
assert.Equal(t, "mylastcommit", mapParams2["git.hash"])
13441346
assert.Equal(t, "steven.guiheux", mapParams2["git.author"])
13451347
assert.Equal(t, "super commit", mapParams2["git.message"])
1348+
assert.Equal(t, "bar", mapParams2["my.value"])
1349+
assert.Equal(t, "build", mapParams2["workflow.root.pipeline"])
13461350

13471351
}
13481352

engine/api/workflow/process_parameters.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,6 @@ func getParentParameters(w *sdk.WorkflowRun, nodeRuns []*sdk.WorkflowNodeRun) ([
185185
// keep p.Name as is
186186
} else if strings.HasPrefix(param.Name, "cds.") {
187187
param.Name = strings.Replace(param.Name, "cds.", prefix, 1)
188-
} else {
189-
param.Name = prefix + param.Name
190188
}
191189
parentParams = append(parentParams, param)
192190
}

0 commit comments

Comments
 (0)
0