Skip to content

Commit 0a9f6b1

Browse files
[Rollout] Production rollout 2025-01-31 (#4400)
<!-- Link the GitHub or AzDO issue this pull request is associated with. Please copy and paste the full URL rather than using the dotnet/arcade-services# syntax --> Rollout issue: #4399
2 parents a943257 + 9b5a01d commit 0a9f6b1

File tree

29 files changed

+822
-147
lines changed

29 files changed

+822
-147
lines changed

eng/Version.Details.xml

+28-28
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,61 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Dependencies>
33
<ProductDependencies>
4-
<Dependency Name="Microsoft.DotNet.Internal.Logging" Version="1.1.0-beta.25053.1">
4+
<Dependency Name="Microsoft.DotNet.Internal.Logging" Version="1.1.0-beta.25080.1">
55
<Uri>https://github.com/dotnet/dnceng-shared</Uri>
6-
<Sha>be4a98bd3983aaef5867009cf48398f0f86dd410</Sha>
6+
<Sha>a04ffe2abb2e93d1e12b1d79bdae1dda41e0a46d</Sha>
77
</Dependency>
8-
<Dependency Name="Microsoft.AspNetCore.ApiPagination" Version="1.1.0-beta.25053.1">
8+
<Dependency Name="Microsoft.AspNetCore.ApiPagination" Version="1.1.0-beta.25080.1">
99
<Uri>https://github.com/dotnet/dnceng-shared</Uri>
10-
<Sha>be4a98bd3983aaef5867009cf48398f0f86dd410</Sha>
10+
<Sha>a04ffe2abb2e93d1e12b1d79bdae1dda41e0a46d</Sha>
1111
</Dependency>
12-
<Dependency Name="Microsoft.AspNetCore.ApiVersioning" Version="1.1.0-beta.25053.1">
12+
<Dependency Name="Microsoft.AspNetCore.ApiVersioning" Version="1.1.0-beta.25080.1">
1313
<Uri>https://github.com/dotnet/dnceng-shared</Uri>
14-
<Sha>be4a98bd3983aaef5867009cf48398f0f86dd410</Sha>
14+
<Sha>a04ffe2abb2e93d1e12b1d79bdae1dda41e0a46d</Sha>
1515
</Dependency>
16-
<Dependency Name="Microsoft.AspNetCore.ApiVersioning.Swashbuckle" Version="1.1.0-beta.25053.1">
16+
<Dependency Name="Microsoft.AspNetCore.ApiVersioning.Swashbuckle" Version="1.1.0-beta.25080.1">
1717
<Uri>https://github.com/dotnet/dnceng-shared</Uri>
18-
<Sha>be4a98bd3983aaef5867009cf48398f0f86dd410</Sha>
18+
<Sha>a04ffe2abb2e93d1e12b1d79bdae1dda41e0a46d</Sha>
1919
</Dependency>
20-
<Dependency Name="Microsoft.DncEng.CommandLineLib" Version="1.1.0-beta.25053.1">
20+
<Dependency Name="Microsoft.DncEng.CommandLineLib" Version="1.1.0-beta.25080.1">
2121
<Uri>https://github.com/dotnet/dnceng-shared</Uri>
22-
<Sha>be4a98bd3983aaef5867009cf48398f0f86dd410</Sha>
22+
<Sha>a04ffe2abb2e93d1e12b1d79bdae1dda41e0a46d</Sha>
2323
</Dependency>
24-
<Dependency Name="Microsoft.DncEng.Configuration.Extensions" Version="1.1.0-beta.25053.1">
24+
<Dependency Name="Microsoft.DncEng.Configuration.Extensions" Version="1.1.0-beta.25080.1">
2525
<Uri>https://github.com/dotnet/dnceng-shared</Uri>
26-
<Sha>be4a98bd3983aaef5867009cf48398f0f86dd410</Sha>
26+
<Sha>a04ffe2abb2e93d1e12b1d79bdae1dda41e0a46d</Sha>
2727
</Dependency>
28-
<Dependency Name="Microsoft.DotNet.GitHub.Authentication" Version="1.1.0-beta.25053.1">
28+
<Dependency Name="Microsoft.DotNet.GitHub.Authentication" Version="1.1.0-beta.25080.1">
2929
<Uri>https://github.com/dotnet/dnceng-shared</Uri>
30-
<Sha>be4a98bd3983aaef5867009cf48398f0f86dd410</Sha>
30+
<Sha>a04ffe2abb2e93d1e12b1d79bdae1dda41e0a46d</Sha>
3131
</Dependency>
32-
<Dependency Name="Microsoft.DotNet.Internal.DependencyInjection.Testing" Version="1.1.0-beta.25053.1">
32+
<Dependency Name="Microsoft.DotNet.Internal.DependencyInjection.Testing" Version="1.1.0-beta.25080.1">
3333
<Uri>https://github.com/dotnet/dnceng-shared</Uri>
34-
<Sha>be4a98bd3983aaef5867009cf48398f0f86dd410</Sha>
34+
<Sha>a04ffe2abb2e93d1e12b1d79bdae1dda41e0a46d</Sha>
3535
</Dependency>
36-
<Dependency Name="Microsoft.DotNet.Internal.DependencyInjection" Version="1.1.0-beta.25053.1">
36+
<Dependency Name="Microsoft.DotNet.Internal.DependencyInjection" Version="1.1.0-beta.25080.1">
3737
<Uri>https://github.com/dotnet/dnceng-shared</Uri>
38-
<Sha>be4a98bd3983aaef5867009cf48398f0f86dd410</Sha>
38+
<Sha>a04ffe2abb2e93d1e12b1d79bdae1dda41e0a46d</Sha>
3939
</Dependency>
40-
<Dependency Name="Microsoft.DotNet.Internal.Testing.DependencyInjection.Abstractions" Version="1.1.0-beta.25053.1">
40+
<Dependency Name="Microsoft.DotNet.Internal.Testing.DependencyInjection.Abstractions" Version="1.1.0-beta.25080.1">
4141
<Uri>https://github.com/dotnet/dnceng-shared</Uri>
42-
<Sha>be4a98bd3983aaef5867009cf48398f0f86dd410</Sha>
42+
<Sha>a04ffe2abb2e93d1e12b1d79bdae1dda41e0a46d</Sha>
4343
</Dependency>
44-
<Dependency Name="Microsoft.DotNet.Internal.Testing.DependencyInjectionCodeGen" Version="1.1.0-beta.25053.1">
44+
<Dependency Name="Microsoft.DotNet.Internal.Testing.DependencyInjectionCodeGen" Version="1.1.0-beta.25080.1">
4545
<Uri>https://github.com/dotnet/dnceng-shared</Uri>
46-
<Sha>be4a98bd3983aaef5867009cf48398f0f86dd410</Sha>
46+
<Sha>a04ffe2abb2e93d1e12b1d79bdae1dda41e0a46d</Sha>
4747
</Dependency>
48-
<Dependency Name="Microsoft.DotNet.Internal.Testing.Utility" Version="1.1.0-beta.25053.1">
48+
<Dependency Name="Microsoft.DotNet.Internal.Testing.Utility" Version="1.1.0-beta.25080.1">
4949
<Uri>https://github.com/dotnet/dnceng-shared</Uri>
50-
<Sha>be4a98bd3983aaef5867009cf48398f0f86dd410</Sha>
50+
<Sha>a04ffe2abb2e93d1e12b1d79bdae1dda41e0a46d</Sha>
5151
</Dependency>
52-
<Dependency Name="Microsoft.DotNet.Kusto" Version="1.1.0-beta.25053.1">
52+
<Dependency Name="Microsoft.DotNet.Kusto" Version="1.1.0-beta.25080.1">
5353
<Uri>https://github.com/dotnet/dnceng-shared</Uri>
54-
<Sha>be4a98bd3983aaef5867009cf48398f0f86dd410</Sha>
54+
<Sha>a04ffe2abb2e93d1e12b1d79bdae1dda41e0a46d</Sha>
5555
</Dependency>
56-
<Dependency Name="Microsoft.DotNet.Services.Utility" Version="1.1.0-beta.25053.1">
56+
<Dependency Name="Microsoft.DotNet.Services.Utility" Version="1.1.0-beta.25080.1">
5757
<Uri>https://github.com/dotnet/dnceng-shared</Uri>
58-
<Sha>be4a98bd3983aaef5867009cf48398f0f86dd410</Sha>
58+
<Sha>a04ffe2abb2e93d1e12b1d79bdae1dda41e0a46d</Sha>
5959
</Dependency>
6060
</ProductDependencies>
6161
<ToolsetDependencies>

eng/Versions.props

+13-13
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,22 @@
1515
<MicrosoftDotNetGitIssueManagerVersion>8.0.0-beta.25066.6</MicrosoftDotNetGitIssueManagerVersion>
1616
<MicrosoftDotNetVersionToolsVersion>8.0.0-beta.25066.6</MicrosoftDotNetVersionToolsVersion>
1717
<MicrosoftNetTestSdkVersion>17.4.1</MicrosoftNetTestSdkVersion>
18-
<MicrosoftDotNetInternalLoggingVersion>1.1.0-beta.25053.1</MicrosoftDotNetInternalLoggingVersion>
19-
<MicrosoftAspNetCoreApiPaginationVersion>1.1.0-beta.25053.1</MicrosoftAspNetCoreApiPaginationVersion>
20-
<MicrosoftAspNetCoreApiVersioningVersion>1.1.0-beta.25053.1</MicrosoftAspNetCoreApiVersioningVersion>
21-
<MicrosoftAspNetCoreApiVersioningSwashbuckleVersion>1.1.0-beta.25053.1</MicrosoftAspNetCoreApiVersioningSwashbuckleVersion>
22-
<MicrosoftDncEngConfigurationExtensionsVersion>1.1.0-beta.25053.1</MicrosoftDncEngConfigurationExtensionsVersion>
18+
<MicrosoftDotNetInternalLoggingVersion>1.1.0-beta.25080.1</MicrosoftDotNetInternalLoggingVersion>
19+
<MicrosoftAspNetCoreApiPaginationVersion>1.1.0-beta.25080.1</MicrosoftAspNetCoreApiPaginationVersion>
20+
<MicrosoftAspNetCoreApiVersioningVersion>1.1.0-beta.25080.1</MicrosoftAspNetCoreApiVersioningVersion>
21+
<MicrosoftAspNetCoreApiVersioningSwashbuckleVersion>1.1.0-beta.25080.1</MicrosoftAspNetCoreApiVersioningSwashbuckleVersion>
22+
<MicrosoftDncEngConfigurationExtensionsVersion>1.1.0-beta.25080.1</MicrosoftDncEngConfigurationExtensionsVersion>
2323
<MicrosoftDotNetAuthenticationAlgorithmsVersion>1.1.0-beta.25052.1</MicrosoftDotNetAuthenticationAlgorithmsVersion>
24-
<MicrosoftDotNetGitHubAuthenticationVersion>1.1.0-beta.25053.1</MicrosoftDotNetGitHubAuthenticationVersion>
25-
<MicrosoftDotNetInternalDependencyInjectionTestingVersion>1.1.0-beta.25053.1</MicrosoftDotNetInternalDependencyInjectionTestingVersion>
26-
<MicrosoftDotNetInternalDependencyInjectionVersion>1.1.0-beta.25053.1</MicrosoftDotNetInternalDependencyInjectionVersion>
24+
<MicrosoftDotNetGitHubAuthenticationVersion>1.1.0-beta.25080.1</MicrosoftDotNetGitHubAuthenticationVersion>
25+
<MicrosoftDotNetInternalDependencyInjectionTestingVersion>1.1.0-beta.25080.1</MicrosoftDotNetInternalDependencyInjectionTestingVersion>
26+
<MicrosoftDotNetInternalDependencyInjectionVersion>1.1.0-beta.25080.1</MicrosoftDotNetInternalDependencyInjectionVersion>
2727
<MicrosoftDotNetInternalHealthVersion>1.1.0-beta.25052.1</MicrosoftDotNetInternalHealthVersion>
28-
<MicrosoftDotNetInternalTestingDependencyInjectionAbstractionsVersion>1.1.0-beta.25053.1</MicrosoftDotNetInternalTestingDependencyInjectionAbstractionsVersion>
29-
<MicrosoftDotNetInternalTestingDependencyInjectionCodeGenVersion>1.1.0-beta.25053.1</MicrosoftDotNetInternalTestingDependencyInjectionCodeGenVersion>
30-
<MicrosoftDotNetInternalTestingUtilityVersion>1.1.0-beta.25053.1</MicrosoftDotNetInternalTestingUtilityVersion>
31-
<MicrosoftDotNetKustoVersion>1.1.0-beta.25053.1</MicrosoftDotNetKustoVersion>
28+
<MicrosoftDotNetInternalTestingDependencyInjectionAbstractionsVersion>1.1.0-beta.25080.1</MicrosoftDotNetInternalTestingDependencyInjectionAbstractionsVersion>
29+
<MicrosoftDotNetInternalTestingDependencyInjectionCodeGenVersion>1.1.0-beta.25080.1</MicrosoftDotNetInternalTestingDependencyInjectionCodeGenVersion>
30+
<MicrosoftDotNetInternalTestingUtilityVersion>1.1.0-beta.25080.1</MicrosoftDotNetInternalTestingUtilityVersion>
31+
<MicrosoftDotNetKustoVersion>1.1.0-beta.25080.1</MicrosoftDotNetKustoVersion>
3232
<MicrosoftDotNetMetricsVersion>1.1.0-beta.25052.1</MicrosoftDotNetMetricsVersion>
33-
<MicrosoftDotNetServicesUtilityVersion>1.1.0-beta.25053.1</MicrosoftDotNetServicesUtilityVersion>
33+
<MicrosoftDotNetServicesUtilityVersion>1.1.0-beta.25080.1</MicrosoftDotNetServicesUtilityVersion>
3434
<MicrosoftDotNetWebAuthenticationVersion>1.1.0-beta.25053.1</MicrosoftDotNetWebAuthenticationVersion>
3535
<MicrosoftDncEngSecretManagerVersion>1.1.0-beta.25071.2</MicrosoftDncEngSecretManagerVersion>
3636
<MicrosoftDncEngConfigurationBootstrapVersion>1.1.0-beta.25071.2</MicrosoftDncEngConfigurationBootstrapVersion>

src/Maestro/Maestro.Common/AppCredentials/CredentialResolverOptions.cs

-5
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,4 @@ public class CredentialResolverOptions
1919
/// Managed Identity to use for the auth
2020
/// </summary>
2121
public string? ManagedIdentityId { get; set; }
22-
23-
/// <summary>
24-
/// Whether to use local credentials
25-
/// </summary>
26-
public bool UseLocalCredentials { get; set; }
2722
}

