Skip to content

Commit 7a27981

Browse files
Fix legacy template parameter passing (#355)
* all scalars should be converted to string like for templatecontext of job/stage
1 parent 9f3d6a1 commit 7a27981

File tree

5 files changed

+28
-4
lines changed

5 files changed

+28
-4
lines changed

Diff for: src/Sdk/AzurePipelines/AzureDevops.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -706,11 +706,11 @@ public static async Task<MappingToken> ReadTemplate(Runner.Server.Azure.Devops.C
706706
var paramname = (kv.Key as StringToken)?.Value;
707707
if (cparameters?.TryGetValue(paramname, out var value) == true)
708708
{
709-
parametersData[paramname] = value.ToContextData();
709+
parametersData[paramname] = ConvertAllScalarsToString(value).ToContextData();
710710
}
711711
else
712712
{
713-
parametersData[paramname] = kv.Value.ToContextData();
713+
parametersData[paramname] = ConvertAllScalarsToString(kv.Value).ToContextData();
714714
}
715715
}
716716
}
@@ -776,7 +776,7 @@ public static async Task<MappingToken> ReadTemplate(Runner.Server.Azure.Devops.C
776776
templateContext.Errors.Check();
777777
if(!strictParametersCheck && cparameters != null) {
778778
foreach(var param in cparameters) {
779-
parametersData[param.Key] = param.Value.ToContextData();
779+
parametersData[param.Key] = ConvertAllScalarsToString(param.Value).ToContextData();
780780
}
781781
}
782782

Diff for: src/azure-pipelines-vscode-ext/CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
### v0.0.16
2+
- fix steps.*.continueOnError / allowed boolean values
3+
- make condition stricter
4+
- no longer accept `$[ ]` for conditions
5+
- check step conditions
6+
- fix invalid parameter passing to legacy templates using a parameter mapping or omit it
7+
- all scalars should be strings like for job/stage templateContext
8+
19
### v0.0.15
210
- fix variable templates using expressions in it's parameters
311
- fix empty dependsOn e.g. empty string is not a missing dependency

Diff for: src/azure-pipelines-vscode-ext/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"Programming Languages"
99
],
1010
"icon": "pipeline-rocket.png",
11-
"version": "0.0.15",
11+
"version": "0.0.16",
1212
"publisher": "christopherhx",
1313
"repository": "https://github.com/ChristopherHX/runner.server",
1414
"engines": {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
parameters:
2+
# 1es specific parameters
3+
is1ESPipeline: ''
4+
5+
jobs:
6+
- job:
7+
steps:
8+
- ${{ if eq(parameters.is1ESPipeline, '') }}:
9+
- 'Illegal entry point, is1ESPipeline is not defined. Repository yaml should not directly reference templates in core-templates folder.': error
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
jobs:
2+
- template: /job.yml
3+
parameters:
4+
is1ESPipeline: false
5+
6+
steps:
7+
- bash: exit 0

0 commit comments

Comments
 (0)