Skip to content

Commit cc8e4dd

Browse files
Anatoly BolshakovDanny McCormick
andauthored
DownloadSecureFileV1 - added socketTimeout input (#13800) (#13806)
* Added socketTimeout input * Localization and versions changes * Reverted changes for common package * Used updated secure fiels helpers package. Bumped task version * Updated secure common helpers package version * Changed version Co-authored-by: Danny McCormick <[email protected]> Co-authored-by: Danny McCormick <[email protected]>
1 parent ab8fc0d commit cc8e4dd

File tree

5 files changed

+29
-5
lines changed

5 files changed

+29
-5
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,7 @@
66
"loc.input.label.secureFile": "Secure File",
77
"loc.input.help.secureFile": "The file name or GUID of the secure file to download to the agent machine. The file will be deleted after the pipeline runs.",
88
"loc.input.label.retryCount": "Retry Count",
9-
"loc.input.help.retryCount": "Optional number of times to retry downloading a secure file if the download fails."
9+
"loc.input.help.retryCount": "Optional number of times to retry downloading a secure file if the download fails.",
10+
"loc.input.label.socketTimeout": "Socket Timeout",
11+
"loc.input.help.socketTimeout": "Optional timeout for a socket associated with downloading secure file request in ms."
1012
}

Tasks/DownloadSecureFileV1/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
"dependencies": {
2020
"@types/node": "^6.0.0",
2121
"azure-pipelines-task-lib": "^2.8.0",
22-
"azure-pipelines-tasks-securefiles-common": "1.0.0"
22+
"azure-pipelines-tasks-securefiles-common": "1.178.0"
2323
}
2424
}

Tasks/DownloadSecureFileV1/predownloadsecurefile.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,18 @@ async function run() {
1010
tl.setResourcePath(path.join(__dirname, 'task.json'));
1111

1212
let retryCount = parseInt(tl.getInput('retryCount'));
13+
let socketTimeout = parseInt(tl.getInput('socketTimeout'));
1314
if (isNaN(retryCount) || retryCount < 0) {
1415
retryCount = 8;
1516
}
17+
18+
if (isNaN(socketTimeout) || socketTimeout < 0) {
19+
socketTimeout = undefined;
20+
}
21+
1622
// download decrypted contents
1723
secureFileId = tl.getInput('secureFile', true);
18-
secureFileHelpers = new secureFilesCommon.SecureFileHelpers(retryCount);
24+
secureFileHelpers = new secureFilesCommon.SecureFileHelpers(retryCount, socketTimeout);
1925
let secureFilePath: string = await secureFileHelpers.downloadSecureFile(secureFileId);
2026

2127
if (tl.exist(secureFilePath)) {

Tasks/DownloadSecureFileV1/task.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"version": {
1515
"Major": 1,
1616
"Minor": 177,
17-
"Patch": 0
17+
"Patch": 1
1818
},
1919
"runsOn": [
2020
"Agent",
@@ -39,6 +39,14 @@
3939
"defaultValue": "8",
4040
"required": "false",
4141
"helpMarkDown": "Optional number of times to retry downloading a secure file if the download fails."
42+
},
43+
{
44+
"name": "socketTimeout",
45+
"type": "string",
46+
"label": "Socket Timeout",
47+
"defaultValue": "",
48+
"required": "false",
49+
"helpMarkDown": "Optional timeout for a socket associated with downloading secure file request in ms."
4250
}
4351
],
4452
"outputVariables": [

Tasks/DownloadSecureFileV1/task.loc.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"version": {
1515
"Major": 1,
1616
"Minor": 177,
17-
"Patch": 0
17+
"Patch": 1
1818
},
1919
"runsOn": [
2020
"Agent",
@@ -39,6 +39,14 @@
3939
"defaultValue": "8",
4040
"required": "false",
4141
"helpMarkDown": "ms-resource:loc.input.help.retryCount"
42+
},
43+
{
44+
"name": "socketTimeout",
45+
"type": "string",
46+
"label": "ms-resource:loc.input.label.socketTimeout",
47+
"defaultValue": "",
48+
"required": "false",
49+
"helpMarkDown": "ms-resource:loc.input.help.socketTimeout"
4250
}
4351
],
4452
"outputVariables": [

0 commit comments

Comments
 (0)