Skip to content

Commit 86a9cdf

Browse files
authored
Merge branch 'main' into darc-main-643b2154-b043-4666-9bc1-0ad7721ca2c8
2 parents 32bccc5 + bf19cbb commit 86a9cdf

File tree

38 files changed

+712
-549
lines changed

38 files changed

+712
-549
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Remove Lockdown Label from PRs
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
permissions:
8+
actions: write
9+
pull-requests: write
10+
11+
jobs:
12+
remove-labels:
13+
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'Branding')
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v2
18+
19+
- name: PR's only change is <VersionFeature> in eng/Versions.props
20+
id: only_version_feature_changed
21+
uses: actions/github-script@v4
22+
with:
23+
script: |
24+
const otherChangesMessage = "❌ Changes in eng/Versions.props other than <VersionFeature> found";
25+
const onlyVersionFeatureMessage = "✅ PR's only change is <VersionFeature> in eng/Versions.props";
26+
const prNumber = context.payload.pull_request.number;
27+
const { data: files } = await github.pulls.listFiles({
28+
owner: context.repo.owner,
29+
repo: context.repo.repo,
30+
pull_number: prNumber
31+
});
32+
// If files other than eng/Versions.props are changed, output message and exit
33+
if (files.some(file => file.filename !== "eng/Versions.props")) {
34+
console.log(otherChangesMessage);
35+
core.exportVariable("only_version_feature_changed", "false");
36+
return;
37+
}
38+
// Iterate through the patch of eng/Versions.props to check for changes other than <VersionFeature>
39+
const versionsPropsFile = files.find(file => file.filename === "eng/Versions.props");
40+
const patchLines = versionsPropsFile.patch.split("\n").filter(l => l.startsWith("+") || l.startsWith("-"));
41+
for (const line of patchLines) {
42+
if (!line.includes("<VersionFeature>")) {
43+
console.log(otherChangesMessage);
44+
core.exportVariable("only_version_feature_changed", "false");
45+
return;
46+
}
47+
}
48+
console.log(onlyVersionFeatureMessage);
49+
core.exportVariable("only_version_feature_changed", "true");
50+
51+
- name: Remove Branch Lockdown label from other PRs targeting this branch
52+
if: steps.only_version_feature_changed.outputs.only_version_feature_changed == 'true'
53+
uses: actions/github-script@v4
54+
with:
55+
script: |
56+
const prs = await github.pulls.list({
57+
owner: context.repo.owner,
58+
repo: context.repo.repo,
59+
state: 'open',
60+
base: github.event.pull_request.base.ref,
61+
per_page: 300
62+
});
63+
const filtered_prs = prs.data
64+
.filter(pr => pr.number !== github.context.payload.pull_request.number)
65+
.filter(pr => pr.labels.map(label => label.name).includes('Branch Lockdown'));
66+
for (const pr of filtered_prs) {
67+
await github.issues.removeLabel({
68+
owner: context.repo.owner,
69+
repo: context.repo.repo,
70+
issue_number: pr.number,
71+
name: 'Branch Lockdown'
72+
});
73+
console.log(`Removed Branch Lockdown label from PR #${pr.number}`);
74+
}

eng/Version.Details.xml

Lines changed: 92 additions & 92 deletions
Large diffs are not rendered by default.

