MCPcopy Index your code
hub / github.com/git-bug/git-bug / cacheGithubLabels

Method cacheGithubLabels

bridge/github/export.go:481–506  ·  view source on GitHub ↗
(ctx context.Context, gc *rateLimitHandlerClient)

Source from the content-addressed store, hash-verified

479}
480
481func (ge *githubExporter) cacheGithubLabels(ctx context.Context, gc *rateLimitHandlerClient) error {
482 variables := map[string]interface{}{
483 "owner": githubv4.String(ge.conf[confKeyOwner]),
484 "name": githubv4.String(ge.conf[confKeyProject]),
485 "first": githubv4.Int(10),
486 "after": (*githubv4.String)(nil),
487 }
488
489 q := labelsQuery{}
490
491 hasNextPage := true
492 for hasNextPage {
493 if err := gc.queryExport(ctx, &q, variables, ge.out); err != nil {
494 return err
495 }
496
497 for _, label := range q.Repository.Labels.Nodes {
498 ge.cachedLabels[label.Name] = label.ID
499 }
500
501 hasNextPage = q.Repository.Labels.PageInfo.HasNextPage
502 variables["after"] = q.Repository.Labels.PageInfo.EndCursor
503 }
504
505 return nil
506}
507
508func (ge *githubExporter) getLabelID(label string) (string, error) {
509 label = strings.ToLower(label)

Callers 1

ExportAllMethod · 0.95

Calls 2

queryExportMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected