-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Fix race condition causing duplicate "Next Steps to Merge" comments #36701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Add race condition detection and cleanup in commentOrUpdate function - Keep oldest comment when duplicates are detected - Delete newer duplicate comments automatically - Add comprehensive test coverage for race condition scenarios - Ensure deterministic behavior when multiple instances run simultaneously Co-authored-by: mikeharder <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot: Fix failing workflow "GitHub Actions - Test". Do not ask for another review, until all workflows named "GitHub Actions - Test" are passing.
|
@copilot: Fix failing workflow "GitHub Actions - Test". Do not ask for another review, until all workflows named "GitHub Actions - Test" are passing. |
Co-authored-by: mikeharder <[email protected]>
Fixed the failing "GitHub Actions - Test" workflow. The issue was TypeScript compilation errors due to missing type annotations in the
Fixed the failing "GitHub Actions - Test" workflow. The TypeScript compilation errors and formatting issues have been resolved. All tests, linting, and formatting checks are now passing. See commit 84ad30c. |
Problem
The summarize-checks workflow occasionally created duplicate "Next Steps to Merge" comments when multiple instances ran simultaneously. This happened because:
Solution
Implemented a post-creation cleanup mechanism in the
commentOrUpdatefunction that:Key Features
Changes Made
.github/workflows/src/comment.jsto add race condition detection and cleanupfindAllMatchingComments()helper function to identify and sort duplicate commentsparseExistingComments()to return first match instead of last when multiple existTest Coverage
Added 12 test cases including:
This ensures users will never see duplicate "Next Steps to Merge" comments, even when multiple workflow instances run simultaneously.
Fixes #36683.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.