(report OutcomeReport, repo string, mapping *github.ObjectiveMapping)
| 418 | } |
| 419 | |
| 420 | func resolveOutcomeIntent(report OutcomeReport, repo string, mapping *github.ObjectiveMapping) (intent.IntentRecord, error) { |
| 421 | resolver := intent.Resolver{ |
| 422 | ResolverVersion: "outcome-eval-v1", |
| 423 | MatchLabels: func(labels []string) []string { |
| 424 | return mapping.GetObjectiveLabels(labels) |
| 425 | }, |
| 426 | } |
| 427 | |
| 428 | if isPullRequestOutcomeType(report.Type) { |
| 429 | prIntent, err := resolvePullRequestIntent(report, repo, resolver) |
| 430 | if err == nil { |
| 431 | return prIntent, nil |
| 432 | } |
| 433 | if err != nil { |
| 434 | outcomeEvalLog.Printf("Falling back to direct labels after PR root trace failure: %v", err) |
| 435 | } |
| 436 | } |
| 437 | |
| 438 | labels, err := objectiveMappingGHAPIGetArray(fmt.Sprintf("issues/%d/labels", report.ObjectNumber), repo) |
| 439 | if err != nil { |
| 440 | return intent.IntentRecord{}, err |
| 441 | } |
| 442 | return resolver.ResolveIssue("", report.ObjectURL, labelsToStringsFromMaps(labels)), nil |
| 443 | } |
| 444 | |
| 445 | func isPullRequestOutcomeType(outcomeType string) bool { |
| 446 | switch outcomeType { |
no test coverage detected