src/Maestro/Maestro.Common/AzureDevOpsTokens/AzureDevOpsTokenProvider.cs

+3-10
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,7 @@ private static Dictionary<string, TokenCredential> GetCredentials(
119119
continue;
120120
}
121121

122-
// 1. Use localy-cached credentials for development flows
123-
if (option.UseLocalCredentials)
124-
{
125-
credentials[account] = new LocalDevTokenCredential();
126-
continue;
127-
}
128-
129-
// 2. Managed identity (for server-to-AzDO scenarios)
122+
// 1. Managed identity (for server-to-AzDO scenarios)
130123
if (!string.IsNullOrEmpty(option.ManagedIdentityId))
131124
{
132125
credentials[account] = option.ManagedIdentityId == "system"
@@ -135,14 +128,14 @@ private static Dictionary<string, TokenCredential> GetCredentials(
135128
continue;
136129
}
137130

138-
// 3. Azure CLI authentication setup by the caller (for CI scenarios)
131+
// 2. Azure CLI authentication setup by the caller (for CI scenarios)
139132
if (option.DisableInteractiveAuth)
140133
{
141134
credentials[account] = AppCredential.CreateNonUserCredential(option.AppId);
142135
continue;
143136
}
144137

145-
// 4. Interactive login (user-based scenario)
138+
// 3. Interactive login (user-based scenario)
146139
credentials[account] = new DefaultAzureCredential(includeInteractiveCredentials: true);
147140
}
148141

src/Microsoft.DotNet.Darc/DarcLib/AzureDevOpsClient.cs

+20
Original file line numberDiff line numberDiff line change
@@ -1560,4 +1560,24 @@ private static string TruncateDescriptionIfNeeded(string str)
15601560
}
15611561
return str;
15621562
}
1563+
1564+
public async Task CommentPullRequestAsync(string pullRequestUri, string comment)
1565+
{
1566+
(string accountName, string _, string repoName, int id) = ParsePullRequestUri(pullRequestUri);
1567+
1568+
using VssConnection connection = CreateVssConnection(accountName);
1569+
using GitHttpClient client = await connection.GetClientAsync<GitHttpClient>();
1570+
1571+
var prComment = new Comment()
1572+
{
1573+
CommentType = CommentType.Text,
1574+
Content = $"{comment}{CommentMarker}"
1575+
};
1576+
1577+
var newCommentThread = new GitPullRequestCommentThread()
1578+
{
1579+
Comments = [prComment]
1580+
};
1581+
await client.CreateThreadAsync(newCommentThread, repoName, id);
1582+
}
15631583
}

src/Microsoft.DotNet.Darc/DarcLib/GitHubClient.cs

+6
Original file line numberDiff line numberDiff line change
@@ -1309,4 +1309,10 @@ public async Task DeletePullRequestBranchAsync(string pullRequestUri)
13091309
(string owner, string repo, int id) prInfo = ParsePullRequestUri(pullRequestUri);
13101310
await DeleteBranchAsync(prInfo.owner, prInfo.repo, pr.HeadBranch);
13111311
}
1312+
1313+
public async Task CommentPullRequestAsync(string pullRequestUri, string comment)
1314+
{
1315+
(string owner, string repo, int id) = ParsePullRequestUri(pullRequestUri);
1316+
await GetClient(owner, repo).Issue.Comment.Create(owner, repo, id, comment);
1317+
}
13121318
}

src/Microsoft.DotNet.Darc/DarcLib/IRemote.cs

+8
Original file line numberDiff line numberDiff line change
@@ -188,5 +188,13 @@ Task<List<GitFile>> CommitUpdatesAsync(
188188
/// <param name="gitDirParent">Location for the .git directory, or null for default</param>
189189
Task CloneAsync(string repoUri, string commit, string targetDirectory, bool checkoutSubmodules, string gitDirectory);
190190

191+
/// <summary>
192+
/// Comment on an existing pull request
193+
/// </summary>
194+
/// <param name="pullRequestUri">Uri of the pull request</param>
195+
/// <param name="comment">Comment message</param>
196+
/// <returns></returns>
197+
Task CommentPullRequestAsync(string pullRequestUri, string comment);
198+
191199
#endregion
192200
}

src/Microsoft.DotNet.Darc/DarcLib/IRemoteGitRepo.cs

+8-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Task<IEnumerable<int>> SearchPullRequestsAsync(
108108
/// or remove each merge policy check that isn't in evaluations
109109
/// </summary>
110110
/// <param name="pullRequestUrl">Url of pull request</param>
111-
/// <param name="evalutations">List of merge policies</param>
111+
/// <param name="evaluations">List of merge policies</param>
112112
Task CreateOrUpdatePullRequestMergeStatusInfoAsync(string pullRequestUrl, IReadOnlyList<MergePolicyEvaluationResult> evaluations);
113113

114114
/// <summary>
@@ -168,6 +168,13 @@ Task<IEnumerable<int>> SearchPullRequestsAsync(
168168
/// <param name="repoUri">Repository to find the branch in</param>
169169
/// <param name="branch">Branch to find</param>
170170
Task<bool> DoesBranchExistAsync(string repoUri, string branch);
171+
172+
/// <summary>
173+
/// Comment on an existing pull request
174+
/// </summary>
175+
/// <param name="pullRequestUri">Uri of the pull request</param>
176+
/// <param name="comment">Comment message</param>
177+
Task CommentPullRequestAsync(string pullRequestUri, string comment);
171178
}
172179

173180
#nullable disable

src/Microsoft.DotNet.Darc/DarcLib/Remote.cs

+6
Original file line numberDiff line numberDiff line change
@@ -405,4 +405,10 @@ public async Task<List<GitFile>> GetCommonScriptFilesAsync(string repoUri, strin
405405

406406
return files;
407407
}
408+
409+
public async Task CommentPullRequestAsync(string pullRequestUri, string comment)
410+
{
411+
CheckForValidGitClient();
412+
await _remoteGitClient.CommentPullRequestAsync(pullRequestUri, comment);
413+
}
408414
}

