MCPcopy Index your code
hub / github.com/cli/cli / ProjectFeatures

Method ProjectFeatures

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

Source from the content-addressed store, hash-verified

324}
325
326func (d *detector) ProjectFeatures() (ProjectFeatures, error) {
327 if !ghauth.IsEnterprise(d.host) {
328 return allProjectFeatures, nil
329 }
330
331 var features ProjectFeatures
332
333 var featureDetection struct {
334 ProjectV2 struct {
335 Fields []struct {
336 Name string
337 Args []struct {
338 Name string
339 }
340 } `graphql:"fields(includeDeprecated: true)"`
341 } `graphql:"ProjectV2: __type(name: \"ProjectV2\")"`
342 }
343
344 gql := api.NewClientFromHTTP(d.httpClient)
345 err := gql.Query(d.host, "ProjectV2_fields", &featureDetection, nil)
346 if err != nil {
347 return features, err
348 }
349
350 for _, field := range featureDetection.ProjectV2.Fields {
351 if field.Name == "items" {
352 for _, arg := range field.Args {
353 if arg.Name == "query" {
354 features.ProjectItemQuery = true
355 break
356 }
357 }
358 break
359 }
360 }
361
362 return features, nil
363}
364
365const (
366 // 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