Merge pull request #13025 from cli/kw/refactor/reviewer-assignee-actor-symmetry

Consolidate actor-mode signals into ApiActorsSupported
This commit is contained in:
Kynan Ware 2026-03-25 11:43:18 -06:00 committed by GitHub
commit 8f7d20855e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 178 additions and 121 deletions

View file

@ -311,7 +311,7 @@ func IssueCreate(client *Client, repo *Repository, params map[string]interface{}
}
issue := &result.CreateIssue.Issue
// Assign users using login-based mutation when ActorAssignees is true (github.com).
// Assign users using login-based mutation when ApiActorsSupported is true (github.com).
if assigneeLogins, ok := params["assigneeLogins"].([]string); ok && len(assigneeLogins) > 0 {
err := ReplaceActorsForAssignableByLogin(client, repo, issue.ID, assigneeLogins)
if err != nil {

View file

@ -524,7 +524,7 @@ func CreatePullRequest(client *Client, repo *Repository, params map[string]inter
}
}
// Assign users using login-based mutation when ActorAssignees is true (github.com).
// Assign users using login-based mutation when ApiActorsSupported is true (github.com).
if assigneeLogins, ok := params["assigneeLogins"].([]string); ok && len(assigneeLogins) > 0 {
err := ReplaceActorsForAssignableByLogin(client, repo, pr.ID, assigneeLogins)
if err != nil {
@ -532,7 +532,7 @@ func CreatePullRequest(client *Client, repo *Repository, params map[string]inter
}
}
// TODO requestReviewsByLoginCleanup
// TODO ApiActorsSupported
// Request reviewers using either login-based (github.com) or ID-based (GHES) mutation.
// The ID-based path can be removed once GHES supports requestReviewsByLogin.
userLogins, hasUserLogins := params["userReviewerLogins"].([]string)
@ -599,6 +599,12 @@ func ReplaceActorsForAssignableByLogin(client *Client, repo ghrepo.Interface, as
actorLogins := make([]githubv4.String, len(logins))
for i, l := range logins {
// The replaceActorsForAssignable mutation requires the [bot] suffix
// for bot actor logins (e.g. "copilot-swe-agent[bot]"), unlike
// requestReviewsByLogin which has a separate botLogins field.
if l == CopilotAssigneeLogin {
l = l + "[bot]"
}
actorLogins[i] = githubv4.String(l)
}

View file

@ -963,14 +963,15 @@ func (m *RepoMetadataResult) Merge(m2 *RepoMetadataResult) {
}
type RepoMetadataInput struct {
Assignees bool
ActorAssignees bool
Reviewers bool
TeamReviewers bool
Labels bool
ProjectsV1 bool
ProjectsV2 bool
Milestones bool
Assignees bool
Reviewers bool
TeamReviewers bool
// TODO ApiActorsSupported
ApiActorsSupported bool
Labels bool
ProjectsV1 bool
ProjectsV2 bool
Milestones bool
}
// RepoMetadata pre-fetches the metadata for attaching to issues and pull requests
@ -979,7 +980,8 @@ func RepoMetadata(client *Client, repo ghrepo.Interface, input RepoMetadataInput
var g errgroup.Group
if input.Assignees || input.Reviewers {
if input.ActorAssignees {
// TODO ApiActorsSupported
if input.ApiActorsSupported {
g.Go(func() error {
actors, err := RepoAssignableActors(client, repo)
if err != nil {