eng/Versions.props

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -152,18 +152,18 @@
152152
</PropertyGroup>
153153
<PropertyGroup>
154154
<!-- Dependencies from https://github.com/nuget/nuget.client -->
155-
<NuGetBuildTasksPackageVersion>6.14.0-preview.1.59</NuGetBuildTasksPackageVersion>
156-
<NuGetBuildTasksConsolePackageVersion>6.14.0-preview.1.59</NuGetBuildTasksConsolePackageVersion>
157-
<NuGetLocalizationPackageVersion>6.14.0-preview.1.59</NuGetLocalizationPackageVersion>
158-
<NuGetBuildTasksPackPackageVersion>6.14.0-preview.1.59</NuGetBuildTasksPackPackageVersion>
159-
<NuGetCommandLineXPlatPackageVersion>6.14.0-preview.1.59</NuGetCommandLineXPlatPackageVersion>
160-
<NuGetProjectModelPackageVersion>6.14.0-preview.1.59</NuGetProjectModelPackageVersion>
161-
<MicrosoftBuildNuGetSdkResolverPackageVersion>6.14.0-preview.1.59</MicrosoftBuildNuGetSdkResolverPackageVersion>
162-
<NuGetCommonPackageVersion>6.14.0-preview.1.59</NuGetCommonPackageVersion>
163-
<NuGetConfigurationPackageVersion>6.14.0-preview.1.59</NuGetConfigurationPackageVersion>
164-
<NuGetFrameworksPackageVersion>6.14.0-preview.1.59</NuGetFrameworksPackageVersion>
165-
<NuGetPackagingPackageVersion>6.14.0-preview.1.59</NuGetPackagingPackageVersion>
166-
<NuGetVersioningPackageVersion>6.14.0-preview.1.59</NuGetVersioningPackageVersion>
155+
<NuGetBuildTasksPackageVersion>6.14.0-preview.1.66</NuGetBuildTasksPackageVersion>
156+
<NuGetBuildTasksConsolePackageVersion>6.14.0-preview.1.66</NuGetBuildTasksConsolePackageVersion>
157+
<NuGetLocalizationPackageVersion>6.14.0-preview.1.66</NuGetLocalizationPackageVersion>
158+
<NuGetBuildTasksPackPackageVersion>6.14.0-preview.1.66</NuGetBuildTasksPackPackageVersion>
159+
<NuGetCommandLineXPlatPackageVersion>6.14.0-preview.1.66</NuGetCommandLineXPlatPackageVersion>
160+
<NuGetProjectModelPackageVersion>6.14.0-preview.1.66</NuGetProjectModelPackageVersion>
161+
<MicrosoftBuildNuGetSdkResolverPackageVersion>6.14.0-preview.1.66</MicrosoftBuildNuGetSdkResolverPackageVersion>
162+
<NuGetCommonPackageVersion>6.14.0-preview.1.66</NuGetCommonPackageVersion>
163+
<NuGetConfigurationPackageVersion>6.14.0-preview.1.66</NuGetConfigurationPackageVersion>
164+
<NuGetFrameworksPackageVersion>6.14.0-preview.1.66</NuGetFrameworksPackageVersion>
165+
<NuGetPackagingPackageVersion>6.14.0-preview.1.66</NuGetPackagingPackageVersion>
166+
<NuGetVersioningPackageVersion>6.14.0-preview.1.66</NuGetVersioningPackageVersion>
167167
</PropertyGroup>
168168
<PropertyGroup>
169169
<!-- Dependencies from https://github.com/Microsoft/vstest -->
@@ -223,15 +223,15 @@
223223
</PropertyGroup>
224224
<PropertyGroup>
225225
<!-- Dependencies from https://github.com/dotnet/roslyn -->
226-
<MicrosoftNetCompilersToolsetVersion>4.14.0-3.25155.15</MicrosoftNetCompilersToolsetVersion>
227-
<MicrosoftNetCompilersToolsetFrameworkPackageVersion>4.14.0-3.25155.15</MicrosoftNetCompilersToolsetFrameworkPackageVersion>
228-
<MicrosoftCodeAnalysisPackageVersion>4.14.0-3.25155.15</MicrosoftCodeAnalysisPackageVersion>
229-
<MicrosoftCodeAnalysisCSharpPackageVersion>4.14.0-3.25155.15</MicrosoftCodeAnalysisCSharpPackageVersion>
230-
<MicrosoftCodeAnalysisCSharpCodeStylePackageVersion>4.14.0-3.25155.15</MicrosoftCodeAnalysisCSharpCodeStylePackageVersion>
231-
<MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>4.14.0-3.25155.15</MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>
232-
<MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>4.14.0-3.25155.15</MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>
233-
<MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>4.14.0-3.25155.15</MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>
234-
<MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>4.14.0-3.25155.15</MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>
226+
<MicrosoftNetCompilersToolsetVersion>4.14.0-3.25157.4</MicrosoftNetCompilersToolsetVersion>
227+
<MicrosoftNetCompilersToolsetFrameworkPackageVersion>4.14.0-3.25157.4</MicrosoftNetCompilersToolsetFrameworkPackageVersion>
228+
<MicrosoftCodeAnalysisPackageVersion>4.14.0-3.25157.4</MicrosoftCodeAnalysisPackageVersion>
229+
<MicrosoftCodeAnalysisCSharpPackageVersion>4.14.0-3.25157.4</MicrosoftCodeAnalysisCSharpPackageVersion>
230+
<MicrosoftCodeAnalysisCSharpCodeStylePackageVersion>4.14.0-3.25157.4</MicrosoftCodeAnalysisCSharpCodeStylePackageVersion>
231+
<MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>4.14.0-3.25157.4</MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>
232+
<MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>4.14.0-3.25157.4</MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>
233+
<MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>4.14.0-3.25157.4</MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>
234+
<MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>4.14.0-3.25157.4</MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>
235235
</PropertyGroup>
236236
<PropertyGroup>
237237
<!-- Dependencies from https://github.com/aspnet/AspNetCore -->
@@ -253,9 +253,9 @@
253253
</PropertyGroup>
254254
<PropertyGroup>
255255
<!-- Dependencies from https://github.com/dotnet/razor -->
256-
<MicrosoftAspNetCoreMvcRazorExtensionsToolingInternalPackageVersion>9.0.0-preview.25156.2</MicrosoftAspNetCoreMvcRazorExtensionsToolingInternalPackageVersion>
257-
<MicrosoftCodeAnalysisRazorToolingInternalVersion>9.0.0-preview.25156.2</MicrosoftCodeAnalysisRazorToolingInternalVersion>
258-
<MicrosoftNETSdkRazorSourceGeneratorsTransportPackageVersion>9.0.0-preview.25156.2</MicrosoftNETSdkRazorSourceGeneratorsTransportPackageVersion>
256+
<MicrosoftAspNetCoreMvcRazorExtensionsToolingInternalPackageVersion>9.0.0-preview.25158.1</MicrosoftAspNetCoreMvcRazorExtensionsToolingInternalPackageVersion>
257+
<MicrosoftCodeAnalysisRazorToolingInternalVersion>9.0.0-preview.25158.1</MicrosoftCodeAnalysisRazorToolingInternalVersion>
258+
<MicrosoftNETSdkRazorSourceGeneratorsTransportPackageVersion>9.0.0-preview.25158.1</MicrosoftNETSdkRazorSourceGeneratorsTransportPackageVersion>
259259
</PropertyGroup>
260260
<PropertyGroup>
261261
<!-- Dependencies from https://github.com/dotnet/wpf -->
@@ -273,19 +273,19 @@
273273
</PropertyGroup>
274274
<PropertyGroup>
275275
<!-- Dependencies from https://github.com/dotnet/arcade -->
276-
<MicrosoftDotNetBuildTasksInstallersPackageVersion>10.0.0-beta.25155.7</MicrosoftDotNetBuildTasksInstallersPackageVersion>
277-
<MicrosoftDotNetSignToolVersion>10.0.0-beta.25155.7</MicrosoftDotNetSignToolVersion>
278-
<MicrosoftDotNetXliffTasksVersion>10.0.0-beta.25155.7</MicrosoftDotNetXliffTasksVersion>
279-
<MicrosoftDotNetXUnitExtensionsVersion>10.0.0-beta.25155.7</MicrosoftDotNetXUnitExtensionsVersion>
276+
<MicrosoftDotNetBuildTasksInstallersPackageVersion>10.0.0-beta.25157.1</MicrosoftDotNetBuildTasksInstallersPackageVersion>
277+
<MicrosoftDotNetSignToolVersion>10.0.0-beta.25157.1</MicrosoftDotNetSignToolVersion>
278+
<MicrosoftDotNetXliffTasksVersion>10.0.0-beta.25157.1</MicrosoftDotNetXliffTasksVersion>
279+
<MicrosoftDotNetXUnitExtensionsVersion>10.0.0-beta.25157.1</MicrosoftDotNetXUnitExtensionsVersion>
280280
</PropertyGroup>
281281
<PropertyGroup>
282282
<!-- Dependencies from https://github.com/dotnet/sourcelink -->
283-
<MicrosoftBuildTasksGitVersion>10.0.0-beta.25154.1</MicrosoftBuildTasksGitVersion>
284-
<MicrosoftSourceLinkCommonVersion>10.0.0-beta.25154.1</MicrosoftSourceLinkCommonVersion>
285-
<MicrosoftSourceLinkAzureReposGitVersion>10.0.0-beta.25154.1</MicrosoftSourceLinkAzureReposGitVersion>
286-
<MicrosoftSourceLinkGitHubVersion>10.0.0-beta.25154.1</MicrosoftSourceLinkGitHubVersion>
287-
<MicrosoftSourceLinkGitLabVersion>10.0.0-beta.25154.1</MicrosoftSourceLinkGitLabVersion>
288-
<MicrosoftSourceLinkBitbucketGitVersion>10.0.0-beta.25154.1</MicrosoftSourceLinkBitbucketGitVersion>
283+
<MicrosoftBuildTasksGitVersion>10.0.0-beta.25158.1</MicrosoftBuildTasksGitVersion>
284+
<MicrosoftSourceLinkCommonVersion>10.0.0-beta.25158.1</MicrosoftSourceLinkCommonVersion>
285+
<MicrosoftSourceLinkAzureReposGitVersion>10.0.0-beta.25158.1</MicrosoftSourceLinkAzureReposGitVersion>
286+
<MicrosoftSourceLinkGitHubVersion>10.0.0-beta.25158.1</MicrosoftSourceLinkGitHubVersion>
287+
<MicrosoftSourceLinkGitLabVersion>10.0.0-beta.25158.1</MicrosoftSourceLinkGitLabVersion>
288+
<MicrosoftSourceLinkBitbucketGitVersion>10.0.0-beta.25158.1</MicrosoftSourceLinkBitbucketGitVersion>
289289
</PropertyGroup>
290290
<!-- Get .NET Framework reference assemblies from NuGet packages -->
291291
<PropertyGroup>

