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

Method getLabelsIDs

bridge/github/export.go:620–642  ·  view source on GitHub ↗
(ctx context.Context, gc *rateLimitHandlerClient, repositoryID string, labels []common.Label)

Source from the content-addressed store, hash-verified

618}
619
620func (ge *githubExporter) getLabelsIDs(ctx context.Context, gc *rateLimitHandlerClient, repositoryID string, labels []common.Label) ([]githubv4.ID, error) {
621 ids := make([]githubv4.ID, 0, len(labels))
622 var err error
623
624 // check labels ids
625 for _, label := range labels {
626 id, ok := ge.cachedLabels[string(label)]
627 if !ok {
628 // try to query label id
629 id, err = ge.getOrCreateGithubLabelID(ctx, gc, repositoryID, label)
630 if err != nil {
631 return nil, errors.Wrap(err, "get or create github label")
632 }
633
634 // cache label id
635 ge.cachedLabels[string(label)] = id
636 }
637
638 ids = append(ids, githubv4.ID(id))
639 }
640
641 return ids, nil
642}
643
644// create a github issue and return it ID
645func (ge *githubExporter) createGithubIssue(ctx context.Context, gc *rateLimitHandlerClient, repositoryID, title, body string) (string, string, error) {

Callers 1

Calls 2

IDMethod · 0.65

Tested by

no test coverage detected