(ctx context.Context, gc *rateLimitHandlerClient, repositoryID string, labels []common.Label)
| 618 | } |
| 619 | |
| 620 | func (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 |
| 645 | func (ge *githubExporter) createGithubIssue(ctx context.Context, gc *rateLimitHandlerClient, repositoryID, title, body string) (string, string, error) { |
no test coverage detected