Skip to content

Commit

Permalink
Support manualRerunCount in task's fields (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
edigaryev authored Aug 19, 2024
1 parent 3794510 commit a76f0e2
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions internal/command/datadog/payload/buildortask.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ type BuildOrTask struct {
} `json:"user"`
}
Task struct {
ID *int64 `json:"id"`
Name *string `json:"name"`
Status *string `json:"status"`
InstanceType *string `json:"instanceType"`
UniqueLabels []string `json:"uniqueLabels"`
ID *int64 `json:"id"`
Name *string `json:"name"`
Status *string `json:"status"`
InstanceType *string `json:"instanceType"`
UniqueLabels []string `json:"uniqueLabels"`
ManualRerunCount *int64 `json:"manualRerunCount"`
}

common
Expand Down Expand Up @@ -66,4 +67,7 @@ func (buildOrTask BuildOrTask) Enrich(header http.Header, evt *datadogsender.Eve
if value := buildOrTask.Task.UniqueLabels; len(value) > 0 {
evt.Tags = append(evt.Tags, fmt.Sprintf("task_unique_labels:%s", strings.Join(value, ",")))
}
if value := buildOrTask.Task.ManualRerunCount; value != nil {
evt.Tags = append(evt.Tags, fmt.Sprintf("manual_rerun_count:%d", *value))
}
}

0 comments on commit a76f0e2

Please sign in to comment.