src/Microsoft.DotNet.Darc/DarcLib/VirtualMonoRepo/Exceptions.cs

+47-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using System;
5+
using System.Collections.Generic;
56
using System.IO;
7+
using System.Linq;
8+
using System.Text.RegularExpressions;
69
using Microsoft.DotNet.DarcLib.Helpers;
710

811
#nullable enable
@@ -24,8 +27,50 @@ private static string GetExceptionMessage(VmrIngestionPatch patch, ProcessExecut
2427
+ result;
2528
}
2629

27-
public class ConflictInPrBranchException(VmrIngestionPatch patch, string targetBranch)
30+
/// <summary>
31+
/// Exception thrown when the service can't apply an update to the PR branch due to a conflict
32+
/// between the source repo and a change that was made in the PR after it was opened.
33+
/// </summary>
34+
public class ConflictInPrBranchException(ProcessExecutionResult gitMergeResult, string targetBranch, bool isForwardFlow)
2835
: Exception($"Failed to flow changes due to conflicts in the target branch ({targetBranch})")
2936
{
30-
public VmrIngestionPatch Patch { get; } = patch;
37+
public List<string> FilesInConflict { get; } = ParseResult(gitMergeResult, isForwardFlow);
38+
39+
private static readonly Regex AlreadyExistsRegex = new("patch failed: (.+): already exist in index");
40+
private static readonly Regex PatchFailedRegex = new("error: patch failed: (.*):");
41+
private static readonly Regex PatchDoesNotApplyRegex = new("error: (.+): patch does not apply");
42+
private static readonly Regex FileDoesNotExistRegex = new("error: (.+): does not exist in index");
43+
44+
private static readonly Regex[] ConflictRegex =
45+
[
46+
AlreadyExistsRegex,
47+
PatchFailedRegex,
48+
PatchDoesNotApplyRegex,
49+
FileDoesNotExistRegex
50+
];
51+
52+
private static List<string> ParseResult(ProcessExecutionResult gitMergeResult, bool isForwardFlow)
53+
{
54+
List<string> filesInConflict = new();
55+
var errors = gitMergeResult.StandardError.Split(Environment.NewLine);
56+
foreach (var error in errors)
57+
{
58+
foreach (var regex in ConflictRegex)
59+
{
60+
var match = regex.Match(error);
61+
if (match.Success)
62+
{
63+
filesInConflict.Add(match.Groups[1].Value);
64+
break;
65+
}
66+
}
67+
}
68+
if (isForwardFlow)
69+
{
70+
// Convert VMR paths to normal repo paths, for example src/repo/file.cs -> file.cs
71+
return filesInConflict.Select(file => file.Split('/', 3)[2]).Distinct().ToList();
72+
}
73+
// If we're backflowing, the file paths are already normal
74+
return filesInConflict;
75+
}
3176
}

