Label Copilot detection in SuggestedReviewerActorsForRepo as a hack

Mark the piggyback-on-open-PR technique for detecting Copilot
reviewer availability as a HACK, since there is no repo-level API
to check Copilot eligibility without a PR context.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Kynan Ware 2026-03-05 10:56:47 -07:00
parent 6341588f90
commit 8f62e8116d

View file

@ -557,7 +557,9 @@ func SuggestedReviewerActors(client *Client, repo ghrepo.Interface, prID string,
func SuggestedReviewerActorsForRepo(client *Client, repo ghrepo.Interface, query string) ([]ReviewerCandidate, int, error) {
type responseData struct {
Repository struct {
// Check for Copilot availability by looking at any open PR's suggested reviewers
// HACK: There's no repo-level API to check Copilot reviewer eligibility,
// so we piggyback on an open PR's suggestedReviewerActors to detect
// whether Copilot is available as a reviewer for this repository.
PullRequests struct {
Nodes []struct {
SuggestedActors struct {