Skip to content

Commit 8bc751c

Browse files
authored
add the right title to reporter (#1620)
1 parent 06dac15 commit 8bc751c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

cli/pkg/spec/spec.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func RunSpec(
4949
if err != nil {
5050
usage.ReportErrorAndExit(spec.VCS.Actor, fmt.Sprintf("could not get orgservice: %v", err), 1)
5151
}
52-
reporter, err := reporterProvider.GetReporter(spec.Reporter, prService, *spec.Job.PullRequestNumber)
52+
reporter, err := reporterProvider.GetReporter(fmt.Sprintf("%v for %v", spec.Job.JobType, job.ProjectName), spec.Reporter, prService, *spec.Job.PullRequestNumber)
5353
if err != nil {
5454
usage.ReportErrorAndExit(spec.VCS.Actor, fmt.Sprintf("could not get reporter: %v", err), 1)
5555
}

libs/spec/providers.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,12 @@ func (l LockProvider) GetLock(lockSpec LockSpec) (locking.Lock, error) {
113113

114114
type ReporterProvider struct{}
115115

116-
func (r ReporterProvider) GetReporter(reporterSpec ReporterSpec, ciService ci.PullRequestService, prNumber int) (reporting.Reporter, error) {
116+
func (r ReporterProvider) GetReporter(title string, reporterSpec ReporterSpec, ciService ci.PullRequestService, prNumber int) (reporting.Reporter, error) {
117117
getStrategy := func(strategy string) reporting.ReportStrategy {
118118
switch reporterSpec.ReportingStrategy {
119119
case "comments_per_run":
120120
return reporting.CommentPerRunStrategy{
121+
Title: title,
121122
TimeOfRun: time.Now(),
122123
}
123124
case "latest_run_comment":

0 commit comments

Comments
 (0)