8000 [main] Source code updates from dotnet/arcade (#1622) · dotnet/dotnet@2fb064e · GitHub
[go: up one dir, main page]

Skip to content

Commit 2fb064e

Browse files
[main] Source code updates from dotnet/arcade (#1622)
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
1 parent 2010279 commit 2fb064e

File tree

5 files changed

+32
-25
lines changed

5 files changed

+32
-25
lines changed

src/arcade/eng/common/core-templates/jobs/jobs.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ jobs:
8383
- template: /eng/common/core-templates/jobs/source-build.yml
8484
parameters:
8585
is1ESPipeline: ${{ parameters.is1ESPipeline }}
86-
allCompletedJobId: Source_Build_Complete
8786
${{ each parameter in parameters.sourceBuildParameters }}:
8887
${{ parameter.key }}: ${{ parameter.value }}
8988

@@ -108,8 +107,6 @@ jobs:
108107
- ${{ if eq(parameters.publishBuildAssetsDependsOn, '') }}:
109108
- ${{ each job in parameters.jobs }}:
110109
- ${{ job.job }}
111-
- ${{ if eq(parameters.enableSourceBuild, true) }}:
112-
- Source_Build_Complete
113110

114111
runAsPublic: ${{ parameters.runAsPublic }}
115112
publishAssetsImmediately: ${{ or(parameters.publishAssetsImmediately, parameters.isAssetlessBuild) }}

src/arcade/eng/common/core-templates/jobs/source-build.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@ parameters:
22
# This template adds arcade-powered source-build to CI. A job is created for each platform, as
33
# well as an optional server job that completes when all platform jobs complete.
44

5-
# The name of the "join" job for all source-build platforms. If set to empty string, the job is
6-
# not included. Existing repo pipelines can use this job depend on all source-build jobs
7-
# completing without maintaining a separate list of every single job ID: just depend on this one
8-
# server job. By default, not included. Recommended name if used: 'Source_Build_Complete'.
9-
allCompletedJobId: ''
10-
115
# See /eng/common/core-templates/job/source-build.yml
126
jobNamePrefix: 'Source_Build'
137

@@ -31,16 +25,6 @@ parameters:
3125

3226
jobs:
3327

34-
- ${{ if ne(parameters.allCompletedJobId, '') }}:
35-
- job: ${{ parameters.allCompletedJobId }}
36-
displayName: Source-Build Complete
37-
pool: server
38-
dependsOn:
39-
- ${{ each platform in parameters.platforms }}:
40-
- ${{ parameters.jobNamePrefix }}_${{ platform.name }}
41-
- ${{ if eq(length(parameters.platforms), 0) }}:
42-
- ${{ parameters.jobNamePrefix }}_${{ parameters.defaultManagedPlatform.name }}
43-
4428
- ${{ each platform in parameters.platforms }}:
4529
- template: /eng/common/core-templates/job/source-build.yml
4630
parameters:

src/arcade/src/Microsoft.DotNet.Arcade.Sdk/tools/Microsoft.Testing.Platform/Microsoft.Testing.Platform.targets

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66
<_TestEnvironment>%(TestToRun.EnvironmentDisplay)</_TestEnvironment>
77
<_TestAssembly>%(TestToRun.Identity)</_TestAssembly>
88
<_TestRunner>%(TestToRun.RunCommand)</_TestRunner>
9+
<_RunArguments>%(TestToRun.RunArguments)</_RunArguments>
910
<_TestRuntime>%(TestToRun.TestRuntime)</_TestRuntime>
1011
<_TestTimeout>%(TestToRun.TestTimeout)</_TestTimeout>
11-
<_TestRunnerAdditionalArguments>$(TestToRun.RunArguments) %(TestToRun.TestRunnerAdditionalArguments)</_TestRunnerAdditionalArguments>
12+
<_TestRunnerAdditionalArguments>%(TestToRun.TestRunnerAdditionalArguments)</_TestRunnerAdditionalArguments>
13+
<_TestRunnerAdditionalArguments>$(_RunArguments) $(_TestRunnerAdditionalArguments)</_TestRunnerAdditionalArguments>
1214

1315
<_TestResultDirectory>$([System.IO.Path]::GetDirectoryName('%(TestToRun.ResultsTrxPath)'))</_TestResultDirectory>
1416
<_TestResultTrxFileName>$([System.IO.Path]::GetFileName('%(TestToRun.ResultsTrxPath)'))</_TestResultTrxFileName>
15-
<_TestRunnerArgs>"$(_TestRunner)" $(_TestRunnerAdditionalArguments) --no-progress --report-trx --report-trx-filename "$(_TestResultTrxFileName)" --results-directory "$(_TestResultDirectory)"</_TestRunnerArgs>
17+
<_TestRunnerArgs>$(_TestRunnerAdditionalArguments) --no-progress --report-trx --report-trx-filename "$(_TestResultTrxFileName)" --results-directory "$(_TestResultDirectory)"</_TestRunnerArgs>
1618
</PropertyGroup>
1719

1820
<!-- Validate that non-Core workloads use executable files, not DLL files -->

src/arcade/src/Microsoft.DotNet.Build.Tasks.Feed/src/PublishBuildToMaestro.cs

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,8 +546,32 @@ private void LookupForMatchingGitHubRepository(BuildIdentity buildIdentity)
546546
client.BaseAddress = new Uri($"https://api.{gitHubHost}");
547547
client.DefaultRequestHeaders.Add("User-Agent", "PushToBarTask");
548548

549-
HttpResponseMessage response =
550-
client.GetAsync($"/repos/{repoIdentity}/commits/{buildIdentity.Commit}").Result;
549+
string url = $"/repos/{repoIdentity}/commits/{buildIdentity.Commit}";
550+
HttpResponseMessage response = client.GetAsync(url).Result;
551+
552+
const int MaxRetries = 5;
553+
for (int retry = 1; retry <= MaxRetries && response.StatusCode == System.Net.HttpStatusCode.TooManyRequests; retry++)
554+
{
555+
TimeSpan timeSpan;
556+
if (response.Headers.RetryAfter?.Delta != null)
557+
{
558+
timeSpan = response.Headers.RetryAfter.Delta.Value;
559+
}
560+
else if (response.Headers.RetryAfter?.Date != null)
561+
{
562+
timeSpan = response.Headers.RetryAfter.Date.Value - DateTimeOffset.UtcNow;
563+
}
564+
else
565+
{
566+
const int defaultRetryAfterSeconds = 10;
567+
timeSpan = TimeSpan.FromSeconds(defaultRetryAfterSeconds);
568+
}
569+
570+
Log.LogMessage(MessageImportance.High,
571+
$"API rate limit exceeded, retrying in {timeSpan.TotalSeconds} seconds. Retry attempt: {retry}");
572+
Thread.Sleep(timeSpan);
573+
response = client.GetAsync(url).Result;
574+
}
551575

552576
if (response.IsSuccessStatusCode)
553577
{

src/source-manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"repositories": [
33
{
4-
"barId": 276435,
4+
"barId": 276631,
55
"path": "arcade",
66
"remoteUri": "https://github.com/dotnet/arcade",
7-
"commitSha": "2586309f3f8553152e2d1d54612e9199975f9cd4"
7+
"commitSha": "0fbc9e8711fa91e68c2bf3db376fb83b46f4ac35"
88
},
99
{
1010
"barId": 276610,

0 commit comments

Comments
 (0)
0