You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Avoid discovery reads for ordinary PR reviewer updates - #35575
Adding or removing ordinary PR reviewers currently invokes CLI discovery even when Orca already knows the repository, PR number and reviewer logins. Send those updates directly to the requested_reviewers REST endpoint with one mutation.
This avoids the CLI's PR discovery read while still performing one write. Team names, comma-separated input, bot identifiers and special aliases retain the existing CLI interpretation. Mixed selections also use the CLI. Input trimming, explicit repository/host/WSL/SSH routing, permits, mutation invalidation and error results are preserved. Failed writes are never retried through a second mutation path.
Validation: 47 tests pass across four files, including mutation routing and invalidation. Replaying the original production module fails both direct-request regressions while all 16 syntax/error controls pass. A loopback HTTP check with the installed CLI confirms POST and DELETE each send exactly one request with {"reviewers":["alice","bob"]}; no live PR was mutated as a benchmark. pnpm check:changed --maxWorkers=2 --timeout=6 passed all 20 non-test checks; broad related-test discovery timed out at six minutes without results. Claude independently passed 91 tests across seven suites with no actionable findings. No IPC or UI changes.
The add and remove reviewer operations now use shared logic to select an update path. Standard reviewer logins use the requested-reviewers API. Other reviewer values use gh pr edit. Tests cover both paths and check request arguments, repository routing, resource handling, and lookup invalidation.
Priority: Low
Merge Risk: Low · up to 2a826
Reviewer updates for ordinary usernames now use one direct API call. Manually typing the unsuffixed Copilot reviewer login can still fail, because it is sent without the [bot] suffix. This is a narrow edge case with a workaround, which is to use the @copilot alias. The fix is small and can land before or after merge.
Pre-merge checks: 3 · 2
Failed checks: 2 warnings
Check name
Status
Explanation
Resolution
Description check
The description explains the change, rationale, preserved behavior, and validation results. However, it does not follow the required template structure and omits or leaves incomplete required items, i…
Rewrite the description using all required template headings. Add the linked issue under “Linked Issue,” state “N/A” with a reason under “Visual Proof” if applicable, complete the testing and checklist items, and address AI disclosure and r…
Docstring Coverage
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 3 passed
Check name
Status
Explanation
Title check
The title clearly summarizes the main change: avoiding discovery reads for ordinary pull request reviewer updates.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Description check
Explanation
The description explains the change, rationale, preserved behavior, and validation results. However, it does not follow the required template structure and omits or leaves incomplete required items, including the linked issue, explicit visual-proof statement, testing checkboxes, AI disclosure, review notes, agent-skill boundary, and checklist.
Resolution
Rewrite the description using all required template headings. Add the linked issue under “Linked Issue,” state “N/A” with a reason under “Visual Proof” if applicable, complete the testing and checklist items, and address AI disclosure and review notes.
Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 2 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches: 💡 1
📝 Generate docstrings: 💡
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
The reason will be displayed to describe this comment to others. Learn more.
Failed writes lose test coverage
The deleted test checked that a rejected reviewer update returns its error, releases its permit, and never tries another write path. The remaining tests make mocks.exec succeed, so they no longer protect these promises for failed add and remove operations. Restoring that test would help catch later changes that break the PR’s single-write promise.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
<source_evidence>
<source kind="search">
<title>Using GitHub Copilot code review - GitHub Docs</title>
<location>https://docs.github.com/en/copilot/how-tos/use-copilot-agents/request-a-code-review/use-code-review?tool=cli</location>
<excerpt>citeturn0search5 [wordlim: 200] Crawled: last month; You can also request a review from Copilot through the GitHub REST API by requesting `copilot-pull-request-reviewer[bot]` as a reviewer. ... These instructions explain how to use Copilot code review with the GitHub CLI.
For more information, see Incorporating feedback in your pull request.
You can also invoke Copilot cloud agent to implement suggested changes. To do this, you must:
* Enable GitHub Copilot code review and Copilot cloud agent.
* On review comments from GitHub Copilot code review, click Fix with Copilot. This creates a draft comment on the pull request, where you can instruct Copilot to address specific feedback. You can then select whether Copilot will create a new pull request against your branch or a commit to the same pull request with the suggestions applied.
6. Copilot's review comments behave like review comments from humans. You can add reactions to them, comment on them, resolve them and hide them.
Any comments you add to Copilot's review comments will be visible to humans, but they won't be visible to Copilot, and Copilot won't reply.
You can also request a review from Copilot through the GitHub REST API by requesting `copilot-pull-request-reviewer[bot]` as a reviewer. For more information, see REST API endpoints for review requests.
## Using Copilot code review
These instructions explain how to use Copilot code review with the GitHub CLI. To see instructions for other popular coding environments, click the appropriate tab at the top of the page.
### Requesting a review when creating a pull request
You can request a review from Copilot when creating a new pull request using `gh pr create`:
Shell
gh pr create --reviewer @copilot
`gh pr create --reviewer @copilot
`
You can also select Copilot interactively from the searchable reviewer prompt during `gh pr create`.
`? Reviewers [Use arrows to move, space to select, <right> to all, <left> to none, type to filter]
[ ] Search (7472 more)
[x] monalisa (Mona Lisa)
> [x] Copilot (AI)
`
### Requesting a review on an existing pull request
To request a review from Copilot on an existing pull request, use `gh pr edit`. If you are not on the pull request's branch, specify the pull request number:
Shell
gh pr edit PR-NUMBER --add-reviewer @copilot
`gh pr edit PR-NUMBER --add-reviewer @copilot
`
Replace `PR-NUMBER` with the number of the pull request you want reviewed. If you have the pull request's branch checked out, you can omit the number.</excerpt>
</source>
<source kind="search">
<title>Copilot code review · cli/cli@175188d · GitHub</title>
<location>https://github.com/cli/cli/actions/runs/19280132933</location>
<excerpt>citeturn0search6 [wordlim: 200] Published: last year; Crawled: 3 weeks ago; cli / cli Public ... # Copilot code review #22 ... ## copilot-pull-request-reviewer ... Details: Resource not accessible by integration - https://docs.github.com/rest [Button: Show more] [Button: Show less]
cli / cli Public
* Notifications You must be signed in to change notification settings
* Fork 9.1k
* Star
* Code
* Issues 1k
* Pull requests 74
* Discussions
* Actions
* Projects
* Security and quality 17
* Insights
# Copilot code review #22
* Sign in to view logs
## Summary
# Copilot code review
##
Copilot code review #22
### Uh oh!
There was an error while loading. Please reload this page.
Triggered via dynamic November 11, 2025 22:22
Copilot
175188d
refs/pull/12140/head
Status Success
Total duration 5m 3s
## copilot-pull-request-reviewer
on: dynamic
Prepare 5s Prepare
Autovalidate 0s Autovalidate
Matrix: CodeQL analysis
1 job completed
Show all jobs
Agent 2m 3s Agent
Upload results 7s Upload results
Cleanup artifacts 6s Cleanup artifacts
## Annotations
1 warning
CodeQL analysis (go) This run of the CodeQL Action does not have permission to access the CodeQL Action API endpoints. This could be because the Action is running on a pull request from a fork. If not, please ensure the workflow has at least the 'security-events: read' permission. Details: Resource not accessible by integration - https://docs.github.com/rest [Button: Show more] [Button: Show less]
You can’t perform that action at this time.</excerpt>
</source>
<source kind="search">
<title>Copilot code review · cli/cli@f648460 · GitHub</title>
<location>https://github.com/cli/cli/actions/runs/26292737192</location>
<excerpt>citeturn0search0 [wordlim: 200] Published: 5 months ago; Crawled: 3 weeks ago; cli / cli Public ... # Copilot code review #249 ... ## copilot-pull-request-reviewer
cli / cli Public
* Notifications You must be signed in to change notification settings
* Fork 9.1k
* Star
* Code
* Issues 1k
* Pull requests 74
* Discussions
* Actions
* Projects
* Security and quality 17
* Insights
# Copilot code review #249
* Sign in to view logs
## Summary
# Copilot code review
##
Copilot code review #249
### Uh oh!
There was an error while loading. Please reload this page.
Triggered via dynamic May 22, 2026 14:10
Copilot
f648460
refs/pull/13491/head
Status Success
Total duration 1m 58s
## copilot-pull-request-reviewer
on: dynamic
Prepare 6s Prepare
Agent 1m 21s Agent
Upload results 7s Upload results
Cleanup artifacts 3s Cleanup artifacts</excerpt>
</source>
<source kind="search">
<title>Copilot code review · cli/cli@ded47e2 · GitHub</title>
<location>https://github.com/cli/cli/actions/runs/26237670340</location>
<excerpt>citeturn0search1 [wordlim: 200] Published: 5 months ago; Crawled: 3 weeks ago; cli / cli Public ... # Copilot code review #244 ... ## copilot-pull-request-reviewer
cli / cli Public
* Notifications You must be signed in to change notification settings
* Fork 9.1k
* Star
* Code
* Issues 1k
* Pull requests 74
* Discussions
* Actions
* Projects
* Security and quality 17
* Insights
# Copilot code review #244
* Sign in to view logs
## Summary
# Copilot code review
##
Copilot code review #244
### Uh oh!
There was an error while loading. Please reload this page.
Triggered via dynamic May 21, 2026 16:02
Copilot
ded47e2
refs/pull/13481/head
Status Success
Total duration 2m 25s
## copilot-pull-request-reviewer
on: dynamic
Prepare 5s Prepare
Agent 1m 42s Agent
Upload results 12s Upload results
Cleanup artifacts 4s Cleanup artifacts</excerpt>
</source>
<source kind="search">
<title>Using GitHub Copilot code review - GitHub Docs</title>
<location>https://docs.github.com/en/copilot/how-tos/use-copilot-agents/use-code-review</location>
<excerpt>citeturn0search2 [wordlim: 200] Crawled: today; Learn how to request a code review from GitHub Copilot. ... You can also request a review from Copilot through the GitHub REST API by requesting `copilot-pull-request-reviewer[bot]` as a reviewer.
For more information, see Incorporating feedback in your pull request.
You can also invoke Copilot cloud agent to implement suggested changes. To do this, you must:
* Enable GitHub Copilot code review and Copilot cloud agent.
* On review comments from GitHub Copilot code review, click Fix with Copilot. This creates a draft comment on the pull request, where you can instruct Copilot to address specific feedback. You can then select whether Copilot will create a new pull request against your branch or a commit to the same pull request with the suggestions applied.
6. Copilot's review comments behave like review comments from humans. You can add reactions to them, comment on them, resolve them and hide them.
Any comments you add to Copilot's review comments will be visible to humans, but they won't be visible to Copilot, and Copilot won't reply.
You can also request a review from Copilot through the GitHub REST API by requesting `copilot-pull-request-reviewer[bot]` as a reviewer. For more information, see REST API endpoints for review requests.
</excerpt>
</source>
<omitted_sources count="8">Additional source records were omitted from this bounded result.</omitted_sources>
</source_evidence>
Citations:
- 1: https://github.com/cli/cli/actions/runs/19280132933?utm_source=openai
- 2: https://docs.github.com/en/copilot/how-tos/use-copilot-agents/request-a-code-review/use-code-review?tool=cli&utm_source=openai
<source_evidence>
<source kind="search">
<title>GitHub CLI: pkg/cmd/pr/shared/params.go | Fossies</title>
<location>https://fossies.org/linux/gh-cli/pkg/cmd/pr/shared/params.go</location>
<excerpt>citeturn0search0 [wordlim: 200] Published: last month; Crawled: last month; 338 // NewCopilotReplacer creates a replacer for assignee @copilot references.
339 func NewCopilotReplacer(returnLogin bool) *CopilotReplacer {
265 }
266 return query.AdvancedIssueSearchString()
267 }
268
269 func QueryHasStateClause(searchQuery string) bool {
270 argv, err := shlex.Split(searchQuery)
271 if err != nil {
272 return false
273 }
274
275 for _, arg := range argv {
276 if arg == "is:closed" || arg == "is:merged" || arg == "state:closed" || arg == "state:merged" || strings.HasPrefix(arg, "merged:") || strings.HasPrefix(arg, "closed:") {
277 return true
278 }
279 }
280
281 return false
282 }
283
284 // MeReplacer resolves usages of `@me` to the handle of the currently logged in user.
285 type MeReplacer struct {
286 apiClient *api.Client
287 hostname string
288 login string
289 }
290
291 func NewMeReplacer(apiClient *api.Client, hostname string) *MeReplacer {
292 return &MeReplacer{
293 apiClient: apiClient,
294 hostname: hostname,
295 }
296 }
297
298 func (r *MeReplacer) currentLogin() (string, error) {
299 if r.login != "" {
300 return r.login, nil
301 }
302 login, err := api.CurrentLoginName(r.apiClient, r.hostname)
303 if err != nil {
304 return "", fmt.Errorf("failed resolving `@me` to your user handle: %w", err)
305 }
306 r.login = login
307 return login, nil
308 }
309
310 func (r *MeReplacer) Replace(handle string) (string, error) {
311 if handle == "@me" {
312 return r.currentLogin()
313 }
314 return handle, nil
315 }
316
317 func (r *MeReplacer) ReplaceSlice(handles []string) ([]string, error) {
318 res := make([]string, len(handles))
319 for i, h := range handles {
320 var err error
321 res[i], err = r.Replace(h)
322 if err != nil {
323 return nil, err
324 }
325 }
326 return res, nil
327 }
328
329 // CopilotReplacer resolves usages of `@copilot` to either Copilot's login or name.
330 // Login is generally needed for API calls; name is used when launching web browser.
331 type CopilotReplacer struct {
332 returnLogin bool
333 // copilotLogin is the login to use when replacing @copilot.
334 // Different Copilot features use different bot logins.
335 copilotLogin string
336 }
337
338 // NewCopilotReplacer creates a replacer for assignee @copilot references.
339 func NewCopilotReplacer(returnLogin bool) *CopilotReplacer {
340 return &CopilotReplacer{
341 returnLogin: returnLogin,
342 copilotLogin: api.CopilotAssigneeLogin,
343 }
344 }
345
346 // NewCopilotReviewerReplacer creates a replacer for reviewer @copilot references.
347 func NewCopilotReviewerReplacer() *CopilotReplacer {
348 return &CopilotReplacer{
349 returnLogin: true,
350 copilotLogin: api.CopilotReviewerLogin,
351 }
352 }
353
354 func (r *CopilotReplacer) replace(handle string) string {
355 if !strings.EqualFold(handle, "@copilot") {
356 return handle
357 }
358 if r.returnLogin {
359 return r.copilotLogin
360 }
361 return api.CopilotActorName
362 }
363
364 // ReplaceSlice replaces usages of `@copilot` in a slice with Copilot's login.
365 func (r *CopilotReplacer) ReplaceSlice(handles []string) []string {
</excerpt>
</source>
<source kind="search">
<title>cli/pkg/cmd/pr/create/create.go at trunk · cli/cli · GitHub</title>
<location>https://github.com/cli/cli/blob/trunk/pkg/cmd/pr/create/create.go</location>
<excerpt>citeturn1search0 [wordlim: 200] Crawled: 5 days ago; "github.com/cli/cli/v2/pkg/cmd/pr/shared"
"github.com/cli/cli/v2/pkg/cmdutil" ... TitledEditSurvey: shared.TitledEditSurvey(&shared.UserEditor{Config: f.Config, IO: f.IOStreams}), ... _ = cmd.RegisterFlagCompletionFunc("reviewer", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { ... x := regexPattern.ReplaceAllString(commit.Body, " ")
fl.BoolVarP(&opts.WebMode, "web", "w", false, "Open the web browser to create a pull request")
fl.BoolVarP(&opts.FillVerbose, "fill-verbose", "", false, "Use commits msg+body for description")
fl.BoolVarP(&opts.Autofill, "fill", "f", false, "Use commit info for title and body")
fl.BoolVar(&opts.FillFirst, "fill-first", false, "Use first commit info for title and body")
fl.StringSliceVarP(&opts.Reviewers, "reviewer", "r", nil, "Request reviews from people or teams by their `handle`")
fl.StringSliceVarP(&opts.Assignees, "assignee", "a", nil, "Assign people by their `login`. Use \"@me\" to self-assign.")
fl.StringSliceVarP(&opts.Labels, "label", "l", nil, "Add labels by `name`")
fl.StringSliceVarP(&opts.Projects, "project", "p", nil, "Add the pull request to projects by `title`")
fl.StringVarP(&opts.Milestone, "milestone", "m", "", "Add the pull request to a milestone by `name`")
fl.Bool("no-maintainer-edit", false, "Disable maintainer's ability to modify pull request")
fl.StringVar(&opts.RecoverFile, "recover", "", "Recover input from a failed run of create")
fl.StringVarP(&opts.Template, "template", "T", "", "Template `file` to use as starting body text")
fl.BoolVar(&opts.DryRun, "dry-run", false, "Print details instead of creating the PR. May still push git changes.")
opts.AttachFlag = attachments.AddFlag(cmd)
_ = cmdutil.RegisterBranchCompletionFlags(f.GitClient, cmd, "base", "head")
_ = cmd.RegisterFlagCompletionFunc("reviewer", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
results, err := requestableReviewersForCompletion(opts)
if err != nil {
return nil, cobra.ShellCompDirectiveError
}
return results, cobra.ShellCompDirectiveNoFileComp
})
return cmd
}
func createRun(opts *CreateOptions) error {
ctx, err := NewCreateContext(opts)
if err != nil {
return err
}
if isSameRef(ctx.PRRefs) {
return fmt.Errorf("head branch %q is the same as base branch %q, cannot create a pull request", ctx.PRRefs.UnqualifiedHeadRef(), ctx.PRRefs.BaseRef())
m)^`)
func initDefaultTitleBody(ctx CreateContext, state *shared.IssueMetadataState, useFirstCommit bool, addBody bool) error {
commits, err := ctx.GitClient.Commits(context.Background(), ctx.BaseTrackingBranch, ctx.PRRefs.UnqualifiedHeadRef())
if err != nil {
return err
}
if len(commits) == 1 || useFirstCommit {
state.Title = commits[len(commits)-1].Title
state.Body = commits[len(commits)-1].Body
} else {
state.Title = humanize(ctx.PRRefs.UnqualifiedHeadRef())
var body strings.Builder
for i, commit := range slices.Backward(commits) {
fmt.Fprintf(&body, "- **%s**\n", commit.Title)
if addBody {
x := regexPattern.ReplaceAllString(commit.Body, " ")
fmt.Fprintf(&body, "%s", x)
if i > 0 {
fmt.Fprintln(&body)
fmt.Fprintln(&body)
}
}
}
state.Body = body.String()
}
return nil
}
func NewIssueState(ctx CreateContext, opts CreateOptions, apiActorsSupported bool) (*shared.IssueMetadataState, error) {
var milestoneTitles []string
if opts.Milestone != "" {
milestoneTitles = []string{opts.Milestone}
}
assigneeReplacer := shared.NewSpecialAssigneeReplacer(ctx.Client, ctx.PRRefs.BaseRepo().RepoHost(), apiActorsSupported, !opts.WebMode)
assignees, err := assigneeReplacer.ReplaceSlice(opts.Assignees)
if err != nil {
return nil, err
}
copilotReplacer := shared.NewCopilotReviewerReplacer()
reviewers := copilotReplacer.ReplaceSlice(opts.Reviewers)
state := &shared.IssueMetadataState{
Type: shared.PRMetadata,
Reviewers: reviewers,
Assignees: assignees,
Labels: opts.Labels,
ProjectTitles: opts.Projects,
Milestones: milestoneTitles,
Draft: opts.IsDraft,
}
if opts.FillVerbose || opts.Autofill || opts.FillFirst || !opts.TitleProvided || !opts.BodyProvided {
err := initDefaultTitleBody(ctx, state, opts.FillFirst, opts.FillVerbose)
if err != nil && (opts.FillVerbose || opts.Autofill || opts.FillFirst) {
return nil, fmt.Errorf("could not compute title or body defaults: %w", err)
}
}
return state, nil
}
</excerpt>
</source>
<source kind="search">
<title>GitHub CLI | Take GitHub to the command line</title>
<location>https://cli.github.com/manual/gh_pr_edit</location>
<excerpt>citeturn1search3 [wordlim: 200] Crawled: yesterday; * `@copilot`: request or remove review from Copilot (not supported on GitHub Enterprise Server) ... $ gh pr edit 23 --add-reviewer "@copilot"
## gh pr edit
`gh pr edit [<number> | <url> | <branch>] [flags]
`
Edit a pull request.
Without an argument, the pull request that belongs to the current branch is selected.
Editing a pull request's projects requires authorization with the `project` scope. To authorize, run `gh auth refresh -s project`.
Use `--attach` to upload an image or video. Without a body flag the pull request keeps the body it already has and the attachment is appended to it. If the body references an attached file, such as ``, that reference is rewritten to point at the uploaded asset instead. Paths in a `--body-file` are relative to its directory, falling back to the working directory. You can attach up to 50 files per command.
Alt text for an image follows the path after `#`, as in `--attach './login.png#The login error state'`. Without it the filename is used. A reference already in the body keeps the alt text written there. Video renders as a player and has no alt text, so it cannot be given any.
If some attachments upload and others fail, the pull request is still updated with the ones that succeeded. The command then exits with a non-zero status, but the pull request's URL is still printed to stdout.
The `--add-assignee` and `--remove-assignee` flags both support the following special values:
* `@me`: assign or unassign yourself
* `@copilot`: assign or unassign Copilot (not supported on GitHub Enterprise Server)
The `--add-reviewer` and `--remove-reviewer` flags support the following special value:
* `@copilot`: request or remove review from Copilot (not supported on GitHub Enterprise Server)
### Options
`--add-assignee <login>`
Add assigned users by their login. Use "@me" to assign yourself, or "@copilot" to assign Copilot.
`--add-label <name>`
Add labels by name
`--add-project <title>`
Add the pull request to projects by title
`--add-reviewer <login>`
Add or re-request reviewers by their login. Use "@copilot" to request review from Copilot.
`--attach <file>`
Attach an image or video file, in '<file>#<image alt text>' format
`-B`, `--base <branch>`
Change the base branch for this pull request
`-b`, `--body <string>`
Set the new body.
`-F`, `--body-file <file>`
Read body text from file (use "-" to read from standard input)
`-m`, `--milestone <name>`
Edit the milestone the pull request belongs to by name
`--remove-assignee <login>`
Remove assigned users by their login. Use "@me" to unassign yourself, or "@copilot" to unassign Copilot.
`--remove-label <name>`
Remove labels by name
`--remove-milestone`
Remove the milestone association from the pull request
`--remove-project <title>`
Remove the pull request from projects by title
`--remove-reviewer <login>`
Remove reviewers by their login. Use "@copilot" to remove review request from Copilot.
`-t`, `--title <string>`
Set the new title.
### Options inherited from parent commands
`-R`, `--repo <[HOST/]OWNER/REPO>`
Select another repository using the [HOST/]OWNER/REPO format
### Examples
`# Edit the title and body of a pull request
$ gh pr edit 23 --title "I found a bug" --body "Nothing works"
# Use a file as the body
$ gh pr edit 23 --body-file body.txt
# Append a screenshot to the body, with alt text after "#"
$ gh pr edit 23 --attach './login.png#The login error state'
# Append multiple files by repeating the flag
$ gh pr edit 23 --attach ./before.png --attach ./after.png
# Manage labels
$ gh pr edit 23 --add-label "bug,help wanted" --remove-label "core"
# Manage reviewers
$ gh pr edit 23 --add-reviewer monalisa,hubot --remove-reviewer myorg/team-name
# Re-request review
$ gh pr edit 23 --add-reviewer monalisa
# Request a review from GitHub Copilot
$ gh pr edit 23 --add-reviewer "@copilot"
# Manage assignees
$ gh pr edit 23 --add-assignee "@me" --remove-assignee monalisa,hubot
# Assign GitHub Copilot
$ gh pr edit 23 --add-assignee "@copilot"
# Manage projects and milestones
$ gh pr edit 23 --add-project "Roadmap" --remove-project v1,v2
$ gh pr edit 23 --milestone "Version 1"
$ gh pr edit 23 --remove-milestone`
### See also
* gh pr</excerpt>
</source>
<source kind="search">
<title>shared package - github.com/cli/cli/v2/pkg/cmd/pr/shared - Go Packages</title>
<location>https://pkg.go.dev/github.com/cli/cli/v2%40v2.101.0/pkg/cmd/pr/shared</location>
<excerpt>citeturn0search1 [wordlim: 200] Published: last month; Crawled: last month; * * func NewCopilotReplacer(returnLogin bool) *CopilotReplacer
* func ConfirmPRSubmission(p Prompt, allowPreview, allowMetadata, isDraft bool) (Action, error)
* type CachedBranchConfigGitConfigClient
* * func (c CachedBranchConfigGitConfigClient) ReadBranchConfig(ctx context.Context, branchName string) (git.BranchConfig, error)
* type Comment
* type Commentable
* type CommentableOptions
* type CopilotReplacer
* * func NewCopilotReplacer(returnLogin bool) *CopilotReplacer
* func NewCopilotReviewerReplacer() *CopilotReplacer
* * func (r *CopilotReplacer) ReplaceSlice(handles []string) []string
* type DefaultPRHead
* * func TryDetermineDefaultPRHead(gitClient GitConfigClient, remoteToRepo remoteToRepoResolver, branch string) (DefaultPRHead, error)
* type EditPrompter
* type Editable
* * func (e Editable) AssigneeIds(client *api.Client, repo ghrepo.Interface) (*[]string, error)
#### type CopilotReplacer ¶ added in v2.73.0
type CopilotReplacer struct {
// contains filtered or unexported fields
}
CopilotReplacer resolves usages of `@copilot` to either Copilot's login or name. Login is generally needed for API calls; name is used when launching web browser.
#### func NewCopilotReplacer ¶ added in v2.73.0
func NewCopilotReplacer(returnLogin bool) *CopilotReplacer
NewCopilotReplacer creates a replacer for assignee @copilot references.
#### func NewCopilotReviewerReplacer ¶ added in v2.87.0
func NewCopilotReviewerReplacer() *CopilotReplacer
NewCopilotReviewerReplacer creates a replacer for reviewer @copilot references.
#### func (*CopilotReplacer) ReplaceSlice ¶ added in v2.73.0
func (r *CopilotReplacer) ReplaceSlice(handles []string) []string
ReplaceSlice replaces usages of `@copilot` in a slice with Copilot's login.
#### type DefaultPRHead ¶ added in v2.71.0
type DefaultPRHead struct {
Repo o.Option[ghrepo.Interface]
BranchName string
}
DefaultPRHead is a neighbour to defaultPushTarget, but instead of holding basic git remote information, it holds a resolved repository in `gh` terms.
Since we may not be able to determine a default remote for a branch, this is also true of the resolved repository.
#### func TryDetermineDefaultPRHead ¶ added in v2.71.0
func TryDetermineDefaultPRHead(gitClient GitConfigClient, remoteToRepo remoteToRepoResolver, branch string) (DefaultPRHead, error)
TryDetermineDefaultPRHead is a thin wrapper around determineDefaultPushTarget, which attempts to convert a present remote into a resolved repository. </excerpt>
</source>
<source kind="search">
<title>shared package - github.com/cli/cli/v2/pkg/cmd/pr/shared - Go Packages</title>
<location>https://pkg.go.dev/github.com/cli/cli/v2%40v2.102.0/pkg/cmd/pr/shared</location>
<excerpt>citeturn0search2 [wordlim: 200] Published: 4 weeks ago; Crawled: 2 weeks ago; github.com/cli/cli ... * NewCopilotReplacer(returnLogin)
When a project reaches major version v1 it is considered stable.
* Learn more about best practices
## Repository
github.com/cli/cli
## Links
* Open Source Insights
* Documentation
* Index
* Constants
* Variables
* Functions
* AddMetadataToIssueParams(client, baseRepo, params, tb, projectV1Support)
* Types
* type Action
* ConfirmIssueSubmission(p, allowPreview, allowMetadata)
* ConfirmPRSubmission(p, allowPreview, allowMetadata, isDraft)
* type CachedBranchConfigGitConfigClient
* (c) ReadBranchConfig(ctx, branchName)
* type Comment
* type Commentable
* type CommentableOptions
* type CopilotReplacer
* NewCopilotReplacer(returnLogin)
* NewCopilotReviewerReplacer()
* (tb) HasMetadata()
* (tb) IsDirty()
* (tb) MarkDirty()
* type ListOptions
* type MeReplacer
* NewMeReplacer(apiClient, hostname)
* (r) Replace(handle)
* (r) ReplaceSlice(handles)
* type MetadataFetcher
* (mf) RepoMetadataFetch(input)
* type NotFoundError
* (err) Unwrap()
* type PRFindRefs
* (r) BaseRepo()
* (r) Matches(baseBranchName, qualifiedHeadRef)
* (r) QualifiedHeadRef()
* (r) UnqualifiedHeadRef()
* type PRFinder
* NewFinder(factory)
* type PRLister
* NewLister(httpClient)
* type Prompt
* type PullRequestFindRefsResolver
* NewPullRequestFindRefsResolver(gitConfigClient, remotesFn)
* (r) ResolvePullRequestRefs(baseRepo, baseBranchName, localBranchName)
* type QualifiedHeadRef
* NewQualifiedHeadRef(owner, branchName)
* NewQualifiedHeadRefWithoutOwner(branchName)
* ParseQualifiedHeadRef(ref)
* (r) BranchName()
* (r) String()
* type RemoteNameToRepoFn
* type RepoMetadataFetcher
* type SpecialAssigneeReplacer
* NewSpecialAssigneeReplacer(client, host, actorAssignees, copilotUseLogin)
* (r) ReplaceSlice(logins)
* type Template
* type UserEditor
* (e) Edit(filename, initialValue)
* type WorktreeTarget
* ResolveWorktreeTarget(client, path)
* type PRLister
* * func NewLister(httpClient *http.Client) PRLister
* type Prompt
* type PullRequestFindRefsResolver
* * func NewPullRequestFindRefsResolver(gitConfigClient GitConfigClient, remotesFn func() (ghContext.Remotes, error)) PullRequestFindRefsResolver
* * func (r *PullRequestFindRefsResolver) ResolvePullRequestRefs(baseRepo ghrepo.Interface, baseBranchName, localBranchName string) (PRFindRefs, error)
* type QualifiedHeadRef
* * func NewQualifiedHeadRef(owner string, branchName string) QualifiedHeadRef
* func NewQualifiedHeadRefWithoutOwner(branchName string) QualifiedHeadRef
* func ParseQualifiedHeadRef(ref string) (QualifiedHeadRef, error)
* * func (r QualifiedHeadRef) BranchName() string
* func (r QualifiedHeadRef) String() string
* type RemoteNameToRepoFn
* type RepoMetadataFetcher
* type SpecialAssigneeReplacer
* * func NewSpecialAssigneeReplacer(client *api.Client, host string, actorAssignees bool, copilotUseLogin bool) *SpecialAssigneeReplacer
* * func (r *SpecialAssigneeReplacer) ReplaceSlice(logins []string) ([]string, error)
* type Template
* type UserEditor
* * func (e *UserEditor) Edit(filename, initialValue string) (string, error)
* type WorktreeTarget
* * func ResolveWorktreeTarget(client *git.Client, path string) (WorktreeTarget, error)
#### type RemoteNameToRepoFn ¶ added in v2.71.0
type RemoteNameToRepoFn func(remoteName string) (ghrepo.Interface, error)
#### type RepoMetadataFetcher ¶
type RepoMetadataFetcher interface {
RepoMetadataFetch(api.RepoMetadataInput) (*api.RepoMetadataResult, error)
}
#### type SpecialAssigneeReplacer ¶ added in v2.89.0
type SpecialAssigneeReplacer struct {
// contains filtered or unexported fields
}
SpecialAssigneeReplacer expands special assignee names (@me, Copilot actors) in login slices. Use NewSpecialAssigneeReplacer to create one.
#### func NewSpecialAssigneeReplacer ¶ added in v2.89.0
func NewSpecialAssigneeReplacer(client *api.Client, host string, actorAssignees bool, copilotUseLogin bool) *SpecialAssigneeReplacer
NewSpecialAssigneeReplacer creates a replacer that expands @me and (when actorAssignees is true) Copilot actor names in assignee slices. copilotUseLogin controls whether Copilot actors are replaced with their login (true) or display name (false, used for web mode).
#### func (*SpecialAssigneeReplacer) ReplaceSlice ¶ added in v2.89.0
func (r *SpecialAssigneeReplacer) ReplaceSlice(logins []string) ([]string, error)
#### type Template ¶
type Template interface {
Name() string
NameForSubmit() string
Body() []byte
Title() string
}
#### type UserEditor ¶ added in v2.53.0
type UserEditor struct {
IO *iostreams.IOStreams
Config func() (gh.Config, error)
}
#### func (*UserEditor) Edit ¶ added in v2.53.0
func (e *UserEditor) Edit(filename, initialValue string) (string, error)
#### type WorktreeTarget ¶ added in v2.99.0
type WorktreeTarget struct {
Path string
Reuse bool
}
WorktreeTarget describes whether a path is a new worktree location or the root of an existing linked worktree that can be reused.
#### func ResolveWorktreeTarget ¶ added in v2.99.0
func ResolveWorktreeTarget(client *git.Client, path string) (WorktreeTarget, error)
ResolveWorktreeTarget validates path and determines whether it is the root of an existing linked worktree for the current repository.
</excerpt>
</source>
<omitted_sources count="22">Additional source records were omitted from this bounded result.</omitted_sources>
</source_evidence>
Citations:
- 1: https://cli.github.com/manual/gh_pr_edit?utm_source=openai
- 2: https://fossies.org/linux/gh-cli/pkg/cmd/pr/shared/params.go?utm_source=openai
- 3: https://github.com/cli/cli/blob/trunk/pkg/cmd/pr/create/create.go?utm_source=openai
Normalize the unsuffixed Copilot login before routing.
A user-entered copilot-pull-request-reviewer reaches the direct REST path and is sent without [bot], while gh pr edit only recognizes @copilot. Excluding the login from the direct path is not sufficient unless the CLI fallback receives @copilot.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adding or removing ordinary PR reviewers currently invokes CLI discovery even when Orca already knows the repository, PR number and reviewer logins. Send those updates directly to the requested_reviewers REST endpoint with one mutation.
This avoids the CLI's PR discovery read while still performing one write. Team names, comma-separated input, bot identifiers and special aliases retain the existing CLI interpretation. Mixed selections also use the CLI. Input trimming, explicit repository/host/WSL/SSH routing, permits, mutation invalidation and error results are preserved. Failed writes are never retried through a second mutation path.
Validation: 47 tests pass across four files, including mutation routing and invalidation. Replaying the original production module fails both direct-request regressions while all 16 syntax/error controls pass. A loopback HTTP check with the installed CLI confirms POST and DELETE each send exactly one request with {"reviewers":["alice","bob"]}; no live PR was mutated as a benchmark.
pnpm check:changed --maxWorkers=2 --timeout=6passed all 20 non-test checks; broad related-test discovery timed out at six minutes without results. Claude independently passed 91 tests across seven suites with no actionable findings. No IPC or UI changes.