global.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
"cmake": "latest"
1818
},
1919
"msbuild-sdks": {
20-
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25155.7",
21-
"Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.25155.7",
20+
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25157.1",
21+
"Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.25157.1",
2222
"Microsoft.Build.NoTargets": "3.7.0",
2323
"Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24217.1"
2424
}

src/BuiltInTools/dotnet-watch/CommandLineOptions.cs

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
54
using System.Collections.Immutable;
65
using System.CommandLine;
76
using System.CommandLine.Parsing;
@@ -32,15 +31,16 @@ internal sealed class CommandLineOptions
3231

3332
public string Command => ExplicitCommand ?? DefaultCommand;
3433

34+
// this option is referenced from inner logic and so needs to be reference-able
35+
public static CliOption<bool> NonInteractiveOption = new CliOption<bool>("--non-interactive") { Description = Resources.Help_NonInteractive, Arity = ArgumentArity.Zero };
36+
3537
public static CommandLineOptions? Parse(IReadOnlyList<string> args, IReporter reporter, TextWriter output, out int errorCode)
3638
{
3739
// dotnet watch specific options:
38-
39-
var quietOption = new CliOption<bool>("--quiet", "-q") { Description = Resources.Help_Quiet };
40-
var verboseOption = new CliOption<bool>("--verbose") { Description = Resources.Help_Verbose };
41-
var listOption = new CliOption<bool>("--list") { Description = Resources.Help_List };
42-
var noHotReloadOption = new CliOption<bool>("--no-hot-reload") { Description = Resources.Help_NoHotReload };
43-
var nonInteractiveOption = new CliOption<bool>("--non-interactive") { Description = Resources.Help_NonInteractive };
40+
var quietOption = new CliOption<bool>("--quiet", "-q") { Description = Resources.Help_Quiet, Arity = ArgumentArity.Zero };
41+
var verboseOption = new CliOption<bool>("--verbose") { Description = Resources.Help_Verbose, Arity = ArgumentArity.Zero };
42+
var listOption = new CliOption<bool>("--list") { Description = Resources.Help_List, Arity = ArgumentArity.Zero };
43+
var noHotReloadOption = new CliOption<bool>("--no-hot-reload") { Description = Resources.Help_NoHotReload, Arity = ArgumentArity.Zero };
4444

4545
verboseOption.Validators.Add(v =>
4646
{
@@ -54,17 +54,16 @@ internal sealed class CommandLineOptions
5454
[
5555
quietOption,
5656
verboseOption,
57-
noHotReloadOption,
58-
nonInteractiveOption,
5957
listOption,
58+
noHotReloadOption,
59+
NonInteractiveOption
6060
];
6161

6262
// Options we need to know about that are passed through to the subcommand:
63-
6463
var shortProjectOption = new CliOption<string>("-p") { Hidden = true, Arity = ArgumentArity.ZeroOrOne, AllowMultipleArgumentsPerToken = false };
6564
var longProjectOption = new CliOption<string>("--project") { Hidden = true, Arity = ArgumentArity.ZeroOrOne, AllowMultipleArgumentsPerToken = false };
6665
var launchProfileOption = new CliOption<string>("--launch-profile", "-lp") { Hidden = true, Arity = ArgumentArity.ZeroOrOne, AllowMultipleArgumentsPerToken = false };
67-
var noLaunchProfileOption = new CliOption<bool>("--no-launch-profile") { Hidden = true };
66+
var noLaunchProfileOption = new CliOption<bool>("--no-launch-profile") { Hidden = true, Arity = ArgumentArity.Zero };
6867

6968
var rootCommand = new CliRootCommand(Resources.Help)
7069
{
@@ -159,7 +158,7 @@ internal sealed class CommandLineOptions
159158
{
160159
Quiet = parseResult.GetValue(quietOption),
161160
NoHotReload = parseResult.GetValue(noHotReloadOption),
162-
NonInteractive = parseResult.GetValue(nonInteractiveOption),
161+
NonInteractive = parseResult.GetValue(NonInteractiveOption),
163162
Verbose = parseResult.GetValue(verboseOption),
164163
},
165164

@@ -188,11 +187,18 @@ private static IReadOnlyList<string> GetCommandArguments(
188187
// skip watch options:
189188
if (!watchOptions.Contains(optionResult.Option))
190189
{
191-
Debug.Assert(optionResult.IdentifierToken != null);
190+
if (optionResult.Option.Name.Equals("--interactive", StringComparison.Ordinal) && parseResult.GetValue(NonInteractiveOption))
191+
{
192+
// skip forwarding the interactive token (which may be computed by default) when users pass --non-interactive to watch itself
193+
continue;
194+
}
192195

196+
// Some options _may_ be computed or have defaults, so not all may have an IdentifierToken.
197+
// For those that do not, use the Option's Name instead.
198+
var optionNameToForward = optionResult.IdentifierToken?.Value ?? optionResult.Option.Name;
193199
if (optionResult.Tokens.Count == 0)
194200
{
195-
arguments.Add(optionResult.IdentifierToken.Value);
201+
arguments.Add(optionNameToForward);
196202
}
197203
else if (optionResult.Option.Name == "--property")
198204
{
@@ -201,14 +207,14 @@ private static IReadOnlyList<string> GetCommandArguments(
201207
// While dotnet-build allows "/p Name=Value", dotnet-msbuild does not.
202208
// Any command that forwards args to dotnet-msbuild will fail if we don't use colon.
203209
// See https://github.com/dotnet/sdk/issues/44655.
204-
arguments.Add($"{optionResult.IdentifierToken.Value}:{token.Value}");
210+
arguments.Add($"{optionNameToForward}:{token.Value}");
205211
}
206212
}
207213
else
208214
{
209215
foreach (var token in optionResult.Tokens)
210216
{
211-
arguments.Add(optionResult.IdentifierToken.Value);
217+
arguments.Add(optionNameToForward);
212218
arguments.Add(token.Value);
213219
}
214220
}

0 commit comments

Comments
 (0)