src/Microsoft.DotNet.Darc/DarcLib/VirtualMonoRepo/VmrBackflower.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ protected override async Task<bool> SameDirectionFlowAsync(
251251
if (!rebaseConflicts)
252252
{
253253
_logger.LogInformation("Failed to update a PR branch because of a conflict. Stopping the flow..");
254-
throw new ConflictInPrBranchException(e.Patch, headBranch);
254+
throw new ConflictInPrBranchException(e.Result, targetBranch, isForwardFlow: false);
255255
}
256256

257257
// Otherwise, we have a conflicting change in the last backflow PR (before merging)

src/Microsoft.DotNet.Darc/DarcLib/VirtualMonoRepo/VmrForwardFlower.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ protected override async Task<bool> SameDirectionFlowAsync(
217217
if (!rebaseConflicts)
218218
{
219219
_logger.LogInformation("Failed to update a PR branch because of a conflict. Stopping the flow..");
220-
throw new ConflictInPrBranchException(e.Patch, headBranch);
220+
throw new ConflictInPrBranchException(e.Result, targetBranch, isForwardFlow: true);
221221
}
222222

223223
// This happens when a conflicting change was made in the last backflow PR (before merging)

src/ProductConstructionService/ProductConstructionService.Api/Api/v2020_02_20/Controllers/SubscriptionsController.cs

+10
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,11 @@ public async Task<IActionResult> UpdateSubscription(Guid id, [FromBody] Subscrip
226226
return BadRequest(new ApiError("The request is invalid. Only one of source or target directory can be set"));
227227
}
228228

229+
if (update.Policy != null && update.Policy.Batchable && update.SourceEnabled == true && update.SourceDirectory != null)
230+
{
231+
return BadRequest(new ApiError("The request is invalid. Source-enabled backflow subscriptions cannot be batched."));
232+
}
233+
229234
if (update.SourceDirectory != subscription.SourceDirectory)
230235
{
231236
subscription.SourceDirectory = update.SourceDirectory;
@@ -418,6 +423,11 @@ public async Task<IActionResult> Create([FromBody, Required] SubscriptionData su
418423
{
419424
return BadRequest(new ApiError("The request is invalid. Only one of source or target directory can be set"));
420425
}
426+
427+
if (subscription.Policy.Batchable && subscription.SourceEnabled.Value && subscription.SourceDirectory != null)
428+
{
429+
return BadRequest(new ApiError("The request is invalid. Source-enabled backflow subscriptions cannot be batched."));
430+
}
421431
}
422432

423433
// In the case of a dev.azure.com repository, we don't have an app installation,

0 commit comments

Comments
 (0)