Commit graph

47 commits

Author SHA1 Message Date
Kynan Ware
eff9d48f6e Replace em-dashes with hyphens in code comments
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 17:33:29 -06:00
Kynan Ware
c00257386e feat: add Issues 2.0 API types, mutations, and feature detection
Add API infrastructure for issue types, sub-issues, and issue
relationships (blocked-by/blocking):

- New types: IssueType, LinkedIssue, SubIssues, SubIssuesSummary,
  LinkedIssueConnection
- New Issue struct fields for all Issues 2.0 data
- GraphQL query builder cases for new fields
- ExportData cases for JSON output
- Mutation functions: UpdateIssueIssueType, AddSubIssue,
  RemoveSubIssue, AddBlockedBy, RemoveBlockedBy
- Helper functions: RepoIssueTypes, IssueNodeID
- Feature detection: IssueRelationshipsSupported for GHES 3.19+
  (issue types and sub-issues are GA on GHES 3.17+, no detection needed)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-30 08:49:43 -06:00
Kynan Ware
92f205e54b docs(featuredetection): document GHES removal criteria for ApiActorsSupported
Expand the ApiActorsSupported doc comment to explain the two API
generations (legacy AssignableUser vs actor-based AssignableActor),
what each returns, and the specific GraphQL schema additions to
check for when evaluating GHES support.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 21:15:39 -06:00
Kynan Ware
ae5e857c2e refactor(featuredetection): rename ActorIsAssignable to ApiActorsSupported
Aligns the feature detector field name with the downstream
ApiActorsSupported flag introduced in the previous commit, so the
signal has one consistent name from detection through to consumption.

Also consolidates leftover TODO tags (actorIsAssignableCleanup,
requestReviewsByLoginCleanup) under the single // TODO ApiActorsSupported
tag so there's exactly one thing to grep for.

Pure rename with no logic changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 21:09:04 -06:00
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
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
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
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
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
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
Kynan Ware
73e5589059 doc(issue): comment why assignable actors disabled 2025-05-12 11:37:37 -06:00
Kynan Ware
8ebbd1d4bf feat(fd): add ActorIsAssignable to IssueFeatures 2025-05-07 12:23:18 -06:00
William Martin
5ec2160bc6 Avoid requesting projectCards for issue view 2025-04-17 15:37:48 +02:00
Tyler McGoffin
e1a39d8e2b Add ghe.com to tests describing ghec data residency 2024-10-15 12:24:41 -07:00
Tyler McGoffin
81591a09b8 Use go-gh/auth package for IsEnterprise, IsTenancy, and NormalizeHostname 2024-10-15 11:56:43 -07:00
Tyler McGoffin
3a8417f6c7 Add test coverage to places where IsEnterprise incorrectly covers Tenancy
IsEnterprise currently returns `true` when `IsTenancy` returns true. We
prefer that this behavior is orthogonal. This commit adds failing tests to
the instances where IsEnterprise should not behave the same as IsTenancy.

These test cases are expected to pass with the inclusion of the coming
improvements to go-gh to handle the orthogonality of IsEnterprise and
IsTenancy.
2024-10-15 11:56:43 -07:00
Viktor Szépe
6d9dd57774 Fix typos 2024-05-09 20:15:27 +00:00
Sam Coe
ad283cff72
Fix pr checks command for GHES versions older than 3.9 (#7725) 2023-07-19 09:25:07 -07:00
William Martin
505c954544 Remove unused emptyIntrospectionFor test helper 2023-05-23 17:13:48 +02:00
William Martin
b02d5efb18 Use two queries in one request for PR feature detection 2023-05-23 15:42:38 +02:00
William Martin
42b61ad53e Inject fake detector into PR status tests 2023-05-22 18:44:51 +02:00
William Martin
bfd3c7b20b Short circuit status check GQL introspection for GitHub.com 2023-05-17 18:45:25 +02:00
William Martin
c2e3dae602 Add support for detecting status and check counts in GQL 2023-05-17 18:45:25 +02:00
William Martin
7e2bac89bd
Remove old, unused detector fields (#7458) 2023-05-17 14:50:28 +02:00
Sam Coe
e14d14cef2
Add support for issue state reason (#6245) 2022-09-14 12:39:15 +04:00
Sam Coe
45f1a71c8b
Remove all direct calls to shurcool-graphql 2022-08-18 21:40:41 +03:00
Sam Coe
074ed50b8a
Integrate go-gh API package (#5614) 2022-06-23 04:05:31 +01:00
Mislav Marohnić
9351f272dc pr merge: fix merge queue API access for PAT consumers
The github.com API right now doesn't seem to make merge queue APIs
available to people who use PAT to authenticate gh requests. This
switches the conditional request strategy to also do feature-detection
for dotcom (instead of just for Enterprise).
2022-06-09 14:38:58 +02:00
Mislav Marohnić
4c6358dcbf Guard PR merge queue queries behind feature detection 2022-06-08 12:25:22 +02:00
Mislav Marohnić
80f130184c repo edit: fix interactive mode in GHES < 3.3 2022-06-07 17:54:52 +02:00
Sam Coe
33975a95e4
Allow repo list to work with GHES earlier than 3.3 2022-06-06 12:45:55 -05:00
Sam Coe
539b150833
Extract feature detection package (#5494) 2022-05-17 19:07:44 +00:00