insights: Backend work to sort series
View options
- Truncate descriptions
Created by: CristinaBirkel
Continuing off of spike ticket: https://github.com/sourcegraph/sourcegraph/issues/33930
API changes:
-
createLineChartSearchInsight
: anything needed here? Do we want users be able to set this at creation time? -
updateLineChartSearchInsight
: I believe changes here will be needed in order to persist the sort order and display count. Which I think we want to be able to do? That's what I did in this draft PR. Any thoughts here about the structure? -
insightViews
: I assume we'll need to add an additional argument to take the sort filters. I didn't consider this use case at first and will need to add it into the PR. I wonder in general if this belongs with thefilters
argument, or is a separate thing? It's not really a filter. - Any other API changes needed?
As far as sorting options, I've added these:
enum SeriesSortOrder {
HIGHEST_RESULT_COUNT
LOWEST_RESULT_COUNT
ASC_LEXICOGRAPHICAL
DESC_LEXICOGRAPHICAL
}
I may need to add OLDEST
and LATEST
as well, given the designs.
I think one open question is whether this applies only to capture group insights. There may be conflicting thoughts there. Right now I'm storing this metadata at the insight_view
level, but if it's only for capture group series I wonder if it belongs on the capture group series itself.

