Skip to content

Commit 6efe3c1

Browse files
craig[bot]rickystewart
andcommitted
Merge #150776
150776: teamcity: fix extra labels logic r=jlinder a=rickystewart I was confused about how closures work, so this caused a stack overflow. This fixes the problem. Epic: CRDB-21133 Release note: None Co-authored-by: Ricky Stewart <[email protected]>
2 parents e0bc803 + 8442d08 commit 6efe3c1

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

pkg/cmd/bazci/githubpost/githubpost.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,13 @@ func getFailurePosterFromFormatterName(formatterName string, extraLabels []strin
120120
reqFromFailure = DefaultFormatter
121121
}
122122
if len(extraLabels) > 0 {
123-
reqFromFailure2 := func(ctx context.Context, f Failure) (issues.IssueFormatter, issues.PostRequest) {
124-
i, r := reqFromFailure(ctx, f)
125-
r.Labels = append(r.Labels, extraLabels...)
126-
return i, r
127-
}
128-
reqFromFailure = reqFromFailure2
123+
reqFromFailure = func(formatter Formatter) Formatter {
124+
return func(ctx context.Context, f Failure) (issues.IssueFormatter, issues.PostRequest) {
125+
i, r := formatter(ctx, f)
126+
r.Labels = append(r.Labels, extraLabels...)
127+
return i, r
128+
}
129+
}(reqFromFailure)
129130
}
130131
return DefaultIssueFilerFromFormatter(reqFromFailure)
131132
}

0 commit comments

Comments
 (0)