Skip to content

Make it easier to add comments from anywhere in the service by adding a Comment Collector#5206

Merged
dkurepa merged 14 commits intodotnet:mainfrom
dkurepa:dkurepa/CommentCollector
Aug 28, 2025
Merged

Make it easier to add comments from anywhere in the service by adding a Comment Collector#5206
dkurepa merged 14 commits intodotnet:mainfrom
dkurepa:dkurepa/CommentCollector

Conversation

@dkurepa
Copy link
Copy Markdown
Member

@dkurepa dkurepa commented Aug 27, 2025

#5176
Adds a scoped (singleton for Darc commands) CommentCollector that is accessible from anywhere in the WorkItemProcessors.
At the end of every workitem, the new PullRequestCommenter will publish all comments to the PR the service worked on

@dkurepa dkurepa changed the title Dkurepa/comment collector Make it easier to add comments from anywhere in the service by adding a Comment Collector Aug 27, 2025
@dkurepa
Copy link
Copy Markdown
Member Author

dkurepa commented Aug 27, 2025

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
Files conflicting with the head branch:

In case of unclarities, consult the FAQ or tag @dotnet/product-construction for assistance.

based on what comment type we provide of course

@dkurepa dkurepa marked this pull request as ready for review August 27, 2025 10:49
Copilot AI review requested due to automatic review settings August 27, 2025 10:49
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 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 CommentCollector service that accumulates comments from various parts of the service
  • Replacement of the PullRequestConflictNotifier with a PullRequestCommenter that posts all collected comments
  • Refactoring of comment generation logic into a separate PullRequestCommentBuilder class

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

premun
premun previously approved these changes Aug 27, 2025
@dkurepa dkurepa merged commit de799a4 into dotnet:main Aug 28, 2025
9 checks passed
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