Hide outdated bot comments#294
Conversation
770b1c3 to
eb30234
Compare
eb30234 to
5c6d957
Compare
|
Ping! This is still relevant and would be great to have merged 63749 cc @OskarStark 🙏 |
There was a problem hiding this comment.
Pull request overview
Adds automatic cleanup of previously-posted bot warnings by minimizing outdated bot comments when a pull request is edited and the reported issue is resolved.
Changes:
- Extend multiple PR subscribers to react to
pull_request.editedevents and minimize prior bot comments when conditions become valid. - Add
findBotComment()+minimizeComment()to the Issue API, implemented via GitHub REST comments listing + GraphQLminimizeCommentmutation. - Add/extend PHPUnit coverage for the new cleanup + idempotency behavior.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/Subscriber/UnsupportedBranchSubscriber.php |
Minimizes the “unsupported branch” warning when the base branch becomes supported/default; avoids duplicates. |
src/Subscriber/MismatchBranchDescriptionSubscriber.php |
Minimizes the mismatch warning when PR template branch matches the base branch; avoids duplicates. |
src/Subscriber/AllowEditFromMaintainerSubscriber.php |
Minimizes the warning when “Allow edits from maintainer” is enabled; avoids duplicates; ignores same-repo PRs. |
src/Api/Issue/IssueApi.php |
Adds new capabilities for locating and minimizing bot comments. |
src/Api/Issue/NullIssueApi.php |
Provides no-op implementations of the new Issue API methods. |
src/Api/Issue/GithubIssueApi.php |
Implements bot comment lookup and GraphQL minimization. |
config/packages/github_api.yaml |
Registers Github\Api\GraphQL service for DI. |
tests/Api/Issue/GithubIssueApiTest.php |
Adds unit tests for comment lookup and minimization. |
tests/Subscriber/UnsupportedBranchSubscriberTest.php |
Adds edited-event cleanup and idempotency tests. |
tests/Subscriber/MismatchBranchDescriptionSubscriberTest.php |
Adds edited-event cleanup and idempotency tests. |
tests/Subscriber/AllowEditFromMaintainerSubscriberTest.php |
New tests for edited-event cleanup and idempotency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Copilot suggestions addressed as follow :
while doing so i found out that the REST api response included the minimized comments too and doesn't provide a way to tell if a comment is minimized or not, which was breaking this scenario
to fix this i switched to using Graphql api, and now it works like this
|
Adresses #271 #220 #210
Automatically hides warning comments when the user resolves the reported issue.