Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
243 changes: 132 additions & 111 deletions src/dotnet-roslyn-tools/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,113 +1,134 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Run `pr-finder`",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/../../artifacts/bin/Microsoft.RoslynTools/Debug/net9.0/Microsoft.RoslynTools.dll",
"args": [
"pr-finder",
"-s",
"d7261529b43f4581fb47e8f4d3d9197095d44508",
"-e",
"main",
"--path",
"src/dotnet-roslyn-tools",
"-v",
"diag"
],
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": "Run `pr-finder` on Razor",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/../../artifacts/bin/Microsoft.RoslynTools/Debug/net9.0/Microsoft.RoslynTools.dll",
"args": [
"pr-finder",
"-s",
"e15fe5b8b38c1b1e1adb9c8a4d76567aa1c397db",
"-e",
"main",
"--format",
"changelog",
"-v",
"diag"
],
"cwd": "${workspaceFolder}/../../../razor",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": "Run `vsbranchinfo`",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/../../artifacts/bin/Microsoft.RoslynTools/Debug/net9.0/Microsoft.RoslynTools.dll",
"args": [
"vsbranchinfo",
"--branch",
"rel/d17.11",
"-v",
"diag"
],
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": "Run `create-release-tags -p roslyn`",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/../../artifacts/bin/Microsoft.RoslynTools/Debug/net9.0/Microsoft.RoslynTools.dll",
"args": [
"create-release-tags",
"-p",
"roslyn"
],
"cwd": "${workspaceFolder}/../../../roslyn",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": "Run `create-release-tags -p razor`",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/../../artifacts/bin/Microsoft.RoslynTools/Debug/net9.0/Microsoft.RoslynTools.dll",
"args": [
"create-release-tags",
"-p",
"razor"
],
"cwd": "${workspaceFolder}/../../../razor",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": "Run `authenticate --clear`",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/../../artifacts/bin/Microsoft.RoslynTools/Debug/net9.0/Microsoft.RoslynTools.dll",
"args": [
"authenticate",
"--clear"
],
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
"version": "0.2.0",
"configurations": [
{
"name": "Run `pr-finder`",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/../../artifacts/bin/Microsoft.RoslynTools/Debug/net9.0/Microsoft.RoslynTools.dll",
"args": [
"pr-finder",
"-s",
"d7261529b43f4581fb47e8f4d3d9197095d44508",
"-e",
"main",
"--path",
"src/dotnet-roslyn-tools",
"-v",
"diag"
],
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": "Run `pr-finder` on Roslyn",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this launch target

"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/../../artifacts/bin/Microsoft.RoslynTools/Debug/net9.0/Microsoft.RoslynTools.dll",
"args": [
"pr-finder",
"-s",
"b0b21b619712d4095afe5ab267efaf77a1e47bb0",
"-e",
"8e3d84569a17786744edc314614a99800ec3fd1f",
"--label",
"vscode",
"-v",
"diag"
],
"cwd": "${workspaceFolder}/../../../roslyn",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": "Run `pr-finder` on Razor",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/../../artifacts/bin/Microsoft.RoslynTools/Debug/net9.0/Microsoft.RoslynTools.dll",
"args": [
"pr-finder",
"-s",
"e15fe5b8b38c1b1e1adb9c8a4d76567aa1c397db",
"-e",
"main",
"--format",
"changelog",
"-v",
"diag"
],
"cwd": "${workspaceFolder}/../../../razor",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": "Run `vsbranchinfo`",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/../../artifacts/bin/Microsoft.RoslynTools/Debug/net9.0/Microsoft.RoslynTools.dll",
"args": [
"vsbranchinfo",
"--branch",
"rel/d17.11",
"-v",
"diag"
],
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": "Run `create-release-tags -p roslyn`",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/../../artifacts/bin/Microsoft.RoslynTools/Debug/net9.0/Microsoft.RoslynTools.dll",
"args": [
"create-release-tags",
"-p",
"roslyn"
],
"cwd": "${workspaceFolder}/../../../roslyn",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": "Run `create-release-tags -p razor`",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/../../artifacts/bin/Microsoft.RoslynTools/Debug/net9.0/Microsoft.RoslynTools.dll",
"args": [
"create-release-tags",
"-p",
"razor"
],
"cwd": "${workspaceFolder}/../../../razor",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": "Run `authenticate --clear`",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/../../artifacts/bin/Microsoft.RoslynTools/Debug/net9.0/Microsoft.RoslynTools.dll",
"args": [
"authenticate",
"--clear"
],
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
}
23 changes: 17 additions & 6 deletions src/dotnet-roslyn-tools/PRFinder/Hosts/GitHub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,25 @@ public bool ShouldSkip(Commit commit, ref bool mergePRFound)
return true;
}

// Exclude arcade dependency updates
if (commit.Author.Name == "dotnet-maestro[bot]")
// Exclude commits from bots
if (commit.Author.Name is "dotnet-maestro[bot]"
or "dotnet-policy-service[bot]"
or "dotnet-bot")
{
mergePRFound = true;
return true;
}

// Exclude merge commits from auto code-flow PRs (e.g. merges/main-to-main-vs-deps)
// Exclude merge commits which begin with `[Automated] `
if (IsAutomatedCommit().Match(commit.MessageShort).Success)
{
mergePRFound = true;
return true;
}

// Exclude merge commits from code-flow PRs (e.g. merges/main-to-main-vs-deps)
if (IsGitHubReleaseFlowCommit().Match(commit.MessageShort).Success ||
IsGitHubActionCodeFlowCommit().Match(commit.MessageShort).Success)
IsManualCodeFlowCommit().Match(commit.MessageShort).Success)
{
mergePRFound = true;
return true;
Expand Down Expand Up @@ -194,8 +203,10 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage

[GeneratedRegex(@"^Merge pull request #\d+ from dotnet/merges/")]
private static partial Regex IsGitHubReleaseFlowCommit();
[GeneratedRegex(@"^\[automated\] Merge branch '.*' => '.*' \(#\d+\)")]
private static partial Regex IsGitHubActionCodeFlowCommit();
[GeneratedRegex(@"^\[automated\] ")]
private static partial Regex IsAutomatedCommit();
[GeneratedRegex(@"^(Merge main \(#(\d+)\)$|(Merge [^\s]*|Merge branch .*|Merge remote-tracking branch .*) (into|to) .*)")]
private static partial Regex IsManualCodeFlowCommit();
[GeneratedRegex(@"^Merge pull request #(\d+) from")]
private static partial Regex IsGitHubMergePRCommit();
[GeneratedRegex(@"^(.*) \(#(\d+)\)(?:\n|$)")]
Expand Down
5 changes: 4 additions & 1 deletion src/dotnet-roslyn-tools/PRFinder/PRFinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ public static async Task<int> FindPRsAsync(
return 1;
}

builder ??= new();

IRepositoryHost host = isGitHub
? new Hosts.GitHub(repoUrl, connections, logger)
: new Hosts.Azure(repoUrl);
Expand Down Expand Up @@ -189,12 +191,13 @@ public static async Task<int> FindPRsAsync(
RecordLine(prLink, logger, builder);
}

logger.LogInformation("{Builder}", builder);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed so that we log the PR list after the processing is done. Other logging duiring processing made it difficult to read.


return 0;
}

private static void RecordLine(string line, ILogger logger, StringBuilder? builder)
{
logger.LogInformation("{Line}", line);
builder?.AppendLine(line);
}

Expand Down
Loading