Skip to content

Conversation

@cdiaz-nex
Copy link
Contributor

@cdiaz-nex cdiaz-nex commented Oct 1, 2025

Hello, this PR enhances the workflow queue filtering mechanism to support searching for queue names across all workflows in the repository, rather than being limited to a single workflow. This improves the flexibility and reliability of the queueing logic, especially in complex repositories with multiple workflows.

Changes

  • Bump dev dependency: Upgraded vitest from ^3.1.4 to ^3.2.4 in package.json.
  • Modified the instantiation of the Waiter class in src/main.ts to pass the full list of workflows as an argument.
  • The Waiter class (src/wait.ts) now accepts a list of all workflows. When a queueName is provided, the logic:
    • Batches the list of workflows (batch size: 10) for efficiency.
    • Fetches workflow runs for each batch.
    • Aggregates all runs across workflows before filtering by queueName.
    • The filter applies to all runs across relevant workflows instead of just the initially selected one.
  • Add tests to the wait.tests.ts to increase code coverage and validate behavior when queueName is defined

Motivation

Previously, filtering by queueName only checked runs from a single workflow. In multi-workflow environments, jobs enqueued with the same queue name could be missed. This update ensures all workflows are considered, improving the accuracy of the waiting/queueing mechanism.

Copy link

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 enhances the workflow queue filtering mechanism to support searching for queue names across all workflows in the repository, rather than being limited to a single workflow. This improves the flexibility and reliability of the queueing logic in multi-workflow environments.

  • Modified the Waiter class to accept and utilize a list of all workflows when filtering by queue name
  • Implemented batched workflow run fetching (batch size: 10) to improve efficiency and avoid rate limits
  • Enhanced error handling using Promise.allSettled for graceful handling of failed workflow run requests

Reviewed Changes

Copilot reviewed 4 out of 6 changed files in this pull request and generated 1 comment.

File Description
src/wait.ts Enhanced queue filtering logic to search across all workflows with batching and error handling
src/main.ts Updated Waiter instantiation to pass the full workflows list
package.json Upgraded vitest dev dependency from ^3.1.4 to ^3.2.4
tests/wait.test.ts Added comprehensive test coverage for cross-workflow queue filtering behavior

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

…develop

Signed-off-by: Rui Chen <rui@chenrui.dev>
Copy link
Collaborator

@chenrui333 chenrui333 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks!

@chenrui333 chenrui333 merged commit 5f7f217 into softprops:master Oct 7, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants