Skip to content

search: fix dynamic filter archive count

Administrator requested to merge rvt/fixup-fork-archive into master

Created by: rvantonder

Played around with this on Sourcegraph.com after landing #10624 and saw some suspect things (fork/archive counts being the same when they both show up). Copy paste error, see inline comment.

Additionally, this behavior was in the DynamicFilter part of the code, which is more annoying to test for (more mock resolvers and mock DB's leave me alone :'( ) so instead I've added the regression test to the integration-tester I'm using and we can migrate those tests into CI when Joe's work is ready.

To make this test reliable, I also tracked down the source of nondeterminism for the filter order (it's sort.Slice rather than sort.SliceStable) and refactored the code to order the dynamic filter chips according to an overridable score, and if it's a tie, to order them alphabetically.

Merge request reports

Loading