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

Method ProjectFeatures

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

Source from the content-addressed store, hash-verified

348}
349
350func (d *detector) ProjectFeatures() (ProjectFeatures, error) {
351 if !ghauth.IsEnterprise(d.host) {
352 return allProjectFeatures, nil
353 }
354
355 var features ProjectFeatures
356
357 var featureDetection struct {
358 ProjectV2 struct {
359 Fields []struct {
360 Name string
361 Args []struct {
362 Name string
363 }
364 } `graphql:"fields(includeDeprecated: true)"`
365 } `graphql:"ProjectV2: __type(name: \"ProjectV2\")"`
366 }
367
368 gql := api.NewClientFromHTTP(d.httpClient)
369 err := gql.Query(d.host, "ProjectV2_fields", &featureDetection, nil)
370 if err != nil {
371 return features, err
372 }
373
374 for _, field := range featureDetection.ProjectV2.Fields {
375 if field.Name == "items" {
376 for _, arg := range field.Args {
377 if arg.Name == "query" {
378 features.ProjectItemQuery = true
379 break
380 }
381 }
382 break
383 }
384 }
385
386 return features, nil
387}
388
389const (
390 // 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