Updated test mocks and logic to consistently use lowercase 'monalisa' for login names and display names for user assignees. Improved handling of dynamic assignee fetching in interactive flows by relying on searchFunc and metadata population, and clarified logic in FetchOptions to fetch assignees only when necessary. These changes ensure more accurate simulation of interactive assignment and better test coverage for actor assignee features.
Refactored the MultiSelectWithSearch function and related interfaces to use a MultiSelectSearchResult struct instead of multiple return values. This change improves clarity and extensibility of the search function signature, and updates all usages, mocks, and tests accordingly.
The assigneeSearchFunc now receives the editable struct to update its Metadata.AssignableActors field with suggested assignable actors. This change ensures that the editable struct has the necessary actor metadata for later PR updates.
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.
Initial implementation of MultiSelectWithSearch:
- Implement by survey and accessible prompters. They use the same internal func under the hood.
- Implement in `gh preview prompter` for initial testing and demonstration
- Implement interface changes across the codebase and mocks to satisfy compiler.
- Implement tests for new MultiSelectWithSearch prompter
The error path passed an int to fmt.Errorf with %q, which expects a
string. Use the original reference string to avoid a format mismatch.
Signed-off-by: Mikel Olasagasti Uranga <mikel@olasagasti.info>
Replaces runtime.GOOS with 'win32' in the test archive filename within TestDownloadCopilot. This ensures the test uses the expected archive name for Windows.
When specifying a repository for `gh repo set-default`, users can now
use a git remote name (e.g., "origin", "upstream") instead of the
full OWNER/REPO format.
The command first checks if the argument is a git remote name. If
found, it uses the corresponding repository. Otherwise, it falls
back to parsing the argument as OWNER/REPO format.
Example:
gh repo set-default origin
Fixes#9149
Signed-off-by: majiayu000 <1835304752@qq.com>
When a user runs `gh pr create` with head and base refs pointing to
the same ref in the same repository, the command now exits with an
error instead of proceeding with an invalid PR creation.
This prevents accidental pushes to the main branch and provides clear
feedback when users attempt to create a PR from the base branch.
Cross-repository PRs (e.g., from forks) with the same branch name
continue to work as expected.
Fixes#11903
Signed-off-by: majiayu000 <1835304752@qq.com>
Drop github.com/hashicorp/go-multierror
in favor of https://pkg.go.dev/errors#Join (go1.20).
Related to #11468
Signed-off-by: ferhat elmas <elmas.ferhat@gmail.com>
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>