Skip to content

Commit b8c959a

Browse files
[Rollout] Production rollout 2025-01-27 (#4386)
2 parents f1b6b9b + 2ef007f commit b8c959a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1285
-508
lines changed

.config/dotnet-tools.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"microsoft.dnceng.secretmanager": {
6-
"version": "1.1.0-beta.25057.2",
6+
"version": "1.1.0-beta.25071.2",
77
"commands": [
88
"secret-manager"
99
]
@@ -15,7 +15,7 @@
1515
]
1616
},
1717
"microsoft.dnceng.configuration.bootstrap": {
18-
"version": "1.1.0-beta.25057.2",
18+
"version": "1.1.0-beta.25071.2",
1919
"commands": [
2020
"bootstrap-dnceng-configuration"
2121
]

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
## Overview
44

5-
This repo is home of the services that help us construct .NET. Mainly, you can find the Maestro dependency flow system and the Darc CLI tool.
5+
This repo is home of the services that help us construct .NET. Mainly, you can find the **Product Construction Service** (previously *Maestro*) dependency flow system and the Darc CLI tool.
6+
7+
The service's main responsibility is opening and managing dependency update pull requests in .NET repositories. It is also responsible for [the code flow subscription between product repositories and the VMR](https://github.com/dotnet/arcade/blob/main/Documentation/UnifiedBuild/VMR-Full-Code-Flow.md).
68

79
## Development
810

eng/Version.Details.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@
8383
<Uri>https://github.com/dotnet/arcade</Uri>
8484
<Sha>4db725213dccb0d1102427bce1c39ba3117da7f7</Sha>
8585
</Dependency>
86-
<Dependency Name="Microsoft.DncEng.SecretManager" Version="1.1.0-beta.25057.2">
86+
<Dependency Name="Microsoft.DncEng.SecretManager" Version="1.1.0-beta.25071.2">
8787
<Uri>https://github.com/dotnet/dnceng</Uri>
88-
<Sha>53d0d22d1279882d461777706eef3d57275ad3cc</Sha>
88+
<Sha>919c3cbb47ad56b61ba59e3f0ccf6555d4607c7e</Sha>
8989
</Dependency>
90-
<Dependency Name="Microsoft.DncEng.Configuration.Bootstrap" Version="1.1.0-beta.25057.2">
90+
<Dependency Name="Microsoft.DncEng.Configuration.Bootstrap" Version="1.1.0-beta.25071.2">
9191
<Uri>https://github.com/dotnet/dnceng</Uri>
92-
<Sha>53d0d22d1279882d461777706eef3d57275ad3cc</Sha>
92+
<Sha>919c3cbb47ad56b61ba59e3f0ccf6555d4607c7e</Sha>
9393
</Dependency>
9494
</ToolsetDependencies>
9595
</Dependencies>

eng/Versions.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
<MicrosoftDotNetMetricsVersion>1.1.0-beta.25052.1</MicrosoftDotNetMetricsVersion>
3333
<MicrosoftDotNetServicesUtilityVersion>1.1.0-beta.25053.1</MicrosoftDotNetServicesUtilityVersion>
3434
<MicrosoftDotNetWebAuthenticationVersion>1.1.0-beta.25053.1</MicrosoftDotNetWebAuthenticationVersion>
35-
<MicrosoftDncEngSecretManagerVersion>1.1.0-beta.25057.2</MicrosoftDncEngSecretManagerVersion>
36-
<MicrosoftDncEngConfigurationBootstrapVersion>1.1.0-beta.25057.2</MicrosoftDncEngConfigurationBootstrapVersion>
35+
<MicrosoftDncEngSecretManagerVersion>1.1.0-beta.25071.2</MicrosoftDncEngSecretManagerVersion>
36+
<MicrosoftDncEngConfigurationBootstrapVersion>1.1.0-beta.25071.2</MicrosoftDncEngConfigurationBootstrapVersion>
3737
</PropertyGroup>
3838
<!--Package names-->
3939
<PropertyGroup>

eng/new-issue.ps1

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
### Creates an issue, assigns it to the PCS and UB projects, sets the area/size fields and opens the issue in the browser.
2+
### Parameters:
3+
### -t, --title <string> Title of the issue
4+
### -b, --body <string> Body of the issue
5+
### -a, --area <Pcs|Ri|Fr> Area of the issue
6+
### -s, --size <XS|S|M|L|XL|U> Size of the issue
7+
### Example: .\new-issue.ps1 -t Title -b Body -a Pcs -s M
8+
9+
[CmdletBinding(PositionalBinding=$false)]
10+
Param(
11+
[Alias('r')]
12+
[Parameter(Mandatory=$false)]
13+
[string]
14+
$Repo = 'dotnet/arcade-services',
15+
16+
[Alias('t')]
17+
[Parameter(Mandatory=$true)]
18+
[string]
19+
$Title,
20+
21+
[Alias('b')]
22+
[Parameter(Mandatory=$false)]
23+
[string]
24+
$Body,
25+
26+
[Alias('a')]
27+
[Parameter(Mandatory=$true)]
28+
[ValidateSet('Pcs', 'Ri', 'Fr')]
29+
[string]
30+
$Area,
31+
32+
[Alias('s')]
33+
[Parameter(Mandatory=$false)]
34+
[ValidateSet('XS', 'S', 'M', 'L', 'XL', 'U')]
35+
[string]
36+
$Size,
37+
38+
[Alias('ub')]
39+
[switch]
40+
$UnifiedBuild
41+
)
42+
43+
$ErrorActionPreference = 'Stop'
44+
$PSNativeCommandUseErrorActionPreference = $true
45+
46+
$pcsProject = 276;
47+
$ubProject = 310;
48+
49+
switch ($Area) {
50+
'Pcs' { $areaName = 'Product Construction' }
51+
'Ri' { $areaName = 'Release Infrastructure' }
52+
'Fr' { $areaName = 'First Responder / Ops / Debt' }
53+
}
54+
55+
function Set-ProjectProperty($projectId, $issue, $property, $value) {
56+
$project = gh project view --owner dotnet --format json $projectId | ConvertFrom-Json
57+
$projectItem = gh project item-add $projectId --owner dotnet --url $issue.url --format json | ConvertFrom-Json
58+
$field = gh project field-list $projectId --format json --owner dotnet --jq ".fields[] | select(.name == `"$property`")" | ConvertFrom-Json
59+
$option = $field.options | Where-Object { $_.name -eq $value }
60+
gh project item-edit --id $projectItem.id --project-id $project.id --field-id $field.id --single-select-option-id $option.id
61+
}
62+
63+
$issueUrl = gh issue create --title "$Title" --body "$Body" --repo $Repo
64+
Write-Host "Created issue $issueUrl"
65+
$issue = gh issue view $issueUrl --json id,url | ConvertFrom-Json
66+
67+
Set-ProjectProperty $pcsProject $issue 'Area' $areaName
68+
69+
if ($UnifiedBuild) {
70+
if ($Area -eq 'Ri') {
71+
$areaName = 'Release Infra'
72+
}
73+
74+
if ($Area -ne 'Fr') {
75+
Set-ProjectProperty $ubProject $issue 'Area' $areaName
76+
if ($Size) {
77+
Set-ProjectProperty $ubProject $issue 'Size' $Size
78+
}
79+
}
80+
}
81+
82+
start $issue.url

src/Maestro/Maestro.MergePolicies/AllChecksSuccessfulMergePolicy.cs

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,17 @@ public override async Task<MergePolicyEvaluationResult> EvaluateAsync(IPullReque
3636
return Pending("Waiting for checks.");
3737
}
3838

39-
ILookup<CheckState, Check> statuses = notIgnoredChecks.ToLookup(
40-
c =>
39+
// Group check statuses to success, pending and error
40+
ILookup<CheckState, Check> statuses = notIgnoredChecks.ToLookup(c =>
41+
c.Status switch
4142
{
42-
// unify the check statuses to success, pending, and error
43-
return c.Status switch
44-
{
45-
CheckState.Success or CheckState.Pending => c.Status,
46-
_ => CheckState.Error,
47-
};
43+
CheckState.Success or CheckState.Pending => c.Status,
44+
_ => CheckState.Error,
4845
});
4946

5047
int ListChecksCount(CheckState state)
5148
{
52-
return statuses[state].Select(c => c.Name).Count();
49+
return statuses[state].Count();
5350
}
5451

5552
if (statuses.Contains(CheckState.Error))
@@ -59,15 +56,15 @@ int ListChecksCount(CheckState state)
5956
{
6057
listChecks.AppendLine($"[{status.Name}]({status.Url})");
6158
}
62-
return Fail($"Unsuccessful checks: {ListChecksCount(CheckState.Error)}", $"{listChecks}");
59+
return Fail($"{ListChecksCount(CheckState.Error)} unsuccessful check(s)", listChecks.ToString());
6360
}
6461

6562
if (statuses.Contains(CheckState.Pending))
6663
{
67-
return Pending($"Waiting on checks: {ListChecksCount(CheckState.Pending)}");
64+
return Pending($"{ListChecksCount(CheckState.Pending)} pending check(s)");
6865
}
6966

70-
return Succeed($"Successful checks: {ListChecksCount(CheckState.Success)}");
67+
return Succeed($"{ListChecksCount(CheckState.Success)} successful check(s)");
7168
}
7269
}
7370

@@ -78,7 +75,6 @@ public class AllChecksSuccessfulMergePolicyBuilder : IMergePolicyBuilder
7875
public Task<IReadOnlyList<IMergePolicy>> BuildMergePoliciesAsync(MergePolicyProperties properties, IPullRequest pr)
7976
{
8077
var ignoreChecks = new HashSet<string>(properties.Get<string[]>("ignoreChecks") ?? []);
81-
IReadOnlyList<IMergePolicy> policies = new List<IMergePolicy> { new AllChecksSuccessfulMergePolicy(ignoreChecks) };
82-
return Task.FromResult(policies);
78+
return Task.FromResult<IReadOnlyList<IMergePolicy>>([new AllChecksSuccessfulMergePolicy(ignoreChecks)]);
8379
}
8480
}

src/Microsoft.DotNet.Darc/Darc/Operations/AddSubscriptionOperation.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,15 +245,22 @@ public override async Task<int> ExecuteAsync()
245245

246246
// Verify the target
247247
IRemote targetVerifyRemote = await _remoteFactory.CreateRemoteAsync(targetRepository);
248-
if (!await UxHelpers.VerifyAndConfirmBranchExistsAsync(targetVerifyRemote, targetRepository, targetBranch, !_options.Quiet, onlyCheckBranch: sourceEnabled))
248+
249+
bool onlyCheckBranch = sourceEnabled && !string.IsNullOrEmpty(targetDirectory);
250+
bool targetBranchExists = await UxHelpers.VerifyAndConfirmBranchExistsAsync(targetVerifyRemote, targetRepository, targetBranch, !_options.Quiet, onlyCheckBranch);
251+
252+
if (!targetBranchExists)
249253
{
250254
Console.WriteLine("Aborting subscription creation.");
251255
return Constants.ErrorCode;
252256
}
253257

254258
// Verify the source.
255259
IRemote sourceVerifyRemote = await _remoteFactory.CreateRemoteAsync(sourceRepository);
256-
if (!await UxHelpers.VerifyAndConfirmRepositoryExistsAsync(sourceVerifyRemote, sourceRepository, !_options.Quiet))
260+
261+
bool sourceRepositoryExists = await UxHelpers.VerifyAndConfirmRepositoryExistsAsync(sourceVerifyRemote, sourceRepository, !_options.Quiet);
262+
263+
if (!sourceRepositoryExists)
257264
{
258265
Console.WriteLine("Aborting subscription creation.");
259266
return Constants.ErrorCode;

src/Microsoft.DotNet.Darc/Darc/Operations/VirtualMonoRepo/BackflowOperation.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ internal class BackflowOperation(
1919
IVmrInfo vmrInfo,
2020
IVmrDependencyTracker dependencyTracker,
2121
ILocalGitRepoFactory localGitRepoFactory,
22+
IBasicBarClient basicBarClient,
2223
ILogger<BackflowOperation> logger)
2324
: CodeFlowOperation(options, vmrInfo, dependencyTracker, localGitRepoFactory, logger)
2425
{
@@ -30,10 +31,13 @@ protected override async Task<bool> FlowAsync(
3031
NativePath targetDirectory,
3132
CancellationToken cancellationToken)
3233
{
34+
var build = await basicBarClient.GetBuildAsync(_options.Build
35+
?? throw new ArgumentException("Please specify a build to flow"));
36+
3337
return await vmrBackFlower.FlowBackAsync(
3438
mappingName,
3539
targetDirectory,
36-
_options.Build ?? throw new Exception("Please specify a build to flow"),
40+
build,
3741
excludedAssets: null,
3842
await GetBaseBranch(targetDirectory),
3943
await GetTargetBranch(_vmrInfo.VmrPath),

src/Microsoft.DotNet.Darc/Darc/Operations/VirtualMonoRepo/ForwardFlowOperation.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,30 @@ internal class ForwardFlowOperation(
1919
IVmrInfo vmrInfo,
2020
IVmrDependencyTracker dependencyTracker,
2121
ILocalGitRepoFactory localGitRepoFactory,
22+
IBasicBarClient basicBarClient,
2223
ILogger<ForwardFlowOperation> logger)
2324
: CodeFlowOperation(options, vmrInfo, dependencyTracker, localGitRepoFactory, logger)
2425
{
2526
private readonly ForwardFlowCommandLineOptions _options = options;
27+
private readonly IVmrInfo _vmrInfo = vmrInfo;
2628

2729
protected override async Task<bool> FlowAsync(
2830
string mappingName,
2931
NativePath repoPath,
3032
CancellationToken cancellationToken)
3133
{
34+
var build = await basicBarClient.GetBuildAsync(_options.Build
35+
?? throw new ArgumentException("Please specify a build to flow"));
36+
3237
return await vmrForwardFlower.FlowForwardAsync(
3338
mappingName,
3439
repoPath,
35-
_options.Build ?? throw new Exception("Please specify a build to flow"),
40+
build,
3641
excludedAssets: null,
3742
await GetBaseBranch(new NativePath(_options.VmrPath)),
3843
await GetTargetBranch(repoPath),
44+
_vmrInfo.VmrPath,
3945
_options.DiscardPatches,
40-
cancellationToken);
46+
cancellationToken: cancellationToken);
4147
}
4248
}

src/Microsoft.DotNet.Darc/Darc/Operations/VirtualMonoRepo/UpdateOperation.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,13 @@ protected override async Task ExecuteInternalAsync(
3535
await _vmrUpdater.UpdateRepository(
3636
repoName,
3737
targetRevision,
38-
targetVersion: null,
39-
officialBuildId: null,
40-
barId: null,
4138
_options.Recursive,
4239
additionalRemotes,
4340
_options.TpnTemplate,
4441
_options.GenerateCodeowners,
4542
_options.GenerateCredScanSuppressions,
4643
_options.DiscardPatches,
47-
reapplyVmrPatches: false,
4844
_options.EnableBuildLookUp,
49-
cancellationToken);
45+
cancellationToken: cancellationToken);
5046
}
5147
}

0 commit comments

Comments
 (0)