Code Insights: Add data points links to backend insights
Created by: vovakulikov
Closes https://github.com/sourcegraph/sourcegraph/issues/28777
Context
Prior to this PR, only Runtime (just in time) insights had links for chart data points. This PR adds support of links for Backend (insights that run over all repositories) too.
Tech details
Adding links to the data points is built on top of the linkURLs
field of series chart configuration. Prior to this PR, this field was just an array with string URLs. But since LineChart can render different series with different amounts of data and any series can have holes in the series data array it was very difficult to sync indexes between data points and linkURLs
list.
Because of that now linkURLs
is a map where the key is unique attribute of each point (for time series chart it is X-axis point/date) and value is string URL for this data point.
This PR updates the public Sourcegraph API so we should update our extensions in a way to support a new API for linkURLs
. Sourcegraph extensions with linkURLs
usage (Note: search-based extension is deprecated and should be archived, so there is no need to update it)