x/build/maintner: GerritMeta.LabelVotes may panic if one of the commits it loops over is not present in corpus #50474
Labels
Builders
x/build issues (builders, bots, dashboards)
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
Inside the
GerritMeta.LabelVotes
method, there's code like:Since it iterates over known patch sets of a given Gerrit CL, it's expected both
oldCommit
andnewCommit
will be non-nil, otherwise it'd panic. The current version ofGerritMeta.LabelVotes
is only used on the https://dev.golang.org/reviews page, and it's expected to always work, so it doesn't currently return an error.Issue #47695 showed, at least one time, an instance where that wasn't the case. It hasn't happened again. My current best understanding is that it may have been some race, possibly in Gerrit itself, but it's not clear if it was a one-off problem that was resolved, or may continue to happen again.
This is a tracking issue to decide how to best handle this, especially if it becomes a problem again.
My current preference is to deprecate/remove
GerritMeta.LabelVotes
fromx/build/maintner
and move its implementation tox/build/devapp
, the only place where it's used. The method seems to rely on too many heuristics and doesn't fit with the rest ofmaintner
API; if we can't make it work well in the general case, we shouldn't try to offer it.The text was updated successfully, but these errors were encountered: