Skip to content

Allow workload-balanced assignment for eligible fork pull requests - #4903

Open
priyankatiwari08 wants to merge 1 commit into
dotnet:mainfrom
priyankatiwari08:priyankatiwari08-dev/automation/fork-pr-auto-assignment
Open

priyankatiwari08 wants to merge 1 commit into
dotnet:mainfrom
priyankatiwari08:priyankatiwari08-dev/automation/fork-pr-auto-assignment

Conversation

@priyankatiwari08

@priyankatiwari08 priyankatiwari08 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Description

Propose extending Auto Assign PR Load Balancer to eligible fork pull requests by removing the head.repo.fork == false job condition and the incorrect comment claiming GitHub Actions cannot assign users to fork PRs.

This is a broader assignment-policy change, not a required fix for GitHub Copilot app usage. The app publishing issue that prompted this investigation is being addressed separately through a compliant default branch prefix and personal instructions to publish upstream without falling back to a fork. Those settings have been updated; successful upstream publishing from a new session has not yet been verified in this investigation. Same-repository PRs already qualify under the existing workflow when open, non-draft, and milestoned.

The decision for maintainers is whether ready, milestoned fork contributions should receive the same workload-balanced assignment as same-repository PRs. If fork contributions should remain manually assigned after triage, this change is not needed. If adopted, it applies to both community and maintainer forks, not just app-created PRs; the milestone gate remains in place.

Retain the upstream-repository, open, non-draft, and milestone gates, pull_request_target, existing permissions, and default trusted base-repository checkout. No PR-head code is checked out or executed. The assignment script is unchanged: existing assignees, workload ranking, and random tie-breaking are preserved. No individual review requests are added.

Add dependency-free Node.js regression tests and document their invocation and rollout behavior. No public API, runtime, localization, or package changes.

Issues

Related example: #4902 was skipped by run 39782451531. It originated from a personal fork; adding a milestone could not overcome the separate fork exclusion. The branch name itself is not checked by this workflow. This PR does not modify #4902 or its milestone.

If this policy change is adopted and the workflow lands, existing PRs still need a new supported event (opened, reopened, ready_for_review, or milestoned). Existing fork PRs can alternatively be assigned manually without this change.

Testing

Added 14 focused tests for fork/same-repository eligibility, every retained gate, target-event/trusted-base checkout configuration, and mocked fork assignment with zero, one, or two existing assignees. Coverage checks lowest-workload selection, author exclusion, existing-assignee preservation, and filling only vacancies.

Commands and results recorded during implementation:

  • node --test .github\scripts\tests\auto-assign-pr.test.cjs before the workflow fix: failed as expected, including eligible-fork rejection (false !== true).
  • node --test .github\scripts\tests\auto-assign-pr.test.cjs .github\scripts\tests\validate-triage-output.test.cjs after the fix: passed, 38 tests.
  • git diff --cached --check: passed before commit.

No live assignment mutation was performed. Hosted execution needs the updated base workflow; local tests evaluate its simple comparison/boolean expression and mock GitHub API calls. .NET build and SQL integration suites were not run because no driver or package code changed. The new suite is documented for local execution, following the existing manually invoked workflow-script test pattern. Tests were not rerun for the subsequent title/description-only clarification; implementation and test files were unchanged by that clarification.

  • Tests added or updated
  • Public API changes documented (not applicable; no public API changes)
  • Verified against customer repro (fork eligibility reproduced locally; no live PR mutation)
  • Ensure no breaking changes introduced

Guidelines

Please review the contribution guidelines before submitting a pull request:

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: a0b3b46b-9898-4b60-ba36-9b4b3a5992f1

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.

🔵 Needs a closer look

No actionable defects were identified, but missing trusted review policies and current-head verification leave approval checks incomplete for this privileged workflow.

No open issues 🎉

What changed in this PR

Enables eligible fork pull requests to use the existing auto-assignment load balancer while preserving the remaining eligibility gates and trusted-base execution.

Changes:

  • Removes the fork exclusion and its incorrect permissions comment.
  • Adds 14 dependency-free Node.js tests covering eligibility, workflow configuration, and mocked assignment behavior.
  • Documents local test execution and the supported events needed to trigger assignment after rollout.
File Description
.github/​workflows/​auto-assign-pr.yml Removes the fork restriction while retaining other eligibility gates.
.github/​scripts/​tests/​README.md Documents test invocation and rollout behavior.
.github/​scripts/​tests/​auto-assign-pr.test.cjs Adds eligibility, trusted-checkout, and assignment regression tests.

Review effort: Balanced

@priyankatiwari08 priyankatiwari08 changed the title Fix auto-assignment eligibility for fork pull requests Allow workload-balanced assignment for eligible fork pull requests Oct 27, 2026

@cheenamalhotra cheenamalhotra left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This wouldn't work, as the token doesn't have access to work on fork-based PRs/branches.

Update copilot instructions instead to prefer creating branch on this repo with prefix format if user has access.

@github-project-automation github-project-automation Bot moved this from To triage to Waiting for customer in SqlClient Board Oct 29, 2026

This branch has not been deployed

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

Labels

None yet

Projects

Status: Waiting for customer

Development

Successfully merging this pull request may close these issues.

5 participants