From de36681e72eb6d019a59336c7324618285264078 Mon Sep 17 00:00:00 2001 From: Suresh Babu Tadisetty Date: Thu, 18 Jan 2018 15:43:50 +0530 Subject: [PATCH] Fill plan properties in Http Headers and ServiceBus Message Properties instead of body and increased the major version. (#6238) * Fill plan properties in Http Headers and ServiceBus Message Properties instead of body and increased the major version. * correct function spelling * mark headers as not mandatory fields --- .../resources.resjson/en-US/resources.resjson | 6 +- Tasks/AzureFunction/task.json | 12 +- Tasks/AzureFunction/task.loc.json | 266 +++++++++--------- .../resources.resjson/en-US/resources.resjson | 6 +- Tasks/InvokeRestApi/task.json | 10 +- Tasks/InvokeRestApi/task.loc.json | 10 +- .../resources.resjson/en-US/resources.resjson | 2 + Tasks/PublishToAzureServiceBus/task.json | 29 +- Tasks/PublishToAzureServiceBus/task.loc.json | 29 +- 9 files changed, 201 insertions(+), 169 deletions(-) diff --git a/Tasks/AzureFunction/Strings/resources.resjson/en-US/resources.resjson b/Tasks/AzureFunction/Strings/resources.resjson/en-US/resources.resjson index b0d7aa1cdb1a..1254890bbd19 100644 --- a/Tasks/AzureFunction/Strings/resources.resjson/en-US/resources.resjson +++ b/Tasks/AzureFunction/Strings/resources.resjson/en-US/resources.resjson @@ -9,7 +9,7 @@ "loc.input.label.key": "Function key", "loc.input.help.key": "Function or Host key with which we can access this function. To keep the key secure, define a secret variable and use it here. Example: - $(myFunctionKey) where myFunctionKey is an environment level secret variable with value as the secret key like ZxPXnIEODXLRzYwCw1TgZ4osMfoKs9Zn6se6X/N0FnztfDvZbdOmYw==", "loc.input.label.method": "Method", - "loc.input.help.method" : "Select the http method with which the funtion should be invoked with.", + "loc.input.help.method": "Select the http method with which the function should be invoked with.", "loc.input.label.headers": "Headers", "loc.input.help.headers": "Define header in JSON format. The header shall be attached with request to be sent.", "loc.input.label.queryParameters": "Query parameters", @@ -18,6 +18,6 @@ "loc.input.help.body": "JSON formatted message body for the request.", "loc.input.label.waitForCompletion": "Completion event", "loc.input.help.waitForCompletion": "Default value \"ApiResponse\". Available values : \"ApiResponse\", \"Callback\" call where the Azure function calls back to update the timeline record​.", - "loc.input.label.successCriteria": "Success criteria​", - "loc.input.help.successCriteria": "Criteria which defines when to pass the task. No criteria means response content does not influence the result. Example:- For response {\"status\" : \"successful\"}, the expression can be eq(root['status'], 'successful'). [More Information](https://go.microsoft.com/fwlink/?linkid=842996)" + "loc.input.label.successCriteria": "Success criteria", + "loc.input.help.successCriteria": "Criteria which defines when to pass the task. No criteria means response content does not influence the result. Example:- For response {\"status\" : \"successful\"}, the expression can be eq(root['status'], 'successful'). [More Information](https://go.microsoft.com/fwlink/?linkid=842996)​" } \ No newline at end of file diff --git a/Tasks/AzureFunction/task.json b/Tasks/AzureFunction/task.json index 0e422fb40f86..1820521e66e8 100644 --- a/Tasks/AzureFunction/task.json +++ b/Tasks/AzureFunction/task.json @@ -15,9 +15,9 @@ "ServerGate" ], "version": { - "Major": 0, + "Major": 1, "Minor": 0, - "Patch": 5 + "Patch": 0 }, "instanceNameFormat": "Azure Function: $(function)", "groups": [{ @@ -56,17 +56,17 @@ "TRACE": "TRACE", "PATCH": "PATCH" }, - "helpMarkDown": "Select the http method with which the funtion should be invoked with." + "helpMarkDown": "Select the http method with which the function should be invoked with." }, { "name": "headers", "type": "multiLine", "label": "Headers", "required": "false", - "defaultValue": "{\n\"Content-Type\":\"application/json\"\n}", + "defaultValue": "{\n\"Content-Type\":\"application/json\", \n\"PlanUrl\": \"$(system.CollectionUri)\", \n\"ProjectId\": \"$(system.TeamProjectId)\", \n\"HubName\": \"$(system.HostType)\", \n\"PlanId\": \"$(system.PlanId)\", \n\"JobId\": \"$(system.JobId)\", \n\"TimelineId\": \"$(system.TimelineId)\", \n\"TaskInstanceId\": \"$(system.TaskInstanceId)\", \n\"AuthToken\": \"$(system.AccessToken)\"\n}", "properties": { "resizable": "true", - "rows": "3", - "maxLength": "500" + "rows": "10", + "maxLength": "2000" }, "helpMarkDown": "Define header in JSON format. The header shall be attached with request to be sent." }, { diff --git a/Tasks/AzureFunction/task.loc.json b/Tasks/AzureFunction/task.loc.json index c2d52a03afc2..61b3d924905a 100644 --- a/Tasks/AzureFunction/task.loc.json +++ b/Tasks/AzureFunction/task.loc.json @@ -1,129 +1,137 @@ -{ - "id": "537FDB7A-A601-4537-AA70-92645A2B5CE4", - "name": "AzureFunction", - "friendlyName": "ms-resource:loc.friendlyName", - "description": "ms-resource:loc.description", - "author": "Microsoft Corporation", - "helpMarkDown": "ms-resource:loc.helpMarkDown", - "category": "Tool", - "preview": "true", - "visibility": [ - "Release" - ], - "runsOn": [ - "Server", - "ServerGate" - ], - "version": { - "Major": 0, - "Minor": 0, - "Patch": 5 - }, - "instanceNameFormat": "ms-resource:loc.instanceNameFormat", - "groups": [{ - "name": "completionOptions", - "displayName": "ms-resource:loc.group.displayName.completionOptions", - "isExpanded": false - } - ], - "inputs": [{ - "name": "function", - "type": "string", - "label": "ms-resource:loc.input.label.function", - "defaultValue": "", - "required": true, - "helpMarkDown": "ms-resource:loc.input.help.function" - }, { - "name": "key", - "type": "string", - "label": "ms-resource:loc.input.label.key", - "defaultValue": "", - "required": true, - "helpMarkDown": "ms-resource:loc.input.help.key" - }, { - "name": "method", - "type": "pickList", - "label": "ms-resource:loc.input.label.method", - "required": "true", - "defaultValue": "POST", - "options": { - "OPTIONS": "OPTIONS", - "GET": "GET", - "HEAD": "HEAD", - "POST": "POST", - "PUT": "PUT", - "DELETE": "DELETE", - "TRACE": "TRACE", - "PATCH": "PATCH" - }, - "helpMarkDown": "ms-resource:loc.input.help.method" - }, { - "name": "headers", - "type": "multiLine", - "label": "ms-resource:loc.input.label.headers", - "required": "false", - "defaultValue": "{\n\"Content-Type\":\"application/json\"\n}", - "properties": { - "resizable": "true", - "rows": "3", - "maxLength": "500" - }, - "helpMarkDown": "ms-resource:loc.input.help.headers" - }, { - "name": "queryParameters", - "type": "string", - "label": "ms-resource:loc.input.label.queryParameters", - "defaultValue": "", - "required": false, - "helpMarkDown": "ms-resource:loc.input.help.queryParameters" - }, { - "name": "body", - "type": "multiLine", - "label": "ms-resource:loc.input.label.body", - "required": "false", - "defaultValue": "", - "properties": { - "resizable": "true", - "rows": "3", - "maxLength": "2000" - }, - "visibleRule": "method != GET && method != HEAD", - "helpMarkDown": "ms-resource:loc.input.help.body" - }, { - "name": "waitForCompletion", - "type": "pickList", - "label": "ms-resource:loc.input.label.waitForCompletion", - "defaultValue": "false", - "required": true, - "helpMarkDown": "ms-resource:loc.input.help.waitForCompletion", - "groupName": "completionOptions", - "options": { - "true": "Callback", - "false": "ApiResponse" - } - }, { - "name": "successCriteria", - "type": "string", - "label": "ms-resource:loc.input.label.successCriteria", - "defaultValue": "", - "required": false, - "groupName": "completionOptions", - "visibleRule": "waitForCompletion = false", - "helpMarkDown": "ms-resource:loc.input.help.successCriteria" - } - ], - - "execution": { - "HttpRequest": { - "Execute": { - "EndpointId": "", - "EndpointUrl": "$(function)?code=$(key)&$(queryParameters)", - "Method": "$(method)", - "Body": "$(body)", - "Headers": "$(headers)", - "WaitForCompletion": "$(waitForCompletion)", - "Expression": "$(successCriteria)" - } - } - } -} +{ + "id": "537FDB7A-A601-4537-AA70-92645A2B5CE4", + "name": "AzureFunction", + "friendlyName": "ms-resource:loc.friendlyName", + "description": "ms-resource:loc.description", + "author": "Microsoft Corporation", + "helpMarkDown": "ms-resource:loc.helpMarkDown", + "category": "Utility", + "preview": "true", + "visibility": [ + "Release" + ], + "runsOn": [ + "Server", + "ServerGate" + ], + "version": { + "Major": 1, + "Minor": 0, + "Patch": 0 + }, + "instanceNameFormat": "ms-resource:loc.instanceNameFormat", + "groups": [ + { + "name": "completionOptions", + "displayName": "ms-resource:loc.group.displayName.completionOptions", + "isExpanded": false + } + ], + "inputs": [ + { + "name": "function", + "type": "string", + "label": "ms-resource:loc.input.label.function", + "defaultValue": "", + "required": true, + "helpMarkDown": "ms-resource:loc.input.help.function" + }, + { + "name": "key", + "type": "string", + "label": "ms-resource:loc.input.label.key", + "defaultValue": "", + "required": true, + "helpMarkDown": "ms-resource:loc.input.help.key" + }, + { + "name": "method", + "type": "pickList", + "label": "ms-resource:loc.input.label.method", + "required": "true", + "defaultValue": "POST", + "options": { + "OPTIONS": "OPTIONS", + "GET": "GET", + "HEAD": "HEAD", + "POST": "POST", + "PUT": "PUT", + "DELETE": "DELETE", + "TRACE": "TRACE", + "PATCH": "PATCH" + }, + "helpMarkDown": "ms-resource:loc.input.help.method" + }, + { + "name": "headers", + "type": "multiLine", + "label": "ms-resource:loc.input.label.headers", + "required": "false", + "defaultValue": "{\n\"Content-Type\":\"application/json\", \n\"PlanUrl\": \"$(system.CollectionUri)\", \n\"ProjectId\": \"$(system.TeamProjectId)\", \n\"HubName\": \"$(system.HostType)\", \n\"PlanId\": \"$(system.PlanId)\", \n\"JobId\": \"$(system.JobId)\", \n\"TimelineId\": \"$(system.TimelineId)\", \n\"TaskInstanceId\": \"$(system.TaskInstanceId)\", \n\"AuthToken\": \"$(system.AccessToken)\"\n}", + "properties": { + "resizable": "true", + "rows": "10", + "maxLength": "2000" + }, + "helpMarkDown": "ms-resource:loc.input.help.headers" + }, + { + "name": "queryParameters", + "type": "string", + "label": "ms-resource:loc.input.label.queryParameters", + "defaultValue": "", + "required": false, + "helpMarkDown": "ms-resource:loc.input.help.queryParameters" + }, + { + "name": "body", + "type": "multiLine", + "label": "ms-resource:loc.input.label.body", + "required": "false", + "defaultValue": "", + "properties": { + "resizable": "true", + "rows": "3", + "maxLength": "2000" + }, + "visibleRule": "method != GET && method != HEAD", + "helpMarkDown": "ms-resource:loc.input.help.body" + }, + { + "name": "waitForCompletion", + "type": "pickList", + "label": "ms-resource:loc.input.label.waitForCompletion", + "defaultValue": "false", + "required": true, + "helpMarkDown": "ms-resource:loc.input.help.waitForCompletion", + "groupName": "completionOptions", + "options": { + "true": "Callback", + "false": "ApiResponse" + } + }, + { + "name": "successCriteria", + "type": "string", + "label": "ms-resource:loc.input.label.successCriteria", + "defaultValue": "", + "required": false, + "helpMarkDown": "ms-resource:loc.input.help.successCriteria", + "groupName": "completionOptions", + "visibleRule": "waitForCompletion = false" + } + ], + "execution": { + "HttpRequest": { + "Execute": { + "EndpointId": "", + "EndpointUrl": "$(function)?code=$(key)&$(queryParameters)", + "Method": "$(method)", + "Body": "$(body)", + "Headers": "$(headers)", + "WaitForCompletion": "$(waitForCompletion)", + "Expression": "$(successCriteria)" + } + } + } +} \ No newline at end of file diff --git a/Tasks/InvokeRestApi/Strings/resources.resjson/en-US/resources.resjson b/Tasks/InvokeRestApi/Strings/resources.resjson/en-US/resources.resjson index 6acf254ff206..ac6e4f39d4cf 100644 --- a/Tasks/InvokeRestApi/Strings/resources.resjson/en-US/resources.resjson +++ b/Tasks/InvokeRestApi/Strings/resources.resjson/en-US/resources.resjson @@ -6,14 +6,14 @@ "loc.group.displayName.completionOptions": "Advanced", "loc.input.label.connectedServiceName": "Generic endpoint", "loc.input.help.connectedServiceName": "Select a generic endpoint that should be used to pick the url and construct authorization header for the http request.", - "loc.input.label.urlSuffix": "Url suffix and parameters", - "loc.input.help.urlSuffix": "Given string append to the url. Example: If endpoint url is https:...TestProj/_apis/Release/releases and url suffix is /2/environments/1, endpoint url becomes https:.../TestProj/_apis/Release/releases/2/environments/1. If url suffix is ?definitionId=1&releaseCount=1 then endpoint url becomes https//...TestProj/_apis/Release/releases?definitionId=1&releaseCount=1.", "loc.input.label.method": "Method", "loc.input.help.method": "Select the http method with which the API should be invoked with.", "loc.input.label.headers": "Headers", "loc.input.help.headers": "Define header in JSON format. The header shall be attached with request to be sent.", "loc.input.label.body": "Body", - "loc.input.label.waitForCompletion": "Completion event", + "loc.input.label.urlSuffix": "Url suffix and parameters", + "loc.input.help.urlSuffix": "Given string append to the url. Example: If endpoint url is https:...TestProj/_apis/Release/releases and url suffix is /2/environments/1, endpoint url becomes https:.../TestProj/_apis/Release/releases/2/environments/1. If url suffix is ?definitionId=1&releaseCount=1 then endpoint url becomes https//...TestProj/_apis/Release/releases?definitionId=1&releaseCount=1.", + "loc.input.label.waitForCompletion": "Completion event", "loc.input.help.waitForCompletion": "Default value \"ApiResponse\". Available values : \"ApiResponse\", \"Callback\" call where the REST API calls back to update the timeline record​.", "loc.input.label.successCriteria": "Success criteria", "loc.input.help.successCriteria": "Criteria which defines when to pass the task. No criteria means response content does not influence the result. Example:- For response {\"status\" : \"successful\"}, the expression can be eq(root['status'], 'successful'). [More Information](https://go.microsoft.com/fwlink/?linkid=842996)​" diff --git a/Tasks/InvokeRestApi/task.json b/Tasks/InvokeRestApi/task.json index e28609ea3d56..3278152ceda7 100644 --- a/Tasks/InvokeRestApi/task.json +++ b/Tasks/InvokeRestApi/task.json @@ -15,9 +15,9 @@ "ServerGate" ], "version": { - "Major": 0, + "Major": 1, "Minor": 0, - "Patch": 8 + "Patch": 0 }, "instanceNameFormat": "Invoke REST API: $(method)", "groups": [{ @@ -59,11 +59,11 @@ "type":"multiLine", "label":"Headers", "required":"false", - "defaultValue":"{\n\"Content-Type\":\"application/json\"\n}", + "defaultValue": "{\n\"Content-Type\":\"application/json\", \n\"PlanUrl\": \"$(system.CollectionUri)\", \n\"ProjectId\": \"$(system.TeamProjectId)\", \n\"HubName\": \"$(system.HostType)\", \n\"PlanId\": \"$(system.PlanId)\", \n\"JobId\": \"$(system.JobId)\", \n\"TimelineId\": \"$(system.TimelineId)\", \n\"TaskInstanceId\": \"$(system.TaskInstanceId)\", \n\"AuthToken\": \"$(system.AccessToken)\"\n}", "properties": { "resizable": "true", - "rows": "3", - "maxLength": "500" + "rows": "10", + "maxLength": "2000" }, "helpMarkDown": "Define header in JSON format. The header shall be attached with request to be sent." }, diff --git a/Tasks/InvokeRestApi/task.loc.json b/Tasks/InvokeRestApi/task.loc.json index aa5098a6858e..cc46325b9e58 100644 --- a/Tasks/InvokeRestApi/task.loc.json +++ b/Tasks/InvokeRestApi/task.loc.json @@ -15,9 +15,9 @@ "ServerGate" ], "version": { - "Major": 0, + "Major": 1, "Minor": 0, - "Patch": 8 + "Patch": 0 }, "instanceNameFormat": "ms-resource:loc.instanceNameFormat", "groups": [ @@ -62,11 +62,11 @@ "type": "multiLine", "label": "ms-resource:loc.input.label.headers", "required": "false", - "defaultValue": "{\n\"Content-Type\":\"application/json\"\n}", + "defaultValue": "{\n\"Content-Type\":\"application/json\", \n\"PlanUrl\": \"$(system.CollectionUri)\", \n\"ProjectId\": \"$(system.TeamProjectId)\", \n\"HubName\": \"$(system.HostType)\", \n\"PlanId\": \"$(system.PlanId)\", \n\"JobId\": \"$(system.JobId)\", \n\"TimelineId\": \"$(system.TimelineId)\", \n\"TaskInstanceId\": \"$(system.TaskInstanceId)\", \n\"AuthToken\": \"$(system.AccessToken)\"\n}", "properties": { "resizable": "true", - "rows": "3", - "maxLength": "500" + "rows": "10", + "maxLength": "2000" }, "helpMarkDown": "ms-resource:loc.input.help.headers" }, diff --git a/Tasks/PublishToAzureServiceBus/Strings/resources.resjson/en-US/resources.resjson b/Tasks/PublishToAzureServiceBus/Strings/resources.resjson/en-US/resources.resjson index 5b8290447d73..09ff30c5378d 100644 --- a/Tasks/PublishToAzureServiceBus/Strings/resources.resjson/en-US/resources.resjson +++ b/Tasks/PublishToAzureServiceBus/Strings/resources.resjson/en-US/resources.resjson @@ -7,6 +7,8 @@ "loc.input.help.connectedServiceName": "Select a Azure Service Bus connection.", "loc.input.label.messageBody": "Message body", "loc.input.help.messageBody": "Enter the json messageBody.", + "loc.input.label.messageProperties": "Message properties", + "loc.input.help.messageProperties": "Enter the json message properties.", "loc.input.label.waitForCompletion": "Wait for task completion", "loc.input.help.waitForCompletion": "If this is true, this task will wait for TaskCompleted event for the specified task timeout." } \ No newline at end of file diff --git a/Tasks/PublishToAzureServiceBus/task.json b/Tasks/PublishToAzureServiceBus/task.json index 42d0f00e17df..13737a498554 100644 --- a/Tasks/PublishToAzureServiceBus/task.json +++ b/Tasks/PublishToAzureServiceBus/task.json @@ -14,9 +14,9 @@ ], "author": "Microsoft Corporation", "version": { - "Major": 0, - "Minor": 1, - "Patch": 6 + "Major": 1, + "Minor": 0, + "Patch": 0 }, "preview": "true", "inputs": [ @@ -33,8 +33,8 @@ "name": "messageBody", "type": "multiLine", "label": "Message body", - "required": true, - "defaultValue": "{\"JobId\": \"$(system.jobId)\", \"PlanId\": \"$(system.planId)\", \"TimelineId\": \"$(system.timelineId)\", \"ProjectId\": \"$(system.teamProjectId)\", \"VstsUrl\": \"$(system.CollectionUri)\",\"AuthToken\": \"$(system.AccessToken)\"}", + "required": false, + "defaultValue": "", "helpMarkDown": "Enter the json messageBody.", "properties": { "resizable": "true", @@ -43,6 +43,20 @@ "editorExtension": "ms.vss-services-azure.azure-servicebus-message-grid" } }, + { + "name": "messageProperties", + "type": "multiLine", + "label": "Message properties", + "required": false, + "defaultValue": "{\n\"Content-Type\":\"application/json\", \n\"PlanUrl\": \"$(system.CollectionUri)\", \n\"ProjectId\": \"$(system.TeamProjectId)\", \n\"HubName\": \"$(system.HostType)\", \n\"PlanId\": \"$(system.PlanId)\", \n\"JobId\": \"$(system.JobId)\", \n\"TimelineId\": \"$(system.TimelineId)\", \n\"TaskInstanceId\": \"$(system.TaskInstanceId)\", \n\"AuthToken\": \"$(system.AccessToken)\"\n}", + "helpMarkDown": "Enter the json message properties.", + "properties": { + "resizable": "true", + "rows": "10", + "maxLength": "2000", + "editorExtension": "ms.vss-services-azure.azure-servicebus-message-grid" + } + }, { "name": "waitForCompletion", "type": "boolean", @@ -63,10 +77,7 @@ "connectionString": "$(endpoint.serviceBusConnectionString)", "serviceBusQueueName": "$(endpoint.serviceBusQueueName)", "messageBody": "$(messageBody)", - "messageProperties": { - "jobid": "$(system.jobId)", - "taskId": "$(system.taskId)" - } + "messageProperties": "$(messageProperties)" } } } diff --git a/Tasks/PublishToAzureServiceBus/task.loc.json b/Tasks/PublishToAzureServiceBus/task.loc.json index cb9d5e000de6..2c7a67085b2b 100644 --- a/Tasks/PublishToAzureServiceBus/task.loc.json +++ b/Tasks/PublishToAzureServiceBus/task.loc.json @@ -14,9 +14,9 @@ ], "author": "Microsoft Corporation", "version": { - "Major": 0, - "Minor": 1, - "Patch": 6 + "Major": 1, + "Minor": 0, + "Patch": 0 }, "preview": "true", "inputs": [ @@ -35,8 +35,8 @@ "name": "messageBody", "type": "multiLine", "label": "ms-resource:loc.input.label.messageBody", - "required": true, - "defaultValue": "{\"JobId\": \"$(system.jobId)\", \"PlanId\": \"$(system.planId)\", \"TimelineId\": \"$(system.timelineId)\", \"ProjectId\": \"$(system.teamProjectId)\", \"VstsUrl\": \"$(system.CollectionUri)\",\"AuthToken\": \"$(system.AccessToken)\"}", + "required": false, + "defaultValue": "", "helpMarkDown": "ms-resource:loc.input.help.messageBody", "properties": { "resizable": "true", @@ -45,6 +45,20 @@ "editorExtension": "ms.vss-services-azure.azure-servicebus-message-grid" } }, + { + "name": "messageProperties", + "type": "multiLine", + "label": "ms-resource:loc.input.label.messageProperties", + "required": false, + "defaultValue": "{\n\"Content-Type\":\"application/json\", \n\"PlanUrl\": \"$(system.CollectionUri)\", \n\"ProjectId\": \"$(system.TeamProjectId)\", \n\"HubName\": \"$(system.HostType)\", \n\"PlanId\": \"$(system.PlanId)\", \n\"JobId\": \"$(system.JobId)\", \n\"TimelineId\": \"$(system.TimelineId)\", \n\"TaskInstanceId\": \"$(system.TaskInstanceId)\", \n\"AuthToken\": \"$(system.AccessToken)\"\n}", + "helpMarkDown": "ms-resource:loc.input.help.messageProperties", + "properties": { + "resizable": "true", + "rows": "10", + "maxLength": "2000", + "editorExtension": "ms.vss-services-azure.azure-servicebus-message-grid" + } + }, { "name": "waitForCompletion", "type": "boolean", @@ -67,10 +81,7 @@ "connectionString": "$(endpoint.serviceBusConnectionString)", "serviceBusQueueName": "$(endpoint.serviceBusQueueName)", "messageBody": "$(messageBody)", - "messageProperties": { - "jobid": "$(system.jobId)", - "taskId": "$(system.taskId)" - } + "messageProperties": "$(messageProperties)" } } }