Skip to content

fix: labels update in queue to avoid race conditions#31

Merged
vigneshrajsb merged 2 commits intomainfrom
label-queues
Aug 6, 2025
Merged

fix: labels update in queue to avoid race conditions#31
vigneshrajsb merged 2 commits intomainfrom
label-queues

Conversation

@vigneshrajsb
Copy link
Copy Markdown
Contributor

What

To avoid race condition when adding the deploy label before the github comment is created and posted.

@vigneshrajsb vigneshrajsb requested a review from a team as a code owner August 5, 2025 18:28
@vigneshrajsb vigneshrajsb requested a review from Copilot August 5, 2025 19:25
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 queue-based system for managing PR label updates to prevent race conditions when adding deploy labels before GitHub comments are created and posted.

  • Adds a new LabelService with a dedicated queue for handling label operations asynchronously
  • Replaces direct GitHub API calls for label updates with queued jobs that can wait for comment creation
  • Implements proper error handling and retry logic for label operations

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/shared/config.ts Adds LABEL queue name configuration
src/server/services/types/index.ts Adds LabelService to the services interface
src/server/services/label.ts Creates new LabelService with queue-based label management
src/server/services/index.ts Instantiates LabelService in the services factory
src/server/services/github.ts Replaces direct label API calls with queued label jobs
src/server/jobs/index.ts Registers the label queue worker with proper concurrency

Comment thread src/server/services/label.ts
Comment thread src/server/services/label.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@vigneshrajsb vigneshrajsb merged commit ac4f9c4 into main Aug 6, 2025
1 check 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.

2 participants