Skip to content

Actions | Introduce auto-assign-pr workflow#4275

Open
cheenamalhotra wants to merge 9 commits into
mainfrom
dev/cheena/auto-assign-prs
Open

Actions | Introduce auto-assign-pr workflow#4275
cheenamalhotra wants to merge 9 commits into
mainfrom
dev/cheena/auto-assign-prs

Conversation

@cheenamalhotra
Copy link
Copy Markdown
Member

@cheenamalhotra cheenamalhotra commented May 12, 2026

Summary

Adds a GitHub Actions workflow to auto-assign up to 2 assignees to PRs once they are open, non-draft, and associated with a milestone.

What changed

  • Added PR triggers for opened, reopened, ready_for_review, and milestoned
  • Only runs for qualifying PRs with draft == false and milestone != null
  • Preserves existing assignees and only adds new ones when fewer than 2 are assigned
  • Excludes the PR author from assignment
  • Selects assignees from the configured 6-person pool based on the lowest number of active open assigned PRs
  • Uses pulls.list pagination instead of Search API calls to avoid search rate-limit pressure
  • Randomizes tie-breaking before sorting by workload

Validation

  • Reviewed qualifying PR trigger conditions
  • Reviewed additive assignment behavior for 0 or 1 existing assignee
  • Reviewed edge cases for author exclusion, tie handling, and candidate exhaustion
  • Reviewed action runs successfully on PRs created from same repo branches.
  • Need to review actions on fork-based PRs after this actions is available on 'main' branch, which will come under 'pull_request_target' event.

Demo

Action on this PR ran successfully:

image

@cheenamalhotra cheenamalhotra requested a review from a team as a code owner May 12, 2026 01:53
Copilot AI review requested due to automatic review settings May 12, 2026 01:53
@github-project-automation github-project-automation Bot moved this to To triage in SqlClient Board May 12, 2026
@cheenamalhotra cheenamalhotra added this to the 7.1.0-preview2 milestone May 12, 2026
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 GitHub Actions workflow that automatically assigns up to two assignees to qualifying pull requests (non-draft, milestone set), selecting from a fixed pool and balancing based on current open-PR assignment load.

Changes:

  • Added a new auto-assign-pr workflow triggered by PR lifecycle + milestone events.
  • Implemented workload calculation via pulls.list pagination and randomized tie-breaking.
  • Applied additive assignee updates (preserving existing assignees, excluding PR author).

Comment thread .github/workflows/auto-assign-pr.yml Outdated
Comment thread .github/workflows/auto-assign-pr.yml
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 12, 2026 01:58
@cheenamalhotra cheenamalhotra moved this from To triage to In review in SqlClient Board May 12, 2026
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

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

Comment thread .github/workflows/auto-assign-pr.yml Outdated
Comment thread .github/workflows/auto-assign-pr.yml Outdated
Comment thread .github/workflows/auto-assign-pr.yml Outdated
Comment thread .github/workflows/auto-assign-pr.yml Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 12, 2026 02:11
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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

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

Comment thread .github/workflows/auto-assign-pr.yml
Comment thread .github/workflows/auto-assign-pr.yml
Agent-Logs-Url: https://github.com/dotnet/SqlClient/sessions/bc01d92e-6a2a-4100-9819-bd6add127662

Co-authored-by: cheenamalhotra <13396919+cheenamalhotra@users.noreply.github.com>
@cheenamalhotra cheenamalhotra marked this pull request as draft May 12, 2026 03:48
@cheenamalhotra cheenamalhotra marked this pull request as ready for review May 12, 2026 03:48
Copilot AI review requested due to automatic review settings May 12, 2026 03:48
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

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

Comment thread .github/workflows/auto-assign-pr.yml
Comment thread .github/workflows/auto-assign-pr.yml
Comment thread .github/workflows/auto-assign-pr.yml Outdated
Agent-Logs-Url: https://github.com/dotnet/SqlClient/sessions/f7cc4b22-e560-46ff-bc90-898ef69a406a

Co-authored-by: cheenamalhotra <13396919+cheenamalhotra@users.noreply.github.com>
Copilot stopped work on behalf of cheenamalhotra due to an error May 13, 2026 02:15
Copilot AI review requested due to automatic review settings May 13, 2026 02:21
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

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

Comment thread .github/workflows/auto-assign-pr.yml
Comment thread .github/workflows/auto-assign-pr.yml Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

6 participants