Skip to content

Commit 1d12444

Browse files
authored
Adding errorOnInvalidSubstitution checkbox (#20858)
1 parent 5ce6f76 commit 1d12444

File tree

7 files changed

+29
-11
lines changed

7 files changed

+29
-11
lines changed

Tasks/FileTransformV2/Strings/resources.resjson/en-US/resources.resjson

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
"loc.input.help.jsonTargetFiles": "Provide new line separated list of files to substitute the variable values. Files names are to be provided relative to the root folder. <br/> <br/> For example, to replace the value of ‘ConnectionString’ in the sample below, you need to define a variable as ‘Data.DefaultConnection.ConnectionString’ in the build or release pipeline (or release pipeline's environment). <br/> {<br/>&nbsp;&nbsp;\"Data\": {<br/>&nbsp;&nbsp;&nbsp;&nbsp;\"DefaultConnection\": {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"ConnectionString\": \"Server=(localdb)\\SQLEXPRESS;Database=MyDB;Trusted_Connection=True\"<br/>&nbsp;&nbsp;&nbsp;&nbsp;}<br/>&nbsp;&nbsp;}<br/> } <br/> Variable Substitution is run after configuration transforms. </br> </br> Note: Only custom variables defined in build/release pipelines are used in substitution. Default/system defined pipeline variables are excluded. <br/>Note: If same variables are defined in the release pipeline and in the stage, then the stage variables will supersede the release pipeline variables. ",
1616
"loc.input.label.xmlTargetFiles": "XML target files",
1717
"loc.input.help.xmlTargetFiles": "Provide new line separated list of files to substitute the variable values. Files names are to be provided relative to the root folder. <br/>For XML, Variables defined in the build or release pipelines will be matched against the 'key' or 'name' entries in the appSettings, applicationSettings, and connectionStrings sections of any config file and parameters.xml. <br/> Variable Substitution is run after configuration transforms. </br> Note: Only custom variables defined in build/release pipelines are used in substitution. Default/system defined pipeline variables are excluded. <br/>Note: If same variables are defined in the release pipeline and in the stage, then the stage variables will supersede the release pipeline variables.",
18+
"loc.input.label.errorOnInvalidSubstitution": "Error on empty files and invalid substitution.",
19+
"loc.input.help.errorOnInvalidSubstitution": "If selected, the pipeline fails if the target files are empty or if the substitution fails.",
1820
"loc.messages.JSONvariablesubstitutionappliedsuccessfully": "JSON variable substitution applied successfully.",
1921
"loc.messages.FailedToApplyJSONvariablesubstitution": "Failed to apply JSON variable substitution.",
2022
"loc.messages.FailedToApplyJSONvariablesubstitutionReason1": "Failed to apply JSON variable substitution. Changes are already present in the package.",

Tasks/FileTransformV2/_buildConfigs/Node20/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Tasks/FileTransformV2/_buildConfigs/Node20/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@types/mocha": "^5.2.7",
2121
"@types/node": "^20.3.1",
2222
"@types/q": "1.0.7",
23-
"azure-pipelines-tasks-webdeployment-common": "4.252.0",
23+
"azure-pipelines-tasks-webdeployment-common": "4.253.0",
2424
"q": "1.4.1"
2525
},
2626
"devDependencies": {

Tasks/FileTransformV2/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Tasks/FileTransformV2/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@types/mocha": "^5.2.7",
2121
"@types/node": "^20.3.1",
2222
"@types/q": "1.0.7",
23-
"azure-pipelines-tasks-webdeployment-common": "4.252.0",
23+
"azure-pipelines-tasks-webdeployment-common": "4.253.0",
2424
"q": "1.4.1"
2525
},
2626
"devDependencies": {

Tasks/FileTransformV2/task.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
],
1818
"version": {
1919
"Major": 2,
20-
"Minor": 252,
20+
"Minor": 253,
2121
"Patch": 0
2222
},
2323
"releaseNotes": "More optimized task fields that allow users to enable any/all of the transformation (XML), variable substitution (JSON and XML) features in a single task instance.</br>Task fails when any of the configured transformation/substitution is NOT applied or when the task is no-op.",
@@ -72,6 +72,14 @@
7272
"defaultValue": "",
7373
"groupName": "VariableSubstitution",
7474
"helpMarkDown": "Provide new line separated list of files to substitute the variable values. Files names are to be provided relative to the root folder. <br/>For XML, Variables defined in the build or release pipelines will be matched against the 'key' or 'name' entries in the appSettings, applicationSettings, and connectionStrings sections of any config file and parameters.xml. <br/> Variable Substitution is run after configuration transforms. </br> Note: Only custom variables defined in build/release pipelines are used in substitution. Default/system defined pipeline variables are excluded. <br/>Note: If same variables are defined in the release pipeline and in the stage, then the stage variables will supersede the release pipeline variables."
75+
},
76+
{
77+
"name": "errorOnInvalidSubstitution",
78+
"type": "boolean",
79+
"label": "Error on empty files and invalid substitution.",
80+
"required": false,
81+
"defaultValue": false,
82+
"helpMarkDown": "If selected, the pipeline fails if the target files are empty or if the substitution fails."
7583
}
7684
],
7785
"execution": {

Tasks/FileTransformV2/task.loc.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
],
1818
"version": {
1919
"Major": 2,
20-
"Minor": 252,
20+
"Minor": 253,
2121
"Patch": 0
2222
},
2323
"releaseNotes": "ms-resource:loc.releaseNotes",
@@ -72,6 +72,14 @@
7272
"defaultValue": "",
7373
"groupName": "VariableSubstitution",
7474
"helpMarkDown": "ms-resource:loc.input.help.xmlTargetFiles"
75+
},
76+
{
77+
"name": "errorOnInvalidSubstitution",
78+
"type": "boolean",
79+
"label": "ms-resource:loc.input.label.errorOnInvalidSubstitution",
80+
"required": false,
81+
"defaultValue": false,
82+
"helpMarkDown": "ms-resource:loc.input.help.errorOnInvalidSubstitution"
7583
}
7684
],
7785
"execution": {

0 commit comments

Comments
 (0)