Summary#
Documents a bug where Search in all three indexers (repos, issues, pulls) returns nil, nil when the underlying bleve SearchInContext call fails. Every caller does if err != nil { return } — the guard is bypassed, and the next dereference of the nil result panics.
This PR adds TestSearchOnClosedIndex to each package to reproduce the bug. The tests intentionally fail to prove the bug is present. The fix (return nil, nil → return nil, err) comes in a follow-up PR.
Test plan#
-
go test ./appview/indexer/repos/ -run TestSearchOnClosedIndex→ FAIL -
go test ./appview/indexer/issues/ -run TestSearchOnClosedIndex→ FAIL -
go test ./appview/indexer/pulls/ -run TestSearchOnClosedIndex→ FAIL - All pre-existing tests in those three packages still PASS
do we need these tests yet?
appview/indexer/repos/indexer_test.go:608: this error message would now be outdated by the merge of the follow-up fix, would it not?