Revert linking Forward Flown PRs after merging, do it on updates#5470
Merged
dkurepa merged 6 commits intodotnet:mainfrom Nov 13, 2025
Merged
Revert linking Forward Flown PRs after merging, do it on updates#5470dkurepa merged 6 commits intodotnet:mainfrom
dkurepa merged 6 commits intodotnet:mainfrom
Conversation
This reverts commit 9db3c69.
…)" This reverts commit 96285f6.
…otnet#5417)" This reverts commit 29657e1.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR reverts changes from issue #5263, restoring the original implementation for linking forward-flown PRs. Instead of tagging PRs after they are merged, the system now tags them during PR updates.
Key Changes:
- Removed post-merge PR tagging logic and restored update-time tagging
- Cleaned up tracking of previous source SHA and related infrastructure
- Simplified test scenarios to match reverted behavior
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| PullRequestUpdater.cs | Removed HandleMergedOrClosedPr and TagForwardFlownPRs methods; inlined logic for handling merged/closed PRs; removed PreviousSourceSha tracking from code flow updates |
| InProgressPullRequest.cs | Removed PreviousSourceSha property from the model |
| VmrForwardFlower.cs | Restored PR linking logic to run during updates; moved regex patterns and PR extraction inline |
| IRemote.cs, IRemoteGitRepo.cs | Removed GetCommitTitlesForRange interface method |
| Remote.cs | Removed GetCommitTitlesForRange implementation; fixed method body formatting |
| GitHubClient.cs, AzureDevOpsClient.cs | Removed GetCommitTitlesForRange implementations |
| CommentCollector.cs | Removed Reset method from interface and implementation |
| GitRepoUtils.cs | Deleted entire file (no longer needed) |
| ScenarioTests_CodeFlow.cs | Simplified test to verify PR linking during updates instead of after merge |
| ScenarioTestBase.cs | Removed PullRequestCleanupOperation enum and MergePullRequest method; simplified CleanUpPullRequestAfter to only close PRs |
| CodeFlowScenarioTestBase.cs | Removed cleanupOperation and prState parameters from helper methods |
Comment on lines
409
to
422
| List<string> prNumbers = []; | ||
| foreach (var message in commitMessages) | ||
| { | ||
| foreach (var regex in regexes) | ||
| { | ||
| var match = regex.Match(message); | ||
| if (match.Success && match.Groups.Count > 1) | ||
| { | ||
| prNumbers.Add(match.Groups[1].Value); | ||
| break; | ||
| } | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
This foreach loop immediately maps its iteration variable to another variable - consider mapping the sequence explicitly using '.Select(...)'.
Suggested change
| List<string> prNumbers = []; | |
| foreach (var message in commitMessages) | |
| { | |
| foreach (var regex in regexes) | |
| { | |
| var match = regex.Match(message); | |
| if (match.Success && match.Groups.Count > 1) | |
| { | |
| prNumbers.Add(match.Groups[1].Value); | |
| break; | |
| } | |
| } | |
| } | |
| List<string> prNumbers = commitMessages | |
| .Select(message => | |
| { | |
| var match = regexes | |
| .Select(regex => regex.Match(message)) | |
| .FirstOrDefault(m => m.Success && m.Groups.Count > 1); | |
| return match != null && match.Success && match.Groups.Count > 1 | |
| ? match.Groups[1].Value | |
| : null; | |
| }) | |
| .Where(pr => pr != null) | |
| .ToList()!; |
premun
previously approved these changes
Nov 13, 2025
premun
approved these changes
Nov 13, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reverts #5263 back to the original implementation