Skip to content

insights: adds ability to run just it time insight on backend

Administrator requested to merge cw/jit-insight-be into main

Created by: chwarwick

Adds the ability to run non-capture group just in time insights via the API.

resolves https://github.com/sourcegraph/sourcegraph/issues/33928

Test plan

query a just in time insight

query GetInsightView {
  insightViews(id: "aW5zaWdodF92aWV3OiIyODRpVkFqQ29LNFFpN1luYXdtdllEbUlpQ0Yi") {
    nodes {
      id
      dataSeries {
        seriesId
        label
        points {
          dateTime
          value
          __typename
        }
        __typename
      }
      __typename
    }
    __typename
  }
}

response

{
  "data": {
    "insightViews": {
      "nodes": [
        {
          "id": "aW5zaWdodF92aWV3OiIyODRpVkFqQ29LNFFpN1luYXdtdllEbUlpQ0Yi",
          "dataSeries": [
            {
              "seriesId": "284iVCCaPPd11kY5iIZQP0B4Xya",
              "label": "TODOs",
              "points": [
                {
                  "dateTime": "2021-10-21T00:00:00Z",
                  "value": 672,
                  "__typename": "InsightDataPoint"
                },
                {
                  "dateTime": "2021-11-21T00:00:00Z",
                  "value": 717,
                  "__typename": "InsightDataPoint"
                },
                {
                  "dateTime": "2021-12-21T00:00:00Z",
                  "value": 743,
                  "__typename": "InsightDataPoint"
                },
                {
                  "dateTime": "2022-01-21T00:00:00Z",
                  "value": 745,
                  "__typename": "InsightDataPoint"
                },
                {
                  "dateTime": "2022-02-21T00:00:00Z",
                  "value": 826,
                  "__typename": "InsightDataPoint"
                },
                {
                  "dateTime": "2022-03-21T00:00:00Z",
                  "value": 830,
                  "__typename": "InsightDataPoint"
                },
                {
                  "dateTime": "2022-04-21T00:00:00Z",
                  "value": 842,
                  "__typename": "InsightDataPoint"
                }
              ],
              "__typename": "InsightsSeries"
            }
          ],
          "__typename": "InsightView"
        }
      ],
      "__typename": "InsightViewConnection"
    }
  }
}

Merge request reports

Loading