Skip to content

Commit

Permalink
[Rollout] Production rollout 2025-01-20 (#4346)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-purma authored Jan 20, 2025
2 parents 6c7cc1d + 53f49d3 commit 5528392
Show file tree
Hide file tree
Showing 64 changed files with 1,551 additions and 409 deletions.
26 changes: 0 additions & 26 deletions .vault-config/maestroint.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions .vault-config/maestrolocal.yaml

This file was deleted.

27 changes: 0 additions & 27 deletions .vault-config/maestroprod.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions .vault-config/product-construction-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,6 @@ storageLocation:
subscription: e6b5f9f5-0ca4-4351-879b-014d78400ec2
name: ProductConstructionDev

references:
helixkv:
type: azure-key-vault
parameters:
subscription: a4fc5514-21a9-4296-bfaf-5c7ee7fa35d1
name: helixkv

engkeyvault:
type: azure-key-vault
parameters:
subscription: a4fc5514-21a9-4296-bfaf-5c7ee7fa35d1
name: engkeyvault

secrets:

github:
Expand Down
6 changes: 0 additions & 6 deletions .vault-config/shared/maestro-secrets.yaml

This file was deleted.

5 changes: 5 additions & 0 deletions docs/DevGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
- Be sure to install the `Azure Development => .NET Aspire SDK (Preview)` optional workload in the VS installer
- Be sure to install the `ASP.NET and web development` => `.NET 8.0/9.0 WebAssembly Build Tools`
1. Install Docker Desktop: https://www.docker.com/products/docker-desktop
1. Configure git to support long paths:
```ps1
git config --system core.longpaths true # you will need elevated shell for this one
git config --global core.longpaths true
```
1. Install SQL Server Express: https://www.microsoft.com/en-us/sql-server/sql-server-downloads
1. Install Entity Framework Core CLI by running `dotnet tool install --global dotnet-ef`
1. Build the `src\Maestro\Maestro.Data\Maestro.Data.csproj` project (either from console or from IDE)
Expand Down
24 changes: 12 additions & 12 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,29 +59,29 @@
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.25060.1">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.25066.6">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>c255aae7f2b128fa20a4441f0e192c3c53561621</Sha>
<Sha>4db725213dccb0d1102427bce1c39ba3117da7f7</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.SignTool" Version="8.0.0-beta.25060.1">
<Dependency Name="Microsoft.DotNet.SignTool" Version="8.0.0-beta.25066.6">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>c255aae7f2b128fa20a4441f0e192c3c53561621</Sha>
<Sha>4db725213dccb0d1102427bce1c39ba3117da7f7</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="8.0.0-beta.25060.1">
<Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="8.0.0-beta.25066.6">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>c255aae7f2b128fa20a4441f0e192c3c53561621</Sha>
<Sha>4db725213dccb0d1102427bce1c39ba3117da7f7</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.SwaggerGenerator.MSBuild" Version="8.0.0-beta.25060.1">
<Dependency Name="Microsoft.DotNet.SwaggerGenerator.MSBuild" Version="8.0.0-beta.25066.6">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>c255aae7f2b128fa20a4441f0e192c3c53561621</Sha>
<Sha>4db725213dccb0d1102427bce1c39ba3117da7f7</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Git.IssueManager" Version="8.0.0-beta.25060.1">
<Dependency Name="Microsoft.DotNet.Git.IssueManager" Version="8.0.0-beta.25066.6">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>c255aae7f2b128fa20a4441f0e192c3c53561621</Sha>
<Sha>4db725213dccb0d1102427bce1c39ba3117da7f7</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.VersionTools" Version="8.0.0-beta.25060.1">
<Dependency Name="Microsoft.DotNet.VersionTools" Version="8.0.0-beta.25066.6">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>c255aae7f2b128fa20a4441f0e192c3c53561621</Sha>
<Sha>4db725213dccb0d1102427bce1c39ba3117da7f7</Sha>
</Dependency>
<Dependency Name="Microsoft.DncEng.SecretManager" Version="1.1.0-beta.25057.2">
<Uri>https://github.com/dotnet/dnceng</Uri>
Expand Down
10 changes: 5 additions & 5 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
<UsingToolNetFrameworkReferenceAssemblies>true</UsingToolNetFrameworkReferenceAssemblies>
<MicrosoftNetFrameworkReferenceAssembliesVersion>1.0.0-preview.1</MicrosoftNetFrameworkReferenceAssembliesVersion>
<!-- Libs -->
<MicrosoftDotNetSignToolVersion>8.0.0-beta.25060.1</MicrosoftDotNetSignToolVersion>
<MicrosoftDotNetBuildTasksFeedVersion>8.0.0-beta.25060.1</MicrosoftDotNetBuildTasksFeedVersion>
<MicrosoftDotNetSwaggerGeneratorMSBuildVersion>8.0.0-beta.25060.1</MicrosoftDotNetSwaggerGeneratorMSBuildVersion>
<MicrosoftDotNetGitIssueManagerVersion>8.0.0-beta.25060.1</MicrosoftDotNetGitIssueManagerVersion>
<MicrosoftDotNetVersionToolsVersion>8.0.0-beta.25060.1</MicrosoftDotNetVersionToolsVersion>
<MicrosoftDotNetSignToolVersion>8.0.0-beta.25066.6</MicrosoftDotNetSignToolVersion>
<MicrosoftDotNetBuildTasksFeedVersion>8.0.0-beta.25066.6</MicrosoftDotNetBuildTasksFeedVersion>
<MicrosoftDotNetSwaggerGeneratorMSBuildVersion>8.0.0-beta.25066.6</MicrosoftDotNetSwaggerGeneratorMSBuildVersion>
<MicrosoftDotNetGitIssueManagerVersion>8.0.0-beta.25066.6</MicrosoftDotNetGitIssueManagerVersion>
<MicrosoftDotNetVersionToolsVersion>8.0.0-beta.25066.6</MicrosoftDotNetVersionToolsVersion>
<MicrosoftNetTestSdkVersion>17.4.1</MicrosoftNetTestSdkVersion>
<MicrosoftDotNetInternalLoggingVersion>1.1.0-beta.25053.1</MicrosoftDotNetInternalLoggingVersion>
<MicrosoftAspNetCoreApiPaginationVersion>1.1.0-beta.25053.1</MicrosoftAspNetCoreApiPaginationVersion>
Expand Down
2 changes: 1 addition & 1 deletion eng/common/sdk-task.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ try {
$GlobalJson.tools | Add-Member -Name "vs" -Value (ConvertFrom-Json "{ `"version`": `"16.5`" }") -MemberType NoteProperty
}
if( -not ($GlobalJson.tools.PSObject.Properties.Name -match "xcopy-msbuild" )) {
$GlobalJson.tools | Add-Member -Name "xcopy-msbuild" -Value "17.8.1-2" -MemberType NoteProperty
$GlobalJson.tools | Add-Member -Name "xcopy-msbuild" -Value "17.12.0" -MemberType NoteProperty
}
if ($GlobalJson.tools."xcopy-msbuild".Trim() -ine "none") {
$xcopyMSBuildToolsFolder = InitializeXCopyMSBuild $GlobalJson.tools."xcopy-msbuild" -install $true
Expand Down
4 changes: 2 additions & 2 deletions eng/common/tools.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,8 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements =

# If the version of msbuild is going to be xcopied,
# use this version. Version matches a package here:
# https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-eng/NuGet/RoslynTools.MSBuild/versions/17.8.1-2
$defaultXCopyMSBuildVersion = '17.8.1-2'
# https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-eng/NuGet/RoslynTools.MSBuild/versions/17.12.0
$defaultXCopyMSBuildVersion = '17.12.0'

if (!$vsRequirements) {
if (Get-Member -InputObject $GlobalJson.tools -Name 'vs') {
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
}
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.25060.1"
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.25066.6"
}
}
3 changes: 2 additions & 1 deletion src/Microsoft.DotNet.Darc/DarcLib/AzureDevOpsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,8 @@ await client.UpdatePullRequestAsync(
catch (Exception ex) when (
ex.Message.StartsWith("The pull request needs a minimum number of approvals") ||
ex.Message == "Proof of presence is required" ||
ex.Message == "Failure while attempting to queue Build.")
ex.Message == "Failure while attempting to queue Build." ||
ex.Message.Contains("Please re-approve the most recent pull request iteration"))
{
throw new PullRequestNotMergeableException(ex.Message);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.DotNet.DarcLib.Helpers;
using Microsoft.Extensions.Logging;

#nullable enable
namespace Microsoft.DotNet.DarcLib.Conflicts;

public interface IBackFlowConflictResolver
{
Task<bool> TryMergingRepoBranch(
ILocalGitRepo repo,
string baseBranch,
string targetBranch);
}

/// <summary>
/// This class is responsible for resolving well-known conflicts that can occur during a backflow operation.
/// The conflicts can happen when backward and forward flow PRs get merged out of order.
/// This can be shown on the following schema (the order of events is numbered):
///
/// repo VMR
/// O────────────────────►O
/// │ 2. │
/// 1.O────────────────O │
/// │ 4. │ │
/// │ O───────────┼────O 3.
/// │ │ │ │
/// │ │ │ │
/// 6.O◄───┘ └───►O 5.
/// │ 7. │
/// │ O───────────────|
/// 8.O◄────┘ │
/// │ │
///
/// The conflict arises in step 8. and is caused by the fact that:
/// - When the backflow PR branch is being opened in 7., the last sync (from the point of view of 5.) is from 1.
/// - This means that the PR branch will be based on 1. (the real PR branch will be a commit on top of 1.)
/// - This means that when 6. merged, Version.Details.xml got updated with the SHA of the 3.
/// - So the Source tag in Version.Details.xml in 6. contains the SHA of 3.
/// - The backflow PR branch contains the SHA of 5.
/// - So the Version.Details.xml file conflicts on the SHA (3. vs 5.)
/// - There's also a similar conflict in the package versions that got updated in those commits.
/// - However, if only the version files are in conflict, we can try merging 6. into 7. and resolve the conflict.
/// - This is because basically we know we want to set the version files to point at 5.
/// </summary>
public class BackFlowConflictResolver : CodeFlowConflictResolver, IBackFlowConflictResolver
{
private readonly ILogger<ForwardFlowConflictResolver> _logger;

public BackFlowConflictResolver(ILogger<ForwardFlowConflictResolver> logger)
: base(logger)
{
_logger = logger;
}

public async Task<bool> TryMergingRepoBranch(
ILocalGitRepo repo,
string targetBranch,
string branchToMerge)
{
return await TryMergingBranch(repo, targetBranch, branchToMerge);
}

protected override async Task<bool> TryResolvingConflicts(ILocalGitRepo repo, IEnumerable<UnixPath> conflictedFiles)
{
foreach (var filePath in conflictedFiles)
{
// Known conflict in eng/Version.Details.xml
if (string.Equals(filePath, VersionFiles.VersionDetailsXml, StringComparison.InvariantCultureIgnoreCase))
{
await Task.CompletedTask;
return false;

// TODO https://github.com/dotnet/arcade-services/issues/4196: Resolve conflicts in eng/Version.Details.xml
// return true;
}

// Known conflict in eng/Versions.props
if (string.Equals(filePath, VersionFiles.VersionProps, StringComparison.InvariantCultureIgnoreCase))
{
await Task.CompletedTask;
return false;

// TODO https://github.com/dotnet/arcade-services/issues/4196: Resolve conflicts in eng/Version.Details.xml
// return true;
}

_logger.LogInformation("Unable to resolve conflicts in {file}", filePath);
return false;
}

return true;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.DotNet.DarcLib.Helpers;
using Microsoft.Extensions.Logging;

#nullable enable
namespace Microsoft.DotNet.DarcLib.Conflicts;

/// <summary>
/// This class is responsible for resolving well-known conflicts that can occur during codeflow operations.
/// The conflicts usually happen when backward a forward flow PRs get merged out of order.
/// </summary>
public abstract class CodeFlowConflictResolver
{
private readonly ILogger _logger;

public CodeFlowConflictResolver(ILogger logger)
{
_logger = logger;
}

protected async Task<bool> TryMergingBranch(
ILocalGitRepo repo,
string targetBranch,
string branchToMerge)
{
_logger.LogInformation("Trying to merge target branch {targetBranch} into {baseBranch}", branchToMerge, targetBranch);

await repo.CheckoutAsync(targetBranch);
var result = await repo.RunGitCommandAsync(["merge", "--no-commit", "--no-ff", branchToMerge]);
if (result.Succeeded)
{
_logger.LogInformation("Successfully merged the branch {targetBranch} into {headBranch} in {repoPath}",
branchToMerge,
targetBranch,
repo.Path);
await repo.CommitAsync($"Merging {branchToMerge} into {targetBranch}", allowEmpty: true);
return true;
}

result = await repo.RunGitCommandAsync(["diff", "--name-only", "--diff-filter=U", "--relative"]);
if (!result.Succeeded)
{
_logger.LogInformation("Failed to merge the branch {targetBranch} into {headBranch} in {repoPath}",
branchToMerge,
targetBranch,
repo.Path);
result = await repo.RunGitCommandAsync(["merge", "--abort"]);
return false;
}

var conflictedFiles = result.StandardOutput
.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries)
.Select(line => new UnixPath(line.Trim()));

if (!await TryResolvingConflicts(repo, conflictedFiles))
{
result = await repo.RunGitCommandAsync(["merge", "--abort"]);
return false;
}

_logger.LogInformation("Successfully resolved version file conflicts between branches {targetBranch} and {headBranch} in {repoPath}",
branchToMerge,
targetBranch,
repo.Path);
await repo.CommitAsync($"Merge branch {branchToMerge} into {targetBranch}", allowEmpty: false);
return true;
}

protected abstract Task<bool> TryResolvingConflicts(ILocalGitRepo repo, IEnumerable<UnixPath> conflictedFiles);
}
Loading

0 comments on commit 5528392

Please sign in to comment.