MCPcopy Create free account
hub / github.com/cli/cli / SearchFeatures

Method SearchFeatures

internal/featuredetection/feature_detection.go:438–529  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

436)
437
438func (d *detector) SearchFeatures() (SearchFeatures, error) {
439 // TODO advancedIssueSearchCleanup
440 // Once GHES 3.17 support ends, we don't need this and, probably, the entire search feature detection.
441
442 // Regarding the release of advanced issue search (AIS, for short), there
443 // are three time spans/periods:
444 //
445 // 1. Pre-deprecation: where both legacy search and AIS are available
446 // - GraphQL: `ISSUE` and `ISSUE_ADVANCED` search types in GraphQL behave differently
447 // - REST: `advance_search=true` query parameter can be used to switch to AIS
448 // 2. Deprecation: only AIS available
449 // - GraphQL: `ISSUE` and `ISSUE_ADVANCED` search types in GraphQL behave the same (AIS)
450 // - REST: `advance_search` query parameter has no effect (AIS)
451 // 3. Cleanup: only AIS available
452 // - GraphQL: `ISSUE` search type in GraphQL is the only available option (AIS)
453 // - REST: `advance_search` query parameter has no effect (AIS)
454 //
455 // Since there's no schema-wise difference between pre-deprecation and
456 // deprecation periods (i.e. `ISSUE_ADVANCED` is available during both),
457 // we cannot figure out the exact time period. The consensus is to use
458 // the advanced search syntax during both periods.
459
460 var feature SearchFeatures
461
462 if ghauth.IsEnterprise(d.host) {
463 enterpriseAISSupportVersion, err := version.NewVersion(enterpriseAdvancedIssueSearchSupport)
464 if err != nil {
465 return SearchFeatures{}, err
466 }
467
468 hostVersion, err := resolveEnterpriseVersion(d.client(), d.host)
469 if err != nil {
470 return SearchFeatures{}, err
471 }
472
473 if hostVersion.GreaterThanOrEqual(enterpriseAISSupportVersion) {
474 // As of August 2025, advanced issue search is going to be available
475 // on GHES 3.18+, including Issues tabs in repositories.
476 feature.AdvancedIssueSearchAPI = true
477
478 // TODO advancedSearchFuture
479 // When the advanced search syntax is supported in global search or
480 // Pull Requests tabs (in repositories), we can add and enable the
481 // corresponding fields.
482 }
483 } else {
484 // As of August 2025, advanced issue search is available on github.com,
485 // including Issues tabs in repositories.
486 feature.AdvancedIssueSearchAPI = true
487
488 // TODO advancedSearchFuture
489 // When the advanced search syntax is supported in global search or
490 // Pull Requests tabs (in repositories), we can add and enable the
491 // corresponding fields.
492 }
493
494 if !feature.AdvancedIssueSearchAPI {
495 return feature, nil

Callers

nothing calls this directly

Calls 4

clientMethod · 0.95
NewClientFromHTTPFunction · 0.92
resolveEnterpriseVersionFunction · 0.85
QueryMethod · 0.65

Tested by

no test coverage detected