Skip to content

Commit 6a613cb

Browse files
dmitshurgopherbot
authored andcommitted
cmd/coordinator/internal/legacydash: don't clobber ResultData slice
during append Back when there was only one source of result data (Datastore), the CommitInfo.ResultData field was only assigned to. By now, it's also sometimes appended to. Remove extra capacity in the shared slice so that appending results to the same x/ repo commit (i.e., a total of three times: for the main branch, and two release branches) is fine. This happened not to come up during local development, at least not until Datastore permissions were setup to permit its use, but it is easy to see on build.golang.org. For golang/go#65913. Change-Id: Id19ddf389f8d7ac4d69f2ac8477443005b9671ef Reviewed-on: https://go-review.googlesource.com/c/build/+/574557 Reviewed-by: Michael Knyszek <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Auto-Submit: Dmitri Shuralyov <[email protected]>
1 parent 17ad1fa commit 6a613cb

File tree

1 file changed

+3
-1
lines changed
  • cmd/coordinator/internal/legacydash

1 file changed

+3
-1
lines changed

cmd/coordinator/internal/legacydash/ui.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,9 @@ func (tb *uiTemplateDataBuilder) newCommitInfo(dsCommits map[string]*Commit, rep
214214
Branch: branch,
215215
}
216216
if dsc, ok := dsCommits[dc.Commit]; ok {
217-
ci.ResultData = dsc.ResultData
217+
// Remove extra dsc.ResultData capacity to make it
218+
// okay to append additional data to ci.ResultData.
219+
ci.ResultData = dsc.ResultData[:len(dsc.ResultData):len(dsc.ResultData)]
218220
}
219221
// For non-go repos, add the rows for the Go commits that were
220222
// at HEAD overlapping in time with dc.Commit.

0 commit comments

Comments
 (0)