Skip to content

Commit f661274

Browse files
authored
UseDotNetV2: Enable HTTP retries when retrieving releases-index.json (#13923)
* Bump typed-rest-client and enable retries * Bump task version
1 parent 263df20 commit f661274

File tree

6 files changed

+45
-47
lines changed

6 files changed

+45
-47
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
"loc.input.help.workingDirectory": "Specify path from where global.json files should be searched when using `Use global json`. If empty, `system.DefaultWorkingDirectory` will be considered as the root path.",
1414
"loc.input.label.version": "Version",
1515
"loc.input.help.version": "Specify version of .NET Core SDK or runtime to install.<br/>Versions can be given in the following formats<li>2.x => Install latest in major version.</li><li>2.2.x => Install latest in major and minor version</li><li>2.2.104 => Install exact version</li><br/>Find the value of `version` for installing SDK/Runtime, from the releases.json. The link to releases.json of that major.minor version can be found in [**releases-index file.**](https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/releases-index.json). Like link to releases.json for 2.2 version is https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/2.2/releases.json",
16+
"loc.input.label.vsVersion": "Compatible Visual Studio version",
17+
"loc.input.help.vsVersion": "Specify version of compatible visual studio for which .NET core sdk to install. Specifiy complete vs-version like 16.6.4 containing major version, minor version and patch number.Find the value of `version` for installing SDK/Runtime, from the releases.json. The link to releases.json of that major.minor version can be found in [**releases-index file.**](https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/releases-index.json)",
1618
"loc.input.label.includePreviewVersions": "Include Preview Versions",
1719
"loc.input.help.includePreviewVersions": "Select if you want preview versions to be included while searching for latest versions, such as while searching 2.2.x. This setting is ignored if you specify an exact version, such as: 3.0.100-preview3-010431",
1820
"loc.input.label.installationPath": "Path To Install .Net Core",

Tasks/UseDotNetV2/package-lock.json

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

Tasks/UseDotNetV2/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"azure-pipelines-tool-lib": "0.11.0",
3131
"packaging-common": "file:../../_build/Tasks/Common/packaging-common-1.0.1.tgz",
3232
"semver": "6.3.0",
33-
"typed-rest-client": "0.11.0",
33+
"typed-rest-client": "1.8.0",
3434
"utility-common-v2": "file:../../_build/Tasks/Common/utility-common-v2-2.0.0.tgz"
3535
}
3636
}

Tasks/UseDotNetV2/task.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"author": "Microsoft Corporation",
1414
"version": {
1515
"Major": 2,
16-
"Minor": 175,
17-
"Patch": 1
16+
"Minor": 179,
17+
"Patch": 0
1818
},
1919
"satisfies": [
2020
"DotNetCore"

Tasks/UseDotNetV2/task.loc.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"author": "Microsoft Corporation",
1414
"version": {
1515
"Major": 2,
16-
"Minor": 175,
17-
"Patch": 1
16+
"Minor": 179,
17+
"Patch": 0
1818
},
1919
"satisfies": [
2020
"DotNetCore"
@@ -76,8 +76,8 @@
7676
"label": "ms-resource:loc.input.label.vsVersion",
7777
"defaultValue": "",
7878
"required": false,
79-
"helpMarkDown": "ms-resource:loc.input.help.vsVersion",
80-
"visibleRule": "useGlobalJson = false || packageType = runtime"
79+
"groupName": "advanced",
80+
"helpMarkDown": "ms-resource:loc.input.help.vsVersion"
8181
},
8282
{
8383
"name": "includePreviewVersions",
@@ -189,4 +189,4 @@
189189
"OnlyExplicitVersionAllowed": "ms-resource:loc.messages.OnlyExplicitVersionAllowed",
190190
"SupportPhaseNotPresentInChannel": "ms-resource:loc.messages.SupportPhaseNotPresentInChannel"
191191
}
192-
}
192+
}

Tasks/UseDotNetV2/versionfetcher.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,19 @@ export class DotNetCoreVersionFetcher {
2020
constructor(explicitVersioning: boolean = false) {
2121
this.explicitVersioning = explicitVersioning;
2222
let proxyUrl: string = tl.getVariable("agent.proxyurl");
23-
var requestOptions: httpInterfaces.IRequestOptions = proxyUrl ? {
24-
proxy: {
23+
var requestOptions: httpInterfaces.IRequestOptions = {
24+
allowRetries: true,
25+
maxRetries: 3
26+
};
27+
28+
if (proxyUrl) {
29+
requestOptions.proxy = {
2530
proxyUrl: proxyUrl,
2631
proxyUsername: tl.getVariable("agent.proxyusername"),
2732
proxyPassword: tl.getVariable("agent.proxypassword"),
2833
proxyBypassHosts: tl.getVariable("agent.proxybypasslist") ? JSON.parse(tl.getVariable("agent.proxybypasslist")) : null
2934
}
30-
} : {};
35+
}
3136

3237
this.httpCallbackClient = new httpClient.HttpClient(tl.getVariable("AZURE_HTTP_USER_AGENT"), null, requestOptions);
3338
this.channels = [];

0 commit comments

Comments
 (0)