Commit graph

5462 commits

Author SHA1 Message Date
Kynan Ware
07dfdf97ae Update edit tests
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.
2026-01-26 13:29:22 -07:00
Kynan Ware
d46f42a752 Refactor MultiSelectWithSearch to use result struct
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.
2026-01-26 13:29:22 -07:00
Kynan Ware
7e7f8c6f6e Pass editable to assigneeSearchFunc and update metadata
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.
2026-01-26 13:29:22 -07:00
Kynan Ware
d04317c273 Add dynamic assignee search to PR edit flow
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.
2026-01-26 13:29:22 -07:00
Kynan Ware
0beb74bf72 MultiSelectWithSearch initial implementation
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
2026-01-26 13:29:22 -07:00
Kynan Ware
be1e21095c prshared: named prompt interface parameters
Updated the Prompt interface in survey.go to include parameter names for all methods, improving code readability and clarity.
2026-01-26 13:29:22 -07:00
Babak K. Shandiz
0d8a697c7c
fix(pr/shared): improve ParseFullReference error message
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2026-01-21 23:30:43 +00:00
Mikel Olasagasti Uranga
bd0177b039 Fix fmt.Errorf format argument in ParseFullReference
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>
2026-01-21 23:14:59 +01:00
Kynan Ware
49f72234ac
Merge pull request #12376 from majiayu000/fix-11903-pr-create-same-ref
fix: error when head and base refs are identical in pr create
2026-01-21 10:21:14 -07:00
majiayu000
0f4b9b0d91
refactor: address review comments
Signed-off-by: majiayu000 <1835304752@qq.com>
2026-01-21 18:28:21 +08:00
Kynan Ware
3e8855f755
Merge pull request #12101 from davidspek/feat/delete-all-cache-ref
feat(cache delete): allow for delete all caches for a ref
2026-01-20 12:16:47 -07:00
Kynan Ware
c4fd102016
Merge branch 'trunk' into fix-11903-pr-create-same-ref 2026-01-20 10:33:17 -07:00
Babak K. Shandiz
da5e5ac6d4
test(copilot): fix windows asset URL
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2026-01-20 10:33:19 +00:00
David van der Spek
9cdc0c4fe5 fix(cache delete): add unit tests and expand help doc
Signed-off-by: David van der Spek <david.vanderspek@flyrlabs.com>
2026-01-20 08:30:34 +01:00
David van der Spek
6a798e76e1 feat(cache delete): allow for delete all caches for a ref
Signed-off-by: David van der Spek <david.vanderspek@flyrlabs.com>
2026-01-20 08:30:34 +01:00
Kynan Ware
d187bef56f Fix OS name in test archive filename to 'win32'
Replaces runtime.GOOS with 'win32' in the test archive filename within TestDownloadCopilot. This ensures the test uses the expected archive name for Windows.
2026-01-19 11:18:35 -07:00
Babak K. Shandiz
bc5a44a4ae
fix(copilot): replace windows with win32 to match asset names
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2026-01-19 17:57:05 +00:00
Babak K. Shandiz
10b4a1f427
fix(root): avoid command name collision when registering extensions
Signed-off-by: Babak K. Shandiz <babakks@github.com>

Co-authored-by: Kynan Ware <bagtoad@github.com>
Co-authored-by: Devraj Mehta <devm33@github.com>
2026-01-19 10:38:39 +00:00
Babak K. Shandiz
08a4413614
chore(root): register copilot command
Signed-off-by: Babak K. Shandiz <babakks@github.com>

Co-authored-by: Kynan Ware <bagtoad@github.com>
Co-authored-by: Devraj Mehta <devm33@github.com>
2026-01-19 10:38:35 +00:00
Babak K. Shandiz
39880650d5
feat: add copilot command
Signed-off-by: Babak K. Shandiz <babakks@github.com>

Co-authored-by: Kynan Ware <bagtoad@github.com>
Co-authored-by: Devraj Mehta <devm33@github.com>
2026-01-19 10:38:29 +00:00
Babak K. Shandiz
0f32f2ac46
refactor(run download): extract zip extraction func into a separate package
Signed-off-by: Babak K. Shandiz <babakks@github.com>

Co-authored-by: Kynan Ware <bagtoad@github.com>
Co-authored-by: Devraj Mehta <devm33@github.com>
2026-01-19 10:38:21 +00:00
lif
1d506f5331
fix: simplify set-default remote parsing 2026-01-14 18:35:04 +08:00
lif
8de78e6410
Merge branch 'trunk' into fix-9149-set-default-remote-name 2026-01-10 11:08:42 +08:00
majiayu000
5f305e81c2
Handle repo argument before remote name 2026-01-10 00:54:51 +08:00
fchimpan
5761a1e669
Update actions/checkout to v6 in extension workflow templates 2025-12-30 23:39:34 +09:00
majiayu000
73c7fd59ef feat: allow git remote names in gh repo set-default
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>
2025-12-26 19:21:11 +08:00
majiayu000
9daa22ebac fix: error when head and base refs are identical in pr create
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>
2025-12-26 19:14:06 +08:00
Robin Neatherway
a1fbfba9e1 Add tests of browse --actions 2025-12-11 11:31:12 +00:00
Robin Neatherway
786d276bfb Add gh browse --actions flag 2025-12-11 10:33:01 +00:00
ferhat elmas
70470f9cef refactor: drop multierror in favor of std
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>
2025-12-02 15:08:58 +01:00
Babak K. Shandiz
56cdc36013
refactor(pkg/search): rename KeywordsVerbatim to ImmutableKeywords
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-11-20 16:53:16 +00:00
Babak K. Shandiz
1533d8177c
refactor(pkg/search): rewrite returns in a more verbose way
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-11-20 16:26:27 +00:00
Babak K. Shandiz
1cd4840199
fix(pr/shared): delegate query compilation to search package
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-11-20 13:35:24 +00:00
Babak K. Shandiz
76b2de8a18
test(pkg/search): assert verbatim keywords are respected
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-11-20 13:08:27 +00:00
Babak K. Shandiz
d8486ccf10
fix(pkg/search): add KeywordsVerbatim field to Query type
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-11-20 13:07:27 +00:00
Andy Feller
e85877dd75 Remove extra flag default from help usage
Fixes #12153
2025-11-17 10:09:17 -05:00
William Martin
8a4154cfe7 Refactor cfg out of CAPI Client 2025-11-14 20:21:54 +01:00
Kynan Ware
152d328db8
Merge pull request #12084 from cli/babakks/add-basic-linters
chore: add basic linters
2025-11-04 10:46:40 -07:00
Babak K. Shandiz
895c314c5c
Merge pull request #12064 from cli/babakks/add-isimmutable-to-release-list
Add `isImmutable` to `release list` JSON output
2025-11-04 12:43:36 +00:00
Babak K. Shandiz
917e365c5c
docs(pkg/search): fix typo
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-11-03 20:05:28 +00:00
Babak K. Shandiz
0e53651bb2
docs(repo garden): improve func godoc
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-11-03 20:05:27 +00:00
Babak K. Shandiz
d3b333e5be
fix: ignore nilerr on intentionally swallowed error
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-11-03 20:05:27 +00:00
Babak K. Shandiz
d002d30327
fix: resolve nilerr issues
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-11-03 20:05:26 +00:00
Babak K. Shandiz
f498f2e882
fix: resolve copyloopvar issues
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-11-03 20:05:26 +00:00
Babak K. Shandiz
3ad3fcdce9
fix: resolve gocritic issue
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-11-03 20:05:26 +00:00
Babak K. Shandiz
0eb5640edb
test(pkg/httpmock): ignore bodyclose on mock response value
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-11-03 20:05:25 +00:00
Babak K. Shandiz
2709c39179
refactor(repo garden): return pagination link instead of resp
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-11-03 20:05:25 +00:00
Babak K. Shandiz
9f65e89760
fix: close resp body (bodyclose)
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-11-03 20:05:25 +00:00
Babak K. Shandiz
d129b94fc5
refactor: remove returned resp from api.EndpointNeedsScopes
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>
2025-11-03 20:05:24 +00:00
Babak K. Shandiz
dde7fce602
refactor(pkg/search): remove passing resp for pagination
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-11-03 20:05:24 +00:00