fix(enforce-single-assignee): fetch live assignees and sleep before acting#53
Merged
fix(enforce-single-assignee): fetch live assignees and sleep before acting#53
Conversation
…cting - Sleep 3s before fetching so all simultaneous assignments are visible in the issue timeline before any are removed - Fetch current assignees live from the API instead of using the frozen event payload, so queued runs see the post-cleanup state and exit early Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two fixes to address duplicate comments and stale event data. Hate fixing concurrency issues with sleeps but github only gives us so many tools here.
Problems
Latest from #50 is that we still didn't get one comment-per-assignment-activity AND the timeline has a confusing message that only includes one of the assignees:
Stale event payload:
github.event.issue.assigneesis frozen at trigger time. When a queued run executes after the first run has already cleaned up, it still sees the original assignee list and posts a duplicate comment.All assignments not yet visible: The first run could fire before GitHub has finished processing all simultaneous assignments, so the timeline wouldn't show all assignees before removal.
Fixes
sleep 3at the start of the step gives GitHub time to process all simultaneous assignments, so all are visible in the issue timeline before any are removed.Result
Assigning 4 people simultaneously now: