Code Insights: Connect drill-down UI with BE insight loading card logic
Created by: vovakulikov
Context
Closes https://github.com/sourcegraph/sourcegraph/issues/23190
This PR connects the drill-down filters panel component and BE fetch logic with applied drill-down filters. We already have drill-down filters in our gql API.
points(
from: DateTime
to: DateTime
includeRepoRegex: String
excludeRepoRegex: String
): [InsightDataPoint!]! {
dateTime,
value
}
Data points over a time range (inclusive)
- If no 'from' time range is specified, the last 90 days of data is assumed.
- If no 'to' time range is specified, the current point in time is assumed.
- includeRepoRegex will include in the aggregation any repository names that match the provided regex
- excludeRepoRegex will exclude in the aggregation any repository names that match the provided regex
And we already have a drill-down filter panel component from this PR https://github.com/sourcegraph/sourcegraph/pull/23559
How to test
You must have BE insights in your dashboard (to create this type of insight you have to go to insight creation UI and turn on Run over all repos checkbox - one import thing currently this checkbox and this mode of BE insights visible only for users that have codeInsightsAllRepos: true
in they experimentalFeatures
settings
Right after that, you must see your BE insights on the dashboard page with a filter icon right next to the three dots menu. By this filter icon you can set your drill-down filters.
What have been done
-
Connect the filter panel component with the top-level state at BE insight card -
Apply filters value in the BE fetch method (gql API handler)