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

Method ProjectFeatures

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

Source from the content-addressed store, hash-verified

387}
388
389func (d *detector) ProjectFeatures() (ProjectFeatures, error) {
390 if !ghauth.IsEnterprise(d.host) {
391 return allProjectFeatures, nil
392 }
393
394 var features ProjectFeatures
395
396 var featureDetection struct {
397 ProjectV2 struct {
398 Fields []struct {
399 Name string
400 Args []struct {
401 Name string
402 }
403 } `graphql:"fields(includeDeprecated: true)"`
404 } `graphql:"ProjectV2: __type(name: \"ProjectV2\")"`
405 }
406
407 gql := api.NewClientFromHTTP(d.client())
408 err := gql.Query(d.host, "ProjectV2_fields", &featureDetection, nil)
409 if err != nil {
410 return features, err
411 }
412
413 for _, field := range featureDetection.ProjectV2.Fields {
414 if field.Name == "items" {
415 for _, arg := range field.Args {
416 if arg.Name == "query" {
417 features.ProjectItemQuery = true
418 break
419 }
420 }
421 break
422 }
423 }
424
425 return features, nil
426}
427
428const (
429 // enterpriseAdvancedIssueSearchSupport is the minimum version of GHES that

Callers 1

TestProjectFeaturesFunction · 0.95

Calls 3

clientMethod · 0.95
NewClientFromHTTPFunction · 0.92
QueryMethod · 0.65

Tested by 1

TestProjectFeaturesFunction · 0.76