Reword the comment for CopilotAssigneeLogin to indicate it refers to Copilot when retrieved as an assignee. This updates wording from the previous 'Actor/assignable actors' phrasing for clarity; no code behavior changed.
Each source (suggestions, collaborators, teams) has base quota of 5.
Unfilled slots cascade to later sources, allowing up to 15 total.
Adds unit tests with HTTP mocks.
Always send explicit lists for userLogins, botLogins, and teamSlugs
in RequestReviewsByLogin mutation, even when empty. Previously, empty
slices were omitted due to omitempty JSON behavior and len > 0 checks,
which prevented clearing all reviewers when using replace mode.
Empty slices are harmless no-ops in union mode, so we now send them
unconditionally for simpler logic.
Add test to verify the mutation receives empty slices when all
reviewers are removed.
Enables Copilot to be requested as a pull request reviewer, supporting both interactive and non-interactive flows. Introduces new reviewer search functionality, updates reviewer partitioning to distinguish users, bots, and teams, and adds a GraphQL mutation for reviewer management on github.com. Updates help text, tests, and internal APIs to support Copilot reviewer login and display names, while maintaining compatibility with GitHub Enterprise Server.
Updated SuggestedAssignableActors to return the total count of available assignees in the repository. Modified assigneeSearchFunc to use this count to calculate and display the number of additional assignees beyond the current results.
Simplifies SuggestedAssignableActors by no longer including the viewer in the returned actors list when the query is blank. Removes related logic and variables for viewer handling.
Introduces SuggestedAssignableActors API query and wires up a dynamic assignee search function in the PR edit command. Updates Editable and EditPrompter interfaces to support search-based multi-select for assignees, improving the user experience when assigning users to pull requests.
The GraphQL API can return `null` nodes in the `projectItems`
connection, causing a runtime panic (nil pointer dereference) when the
CLI attempted to access fields on these nil nodes. This crash occurs
even with personal access tokens with full read access.
Adds a check to safely skip `nil` nodes in `ProjectsV2ItemsForIssue` and
`ProjectsV2ItemsForPullRequest`.
Signed-off-by: Chris Henzie <chrishenzie@google.com>
Updated AddPullRequestReviews and RemovePullRequestReviews to send empty arrays instead of null values for reviewers and team_reviewers when no users or teams are specified, as required by the API.
The returned response from `api.EndpointNeedsScopes` causes `bodyclose`
linter to raise a false positive error, assuming it's a new response that
its body needs to be closed.
Signed-off-by: Babak K. Shandiz <babakks@github.com>
The assertions should check for header values instead of single string,
because when getting a single header value, we get an empty string if
the header is not set or is set to an empty string. So, to make sure a
header is not set we should check the `Values` slice which is `nil` only
if the header is missing.
Signed-off-by: Babak K. Shandiz <babakks@github.com>
Eliminates unnecessary initialization of users and teams to empty slices in RemovePullRequestReviews. Also updates the request body struct to use 'omitempty' for reviewers and team_reviewers, ensuring empty fields are omitted from the JSON payload.
Extracted logic for splitting reviewer identifiers into users and teams into a new helper function, partitionUsersAndTeams. Updated updatePullRequestReviews to use this function for both adding and removing reviewers, improving code clarity and maintainability. Also clarified comments regarding PR author handling.
Updated AddPullRequestReviews and RemovePullRequestReviews to use url.PathEscape for repo owner and name in API paths. This ensures correct handling of special characters in repository identifiers.
Switches pull request reviewer add/remove operations from GraphQL to the REST API, enabling separate add and remove calls for reviewers and teams. Refactors reviewer editing logic to avoid fetching organization teams unless required for interactive editing, improving performance for non-interactive flows. Updates tests and supporting code to reflect the new reviewer management and metadata fetching behavior.
Introduces a new 'list' subcommand under agent-task for listing agent tasks. Implements a Copilot API client for fetching agent sessions and hydrating them with pull request data. Updates PullRequest and PRRepository types to support new fields. Adds dependencies for msgpack and tagparser.
Co-Authored-By: Babak K. Shandiz <babakks@github.com>
These changes enhance the existing `gh issue view` experience by listing v2 projects in interactive and non-interactive forms.
Additionally, the tests have been enhanced to use a more standard `httpStubs` approach from other tests.
Renamed the test to clarify its purpose and added an explicit exclusion for the OrganizationTeamList GraphQL query to ensure teams are only fetched when specified. This improves test accuracy and readability.
Introduces a TeamReviewers boolean to RepoMetadataInput to control whether team reviewers are fetched. Updates RepoMetadata logic to only fetch teams if both Reviewers and TeamReviewers are true. Adds tests to verify correct behavior when TeamReviewers is false.
Based on PR feedback from @bagtoad, this commit creates a new constant for the Copilot bot name, which is used in the assignee / reviewer selection as well as replacing `@copilot` when going to GitHub.com UI
This commit refactors how `gh issue create` and `gh pr create` retrieve information needed to resolve metadata to be more in line with the approach used in `gh issue edit` and `gh pr edit`.
Previously, both commands used `prshared.fillMetadata(...)` function to retrieve assignees, reviewers, labels, and teams outside of `api.RepoMetadata(..)`. Now, these commands will consistently use the same logic and data for resolving metadata.