()
| 397 | ) |
| 398 | |
| 399 | func (d *detector) SearchFeatures() (SearchFeatures, error) { |
| 400 | // TODO advancedIssueSearchCleanup |
| 401 | // Once GHES 3.17 support ends, we don't need this and, probably, the entire search feature detection. |
| 402 | |
| 403 | // Regarding the release of advanced issue search (AIS, for short), there |
| 404 | // are three time spans/periods: |
| 405 | // |
| 406 | // 1. Pre-deprecation: where both legacy search and AIS are available |
| 407 | // - GraphQL: `ISSUE` and `ISSUE_ADVANCED` search types in GraphQL behave differently |
| 408 | // - REST: `advance_search=true` query parameter can be used to switch to AIS |
| 409 | // 2. Deprecation: only AIS available |
| 410 | // - GraphQL: `ISSUE` and `ISSUE_ADVANCED` search types in GraphQL behave the same (AIS) |
| 411 | // - REST: `advance_search` query parameter has no effect (AIS) |
| 412 | // 3. Cleanup: only AIS available |
| 413 | // - GraphQL: `ISSUE` search type in GraphQL is the only available option (AIS) |
| 414 | // - REST: `advance_search` query parameter has no effect (AIS) |
| 415 | // |
| 416 | // Since there's no schema-wise difference between pre-deprecation and |
| 417 | // deprecation periods (i.e. `ISSUE_ADVANCED` is available during both), |
| 418 | // we cannot figure out the exact time period. The consensus is to use |
| 419 | // the advanced search syntax during both periods. |
| 420 | |
| 421 | var feature SearchFeatures |
| 422 | |
| 423 | if ghauth.IsEnterprise(d.host) { |
| 424 | enterpriseAISSupportVersion, err := version.NewVersion(enterpriseAdvancedIssueSearchSupport) |
| 425 | if err != nil { |
| 426 | return SearchFeatures{}, err |
| 427 | } |
| 428 | |
| 429 | hostVersion, err := resolveEnterpriseVersion(d.httpClient, d.host) |
| 430 | if err != nil { |
| 431 | return SearchFeatures{}, err |
| 432 | } |
| 433 | |
| 434 | if hostVersion.GreaterThanOrEqual(enterpriseAISSupportVersion) { |
| 435 | // As of August 2025, advanced issue search is going to be available |
| 436 | // on GHES 3.18+, including Issues tabs in repositories. |
| 437 | feature.AdvancedIssueSearchAPI = true |
| 438 | |
| 439 | // TODO advancedSearchFuture |
| 440 | // When the advanced search syntax is supported in global search or |
| 441 | // Pull Requests tabs (in repositories), we can add and enable the |
| 442 | // corresponding fields. |
| 443 | } |
| 444 | } else { |
| 445 | // As of August 2025, advanced issue search is available on github.com, |
| 446 | // including Issues tabs in repositories. |
| 447 | feature.AdvancedIssueSearchAPI = true |
| 448 | |
| 449 | // TODO advancedSearchFuture |
| 450 | // When the advanced search syntax is supported in global search or |
| 451 | // Pull Requests tabs (in repositories), we can add and enable the |
| 452 | // corresponding fields. |
| 453 | } |
| 454 | |
| 455 | if !feature.AdvancedIssueSearchAPI { |
| 456 | return feature, nil |
nothing calls this directly
no test coverage detected