Skip to content

Actions | Introduce auto-assign-pr workflow#4275

Merged
cheenamalhotra merged 18 commits into
mainfrom
dev/cheena/auto-assign-prs
Jun 5, 2026
Merged

Actions | Introduce auto-assign-pr workflow#4275
cheenamalhotra merged 18 commits into
mainfrom
dev/cheena/auto-assign-prs

Conversation

@cheenamalhotra

@cheenamalhotra cheenamalhotra commented May 12, 2026

Copy link
Copy Markdown
Member

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 01:58
@cheenamalhotra cheenamalhotra moved this from To triage to In review in SqlClient Board May 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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
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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/auto-assign-pr.yml Outdated
cheenamalhotra and others added 2 commits June 1, 2026 22:26
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 2, 2026 05:27
@cheenamalhotra cheenamalhotra marked this pull request as draft June 2, 2026 05:28
@cheenamalhotra cheenamalhotra marked this pull request as ready for review June 2, 2026 05:28
@cheenamalhotra cheenamalhotra moved this from Waiting for customer to In review in SqlClient Board Jun 2, 2026
@cheenamalhotra cheenamalhotra modified the milestone: 7.1.0-preview2 Jun 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread .github/scripts/auto-assign-pr.js
Comment thread .github/workflows/auto-assign-pr.yml
@cheenamalhotra cheenamalhotra marked this pull request as draft June 2, 2026 05:35
@cheenamalhotra cheenamalhotra marked this pull request as ready for review June 2, 2026 05:35
@cheenamalhotra cheenamalhotra force-pushed the dev/cheena/auto-assign-prs branch from b622250 to 1e0291b Compare June 2, 2026 05:40
@cheenamalhotra cheenamalhotra marked this pull request as draft June 2, 2026 05:40
@cheenamalhotra cheenamalhotra marked this pull request as ready for review June 2, 2026 05:40
Copilot AI review requested due to automatic review settings June 2, 2026 05:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 2 out of 2 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
Comment thread .github/scripts/auto-assign-pr.js
@cheenamalhotra cheenamalhotra marked this pull request as draft June 2, 2026 05:46
@cheenamalhotra cheenamalhotra marked this pull request as ready for review June 2, 2026 05:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread .github/workflows/auto-assign-pr.yml Outdated
Comment thread .github/workflows/auto-assign-pr.yml
Comment thread .github/workflows/auto-assign-pr.yml
@paulmedynski

Copy link
Copy Markdown
Contributor

I've added a few more reviewers - only need one more admin to approve. Let's get this merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

8 participants