diff --git a/src/Sdk/AzurePipelines/azurepiplines.json b/src/Sdk/AzurePipelines/azurepiplines.json index 8c97c1c0656..bd7d0c36c9c 100644 --- a/src/Sdk/AzurePipelines/azurepiplines.json +++ b/src/Sdk/AzurePipelines/azurepiplines.json @@ -2087,7 +2087,11 @@ "type": "azp-mapping" } } - } + }, + "context": [ + "parameters", + "variables" + ] }, "jobsTemplate-0": { "mapping": { diff --git a/src/Sdk/AzurePipelines/json-schema-transform.js b/src/Sdk/AzurePipelines/json-schema-transform.js index 59998b07920..5faf9d904f7 100644 --- a/src/Sdk/AzurePipelines/json-schema-transform.js +++ b/src/Sdk/AzurePipelines/json-schema-transform.js @@ -216,11 +216,12 @@ for(var id in schema.definitions) { } var pathsWithExpressions = [ - [ "pipeline", "variables" ], - [ "pipeline", "stages" ], - [ "pipeline", "jobs" ], - [ "pipeline", "steps" ], - [ "resources", "containers" ], + [ ["pipeline", "variablesTemplate"], "variables" ], + [ ["pipeline", "stagesTemplate"], "stages" ], + [ ["pipeline", "jobsTemplate" ], "jobs" ], + [ ["pipeline", "stepsTemplate"], "steps" ], + [ "pipeline", "extends" ], + [ "pipeline", "resources", "containers" ], [ "any_allowExpressions" ], [ "string_allowExpressions" ], [ "sequenceOfString_allowExpressions" ], @@ -228,6 +229,15 @@ var pathsWithExpressions = [ function * traverse(path) { var comp = path[0]; + if(comp instanceof Array) { + for(var sk of comp) { + var subPath = [...path] + subPath[0] = sk + for(var r of traverse(subPath)) { + yield r; + } + } + } var schema = targetSchema.definitions[comp]; if(!schema) { return; @@ -288,4 +298,9 @@ targetSchema.definitions["nonEmptyString"] = { targetSchema.definitions["task-task"] = targetSchema.definitions["nonEmptyString"] +// delete targetSchema.definitions["any"] + +targetSchema.definitions["azp-any"]["one-of"].push("boolean", "null", "number") +targetSchema.definitions["any_allowExpressions"]["one-of"].push("boolean", "null", "number") + console.log(JSON.stringify(targetSchema, null, 4)) \ No newline at end of file diff --git a/src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateEvaluator.cs b/src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateEvaluator.cs index a29ed23b486..6ee697fbf44 100644 --- a/src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateEvaluator.cs +++ b/src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateEvaluator.cs @@ -250,7 +250,7 @@ private void HandleMappingWithWellKnownProperties( } // Only one - if (mappingDefinitions.Count > 1) + if (mappingDefinitions.Count > 1 && !hasExpressionKey) { var hitCount = new Dictionary(); foreach (MappingDefinition mapdef in mappingDefinitions) diff --git a/src/azure-pipelines-vscode-ext/CHANGELOG.md b/src/azure-pipelines-vscode-ext/CHANGELOG.md index b3c333f2436..de14287cd08 100644 --- a/src/azure-pipelines-vscode-ext/CHANGELOG.md +++ b/src/azure-pipelines-vscode-ext/CHANGELOG.md @@ -1,3 +1,6 @@ +### v0.0.21 (Preview) +- Add lost context access for pipeline.extends of v0.0.20 + ### v0.0.20 (Preview) - Use a full azure pipelines schema generated from the official extension / yamlschema service diff --git a/src/azure-pipelines-vscode-ext/package.json b/src/azure-pipelines-vscode-ext/package.json index 8930627d108..165160c0d67 100644 --- a/src/azure-pipelines-vscode-ext/package.json +++ b/src/azure-pipelines-vscode-ext/package.json @@ -8,7 +8,7 @@ "Programming Languages" ], "icon": "pipeline-rocket.png", - "version": "0.0.20", + "version": "0.0.21", "publisher": "christopherhx", "repository": "https://github.com/ChristopherHX/runner.server", "engines": {