Commit graph

860 commits

Author SHA1 Message Date
Kynan Ware
4f2304d4e5 Remove StateReason feature detection for issue close
The stateReason field was added in GHES ~3.4, which is far older than
the earliest supported GHES version (3.14). The feature detection and
conditional inclusion of stateReason is therefore unnecessary.

This removes:
- StateReason field from IssueFeatures struct
- GHES introspection query in IssueFeatures() (only ActorIsAssignable
  remains, which is always false on GHES)
- Conditional stateReason field inclusion in issue list
- Feature detection guard in issue close
- Feature detection guard in FindIssueOrPR

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-04 13:31:30 -07:00
Kynan Ware
6b56a23970 Remove unnecessary StateReasonDuplicate feature detection
The DUPLICATE enum variant for IssueClosedStateReason was added in
GHES 3.16, which is older than the earliest supported GHES version.
The feature detection check is therefore unnecessary.

Addresses: https://github.com/cli/cli/pull/12811#issuecomment-3997044372

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-04 13:24:05 -07:00
Kynan Ware
38c997567a
Fix incorrect integer conversion from int to uint16 in port forwarder (#12831)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-04 13:01:52 +01:00
Takeshi
b9c8d8e023
Merge branch 'trunk' into issue-close-duplicate-of 2026-03-03 22:03:25 -05:00
Takeshi
2265820853 Combine issue feature detection into a single GraphQL query
Merge the Issue_fields and IssueClosedStateReason_enumValues
introspection queries into one call to avoid an extra API round-trip
on GHES.
2026-03-03 21:51:18 -05:00
Takeshi
01c83acfe8 Add --duplicate-of flag and duplicate reason to gh issue close
Support closing issues as duplicates via --reason duplicate and
--duplicate-of <issue> flags. The --duplicate-of flag accepts an issue
number or URL, validates it references a different issue (not a PR),
and passes the duplicate issue ID to the closeIssue mutation.

Feature detection checks whether the GHES instance supports the
DUPLICATE enum value in IssueClosedStateReason before using it.
2026-02-28 20:10:07 -05:00
Babak K. Shandiz
c9543e7489
fix(licenses): implement VCS-friendly embedding
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2026-02-25 14:59:52 +00:00
William Martin
7ea88b1c4d
Bundle licenses at release time (#12625)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-02-18 17:59:27 +01:00
William Martin
8dcfd330e7
Add --query flag to project item-list (#12696)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Babak K. Shandiz <babakks@github.com>
2026-02-18 16:34:13 +01:00
Babak K. Shandiz
52eca96873
refactor(featuredetection): remove temp in favour of early returns
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2026-02-17 11:46:33 +00:00
Babak K. Shandiz
61ab5e0b5d
docs(featuredetection): fix typo in comment
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2026-02-16 13:07:24 +00:00
Babak K. Shandiz
b64dd58d8b
test(featuredetection): fix test case name
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2026-02-16 13:06:23 +00:00
Babak K. Shandiz
33825477ae
test(featuredetection): add tests for ActionsFeatures
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2026-02-16 11:54:07 +00:00
Babak K. Shandiz
a0dea00fdd
fix(featuredetection): add ActionsFeatures to detect workflow dispatch features
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2026-02-16 11:53:33 +00:00
Kynan Ware
a33d809c88
Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-26 15:09:16 -07:00
Kynan Ware
af124cd5d2 Add test for MultiSelectWithSearch error propagation
Introduces a test case to verify that errors returned from the MultiSelectWithSearch search function are properly propagated to the caller.
2026-01-26 13:56:47 -07:00
Kynan Ware
38f9d7891b Fix linter and mock prompter signature 2026-01-26 13:29:22 -07:00
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
38578f7991 Add comment describing logger
Added a comment explaining how to enable logging in expect-based tests by using expect.WithLogger. This helps developers debug by printing characters read to stdout.
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
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
William Martin
d88b4cb8ec Fix accessible prompter tests with huh 0.8.0 upgrade 2025-12-02 14:36:43 +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
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
26552f3489
fix(featuredetection): add ReleaseFeatures method
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-10-31 19:52:09 +00:00
Babak K. Shandiz
139c2c4f9a
refactor: replace backport with strings.CutSuffix
The `cutSuffix` function was added to backport the functionality of
`strings.CutSuffix` from Go 1.20. Now that we're using Go 1.25, we can
safely replace our backport with the standard library function. Our
backport was an intact copy/paste of the stdlib implementation, so this
change does not alter any behavior.

Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-10-31 12:21:02 +00:00
Babak K. Shandiz
ae9a7ed542
refactor(authflow): receive HTTP client via args
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-10-13 16:48:10 +01:00
Babak K. Shandiz
37896d613a
fix(featuredetection): remove redundant AdvancedIssueSearchWebInIssuesTab field
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-08 18:46:28 +01:00
Babak K. Shandiz
43bedab2dc
docs(featuredetection): remove unknown dates
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-08 18:39:55 +01:00
Babak K. Shandiz
d56a902a07
docs(featuredetection): add godoc for min GHES version for advanced issue search
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-02 12:09:38 +01:00
Babak K. Shandiz
87bd76c5aa
docs: add cleanup/future TODO marks for advanced issue search changes
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-01 13:55:49 +01:00
Babak K. Shandiz
0104d8c0db
refactor: improve mock feature detector names
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-08-31 13:57:47 +01:00
Babak K. Shandiz
e9b3ac364a
test(featuredetection): add tests for advanced issue search detection
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-08-30 15:51:57 +01:00
Babak K. Shandiz
f16c267bad
fix(featuredetection): add feature detection for advanced issue search
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-08-30 15:51:16 +01:00
Andrey
4e1318eb2a
feat: gh auth Automatically copy one-time OAuth code to clipboard (#11518)
* feat: add ability to copy one-time OAuth code while authenticating

Signed-off-by: Andrey <andrekabatareika@gmail.com>

* fix(docs): wrong example for gh auth refresh

* chore(authflow): update message to include one-time code to it

Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>

* chore(authflow): improve message when copied one-time code

Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>

* chore(authflow): don't early return error when could not copy OAuth code

Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>

* refactor(authflow): make code for working with OAuth code more readable

* Adjust language in `gh auth` help for clipboard

---------

Signed-off-by: Andrey <andrekabatareika@gmail.com>
Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
2025-08-25 09:52:51 -06:00
Andy Feller
d10251211c
Update feature_detection.go 2025-08-12 21:18:47 -04:00
Andy Feller
3bafd883b5 Update v1 project detection logic
This change updates the v1 project detection logic to retrieve the API version of GHES host to determine support.
2025-08-11 14:50:07 -04:00
Andy Feller
65c7ebc79e v1 project feature detection spike using version
These changes are demonstrating how `gh` commands that support v1 classic projects can determine if support exists by checking the GHES server version.
2025-07-28 17:16:56 -04:00
Martin Kealey
e2b7ef4e26
Typo in generated ~/.config/gh/config.yml 2025-07-08 11:21:31 +10:00
William Martin
ad089d48d9 Update microsoft dev-tunnels to v0.1.13
https://github.com/microsoft/dev-tunnels/pull/322 introduced a few
breaking changes:
 * Port Tags were renamed to Labels
 * Client construction must now provide an API version (of which there is only one)
 * The /api/v1 prefix was dropped from request paths
 * TunnelPortListResponses may now be paginated (but we don't support that)
 * Requests to create a port with a changed protocol began erroring
2025-07-02 16:38:07 +02:00
Andy Feller
0180c7fce4 Restored original test setup, clarified
After discussing my previous change to the test, I'm restoring the previous keyring setup to reflect the specific situation.

I added clarifying comments to help the next reviewer.
2025-06-20 15:38:09 -04:00
Andy Feller
b7c2b19e70 Enhance Activetoken prioritize test
- ensure test user tokens are different from unkeyed token
- ensure assertion expected / actual are in correct order
2025-06-20 14:36:45 -04:00
Anuraag Agrawal
848cedd2c8 Push up 2025-06-18 09:56:44 +09:00
Anuraag Agrawal
cc9a2411e0 Cleanup 2025-05-29 12:28:26 +09:00
Anuraag Agrawal
f294a5f533 fix: get token for active user instead of blank if possible 2025-05-29 12:13:21 +09:00
Kynan Ware
dd4095d016 doc(update): improve comments on updaterEnabled 2025-05-27 13:05:47 -06:00
Kynan Ware
22504bfa96 feat(update): add updateable build tag for update notifications 2025-05-26 09:45:00 -06:00
Kynan Ware
944543863a
Revert "[gh config] Escape pipe symbol in Long desc for website manual" 2025-05-20 08:54:30 -06:00