From 1cb776384ecd1c2a935b86096fe58ad31b9facfb Mon Sep 17 00:00:00 2001 From: Kynan Ware <47394200+BagToad@users.noreply.github.com> Date: Wed, 11 Feb 2026 14:33:13 -0700 Subject: [PATCH] Normalize /slug team shorthand to org/slug and fix docs --- api/queries_pr.go | 4 ++-- pkg/cmd/pr/create/create_test.go | 2 +- pkg/cmd/pr/shared/params.go | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/api/queries_pr.go b/api/queries_pr.go index eb2eb5494..2ee1d5e5f 100644 --- a/api/queries_pr.go +++ b/api/queries_pr.go @@ -764,8 +764,8 @@ func RemovePullRequestReviews(client *Client, repo ghrepo.Interface, prNumber in // RequestReviewsByLogin sets requested reviewers on a pull request using the GraphQL mutation. // This mutation replaces existing reviewers with the provided set unless union is true. // Only available on github.com, not GHES. -// Bot logins should include the [bot] suffix (e.g., "copilot-pull-request-reviewer[bot]"). -// Team slugs should be in the format "org/team-slug". +// Bot logins should be passed without the [bot] suffix; it is appended automatically. +// Team slugs must be in the format "org/team-slug". // When union is false (replace mode), passing empty slices will remove all reviewers. func RequestReviewsByLogin(client *Client, repo ghrepo.Interface, prID string, userLogins, botLogins, teamSlugs []string, union bool) error { // In union mode (additive), nothing to do if all lists are empty. diff --git a/pkg/cmd/pr/create/create_test.go b/pkg/cmd/pr/create/create_test.go index 2adf1007b..a5e30cfcd 100644 --- a/pkg/cmd/pr/create/create_test.go +++ b/pkg/cmd/pr/create/create_test.go @@ -987,7 +987,7 @@ func Test_createRun(t *testing.T) { `, func(inputs map[string]interface{}) { assert.Equal(t, "NEWPULLID", inputs["pullRequestId"]) assert.Equal(t, []interface{}{"hubot", "monalisa"}, inputs["userLogins"]) - assert.Equal(t, []interface{}{"/core", "/robots"}, inputs["teamSlugs"]) + assert.Equal(t, []interface{}{"OWNER/core", "OWNER/robots"}, inputs["teamSlugs"]) assert.Equal(t, true, inputs["union"]) })) }, diff --git a/pkg/cmd/pr/shared/params.go b/pkg/cmd/pr/shared/params.go index 90e1e6f89..06f599f0d 100644 --- a/pkg/cmd/pr/shared/params.go +++ b/pkg/cmd/pr/shared/params.go @@ -122,6 +122,10 @@ func AddMetadataToIssueParams(client *api.Client, baseRepo ghrepo.Interface, par var teamReviewers []string for _, r := range tb.Reviewers { if strings.ContainsRune(r, '/') { + // Normalize /slug shorthand to org/slug using the repo owner + if strings.HasPrefix(r, "/") { + r = baseRepo.RepoOwner() + r + } teamReviewers = append(teamReviewers, r) } else if r == api.CopilotReviewerLogin { botReviewers = append(botReviewers, r)