MCPcopy Create free account
hub / github.com/temporalio/temporal / BuildFailureReport

Function BuildFailureReport

tools/ci-notify/github.go:55–93  ·  view source on GitHub ↗

BuildFailureReport aggregates all failure information

(runID string)

Source from the content-addressed store, hash-verified

53
54// BuildFailureReport aggregates all failure information
55func BuildFailureReport(runID string) (*FailureReport, error) {
56 run, err := GetWorkflowRun(runID)
57 if err != nil {
58 return nil, err
59 }
60
61 author, err := GetCommitAuthor(run.HeadSHA)
62 if err != nil {
63 // Non-fatal: use unknown if we can't get author
64 author = "Unknown"
65 }
66
67 shortSHA := run.HeadSHA
68 if len(shortSHA) > 7 {
69 shortSHA = shortSHA[:7]
70 }
71
72 commit := CommitInfo{
73 SHA: run.HeadSHA,
74 ShortSHA: shortSHA,
75 Author: author,
76 Message: run.DisplayTitle,
77 }
78
79 // Identify failed jobs
80 var failedJobs []Job
81 for _, job := range run.Jobs {
82 if job.Conclusion == ConclusionFailure {
83 failedJobs = append(failedJobs, job)
84 }
85 }
86
87 return &FailureReport{
88 Workflow: *run,
89 Commit: commit,
90 FailedJobs: failedJobs,
91 TotalJobs: len(run.Jobs),
92 }, nil
93}
94
95// filterCompleted removes workflow runs that are not completed
96func filterCompleted(runs []WorkflowRunSummary) []WorkflowRunSummary {

Callers 1

runAlertCommandFunction · 0.85

Calls 2

GetWorkflowRunFunction · 0.85
GetCommitAuthorFunction · 0.85

Tested by

no test coverage detected