Make it easier to add comments from anywhere in the service by adding a Comment Collector#5206
Conversation
This reverts commit 772013d.
|
All comments will look something like Important There was a conflict in the PR branch when flowing source from https://github.com/maestro-auth-test/maestro-test-vmr/tree/c174393832a76f2b5f110af05031602935f0886b
In case of unclarities, consult the FAQ or tag @dotnet/product-construction for assistance. based on what comment type we provide of course |
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a centralized comment collection system to streamline dependency flow notifications in the Product Construction Service. The main purpose is to replace direct PR commenting with a unified approach where comments are collected throughout workitem processing and then published all at once at the end.
Key changes include:
- Addition of a scoped
CommentCollectorservice that accumulates comments from various parts of the service - Replacement of the
PullRequestConflictNotifierwith aPullRequestCommenterthat posts all collected comments - Refactoring of comment generation logic into a separate
PullRequestCommentBuilderclass
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Microsoft.DotNet.Darc/DarcLib/CommentCollector.cs | New service for collecting comments with support for different comment types |
| src/ProductConstructionService/ProductConstructionService.DependencyFlow/PullRequestCommenter.cs | New service that posts all collected comments to PRs with proper formatting |
| src/ProductConstructionService/ProductConstructionService.DependencyFlow/PullRequestCommentBuilder.cs | Extracted comment building logic from the old notifier with static methods for generating specific comment types |
| src/ProductConstructionService/ProductConstructionService.DependencyFlow/PullRequestUpdater.cs | Updated to use comment collector instead of direct notification and calls commenter at end of processing |
| src/ProductConstructionService/ProductConstructionService.DependencyFlow/PullRequestConflictNotifier.cs | Removed - functionality moved to comment builder and commenter |
| src/Microsoft.DotNet.Darc/DarcLib/VirtualMonoRepo/VmrVersionFileMerger.cs | Updated to use comment collector for version file merge conflict notifications |
| src/Microsoft.DotNet.Darc/DarcLib/AzureDevOpsClient.cs | Fixed naming conflict by fully qualifying Azure DevOps CommentType enum |
| src/Microsoft.DotNet.Darc/Darc/Program.cs | Added singleton comment collector registration and logging of collected comments |
| test files | Updated tests to accommodate the new comment collection architecture |
#5176
Adds a scoped (singleton for Darc commands)
CommentCollectorthat is accessible from anywhere in theWorkItemProcessors.At the end of every workitem, the new
PullRequestCommenterwill publish all comments to the PR the service worked on