Skip to content

Only tag PRs when the PR is merged, otherwise just list them#5417

Merged
dkurepa merged 5 commits intodotnet:mainfrom
dkurepa:dkurepa/TagPrsWhenFFIsMerged
Nov 3, 2025
Merged

Only tag PRs when the PR is merged, otherwise just list them#5417
dkurepa merged 5 commits intodotnet:mainfrom
dkurepa:dkurepa/TagPrsWhenFFIsMerged

Conversation

@dkurepa
Copy link
Copy Markdown
Member

@dkurepa dkurepa commented Nov 3, 2025

@dkurepa dkurepa marked this pull request as ready for review November 3, 2025 08:13
Copilot AI review requested due to automatic review settings November 3, 2025 08:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds functionality to tag forward-flown PRs in code flow updates by extracting and commenting on PRs included in the flow. The implementation refactors PR extraction logic into a shared utility and adds commit retrieval capabilities.

Key changes:

  • Extracts commit titles between two SHAs and identifies PRs in GitHub and Azure DevOps
  • Tags forward-flown PRs in merged forward flow PRs with a comment listing the included PRs
  • Refactors PR number extraction from commit messages into a reusable GitRepoUtils helper

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
PullRequestUpdater.cs Adds TagForwardFlownPRs method to identify and comment on forward-flown PRs; refactors previous SHA retrieval; stores PreviousSourceSha in PR state
InProgressPullRequest.cs Adds PreviousSourceSha property to track the previous source commit SHA
VmrForwardFlower.cs Refactors PR extraction logic to use the new GitRepoUtils.ExtractPullRequestUrisFromCommitTitles helper
GitRepoUtils.cs New utility class that extracts PR URIs from commit titles for both GitHub and Azure DevOps
Remote.cs Adds GetCommitTitlesBetween method to retrieve commit titles between two commits
IRemote.cs Adds interface definition for GetCommitTitlesBetween
IRemoteGitRepo.cs Adds interface definition for GetCommitTitlesBetween
GitHubClient.cs Implements GetCommitTitlesBetween for GitHub using the Compare API
AzureDevOpsClient.cs Implements GetCommitTitlesBetween for Azure DevOps using the commitsBatch API
Comments suppressed due to low confidence (1)

src/ProductConstructionService/ProductConstructionService.DependencyFlow/PullRequestUpdater.cs:1157

  • Variable pr may be null at this access as suggested by this null check.
    Variable pr may be null at this access as suggested by this null check.
    Variable pr may be null at this access as suggested by this null check.
    Variable pr may be null at this access as suggested by this null check.
    Variable pr may be null at this access as suggested by this null check.
    Variable pr may be null at this access as suggested by this null check.
                pr.Url,

Comment thread src/Microsoft.DotNet.Darc/DarcLib/Helpers/GitRepoUtils.cs Outdated
Comment thread src/Microsoft.DotNet.Darc/DarcLib/VirtualMonoRepo/VmrForwardFlower.cs Outdated
Comment thread src/Microsoft.DotNet.Darc/DarcLib/GitHubClient.cs Outdated
Comment thread src/Microsoft.DotNet.Darc/DarcLib/GitHubClient.cs Outdated
Comment thread src/Microsoft.DotNet.Darc/DarcLib/AzureDevOpsClient.cs Outdated
Comment thread src/Microsoft.DotNet.Darc/DarcLib/AzureDevOpsClient.cs Outdated
Comment thread src/Microsoft.DotNet.Darc/DarcLib/Helpers/GitRepoUtils.cs
premun

This comment was marked as off-topic.

@dkurepa
Copy link
Copy Markdown
Member Author

dkurepa commented Nov 3, 2025

This is what the comments end up looking like maestro-auth-test/maestro-test-vmr#4343

Comment thread src/Microsoft.DotNet.Darc/DarcLib/IRemote.cs Outdated
@dkurepa dkurepa merged commit 29657e1 into dotnet:main Nov 3, 2025
8 of 9 checks passed
@dkurepa dkurepa deleted the dkurepa/TagPrsWhenFFIsMerged branch November 3, 2025 14:01
dkurepa added a commit to dkurepa/arcade-services that referenced this pull request Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants