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

Method ProjectFeatures

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

Source from the content-addressed store, hash-verified

356}
357
358func (d *detector) ProjectFeatures() (ProjectFeatures, error) {
359 if !ghauth.IsEnterprise(d.host) {
360 return allProjectFeatures, nil
361 }
362
363 var features ProjectFeatures
364
365 var featureDetection struct {
366 ProjectV2 struct {
367 Fields []struct {
368 Name string
369 Args []struct {
370 Name string
371 }
372 } `graphql:"fields(includeDeprecated: true)"`
373 } `graphql:"ProjectV2: __type(name: \"ProjectV2\")"`
374 }
375
376 gql := api.NewClientFromHTTP(d.httpClient)
377 err := gql.Query(d.host, "ProjectV2_fields", &featureDetection, nil)
378 if err != nil {
379 return features, err
380 }
381
382 for _, field := range featureDetection.ProjectV2.Fields {
383 if field.Name == "items" {
384 for _, arg := range field.Args {
385 if arg.Name == "query" {
386 features.ProjectItemQuery = true
387 break
388 }
389 }
390 break
391 }
392 }
393
394 return features, nil
395}
396
397const (
398 // enterpriseAdvancedIssueSearchSupport is the minimum version of GHES that

Callers 1

TestProjectFeaturesFunction · 0.95

Calls 2

NewClientFromHTTPFunction · 0.92
QueryMethod · 0.65

Tested by 1

TestProjectFeaturesFunction · 0.76