Skip to content

Commit

Permalink
cmd/coordinator/internal/legacydash: don't clobber ResultData slice
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
dmitshur authored and gopherbot committed Mar 27, 2024
1 parent 17ad1fa commit 6a613cb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/coordinator/internal/legacydash/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ func (tb *uiTemplateDataBuilder) newCommitInfo(dsCommits map[string]*Commit, rep
Branch: branch,
}
if dsc, ok := dsCommits[dc.Commit]; ok {
ci.ResultData = dsc.ResultData
// Remove extra dsc.ResultData capacity to make it
// okay to append additional data to ci.ResultData.
ci.ResultData = dsc.ResultData[:len(dsc.ResultData):len(dsc.ResultData)]
}
// For non-go repos, add the rows for the Go commits that were
// at HEAD overlapping in time with dc.Commit.
Expand Down

0 comments on commit 6a613cb

Please sign in to comment.