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

Method SearchFeatures

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

Source from the content-addressed store, hash-verified

374)
375
376func (d *detector) SearchFeatures() (SearchFeatures, error) {
377 // TODO advancedIssueSearchCleanup
378 // Once GHES 3.17 support ends, we don't need this and, probably, the entire search feature detection.
379
380 // Regarding the release of advanced issue search (AIS, for short), there
381 // are three time spans/periods:
382 //
383 // 1. Pre-deprecation: where both legacy search and AIS are available
384 // - GraphQL: `ISSUE` and `ISSUE_ADVANCED` search types in GraphQL behave differently
385 // - REST: `advance_search=true` query parameter can be used to switch to AIS
386 // 2. Deprecation: only AIS available
387 // - GraphQL: `ISSUE` and `ISSUE_ADVANCED` search types in GraphQL behave the same (AIS)
388 // - REST: `advance_search` query parameter has no effect (AIS)
389 // 3. Cleanup: only AIS available
390 // - GraphQL: `ISSUE` search type in GraphQL is the only available option (AIS)
391 // - REST: `advance_search` query parameter has no effect (AIS)
392 //
393 // Since there's no schema-wise difference between pre-deprecation and
394 // deprecation periods (i.e. `ISSUE_ADVANCED` is available during both),
395 // we cannot figure out the exact time period. The consensus is to use
396 // the advanced search syntax during both periods.
397
398 var feature SearchFeatures
399
400 if ghauth.IsEnterprise(d.host) {
401 enterpriseAISSupportVersion, err := version.NewVersion(enterpriseAdvancedIssueSearchSupport)
402 if err != nil {
403 return SearchFeatures{}, err
404 }
405
406 hostVersion, err := resolveEnterpriseVersion(d.httpClient, d.host)
407 if err != nil {
408 return SearchFeatures{}, err
409 }
410
411 if hostVersion.GreaterThanOrEqual(enterpriseAISSupportVersion) {
412 // As of August 2025, advanced issue search is going to be available
413 // on GHES 3.18+, including Issues tabs in repositories.
414 feature.AdvancedIssueSearchAPI = true
415
416 // TODO advancedSearchFuture
417 // When the advanced search syntax is supported in global search or
418 // Pull Requests tabs (in repositories), we can add and enable the
419 // corresponding fields.
420 }
421 } else {
422 // As of August 2025, advanced issue search is available on github.com,
423 // including Issues tabs in repositories.
424 feature.AdvancedIssueSearchAPI = true
425
426 // TODO advancedSearchFuture
427 // When the advanced search syntax is supported in global search or
428 // Pull Requests tabs (in repositories), we can add and enable the
429 // corresponding fields.
430 }
431
432 if !feature.AdvancedIssueSearchAPI {
433 return feature, nil

Callers

nothing calls this directly

Calls 3

NewClientFromHTTPFunction · 0.92
resolveEnterpriseVersionFunction · 0.85
QueryMethod · 0.65

Tested by

no test coverage detected