Skip to content

fix empty values in compute results processing

Administrator requested to merge insights/fix-live-preview into main

Created by: coury-clark

This PR has 2 fixes:

  1. Filters empty compute results caused by https://github.com/sourcegraph/sourcegraph/issues/37972
  2. Refactored the live preview for compute group insights to require generatedByCaptureGroups as well as groupBy

Test plan

Before

{
  "data": {
    "searchInsightLivePreview": [
      {
        "points": [
          {
            "value": 72,
            "dateTime": "2022-07-14T15:35:47Z"
          }
        ],
        "label": "Go"
      },
      {
        "points": [
          {
            "value": 67,
            "dateTime": "2022-07-14T15:35:47Z"
          }
        ],
        "label": ""
      },
      {
        "points": [
          {
            "value": 49,
            "dateTime": "2022-07-14T15:35:47Z"
          }
        ],
        "label": "Markdown"
      },
      {
        "points": [
          {
            "value": 12,
            "dateTime": "2022-07-14T15:35:47Z"
          }
        ],
        "label": "JSON"
      },
      {
        "points": [
          {
            "value": 10,
            "dateTime": "2022-07-14T15:35:47Z"
          }
        ],
        "label": "PLSQL"
      },
      {
        "points": [
          {
            "value": 3,
            "dateTime": "2022-07-14T15:35:47Z"
          }
        ],
        "label": "Shell"
      }
    ]
  }
}

After

{
  "data": {
    "searchInsightLivePreview": [
      {
        "points": [
          {
            "value": 72,
            "dateTime": "2022-07-14T15:37:26Z"
          }
        ],
        "label": "Go"
      },
      {
        "points": [
          {
            "value": 49,
            "dateTime": "2022-07-14T15:37:26Z"
          }
        ],
        "label": "Markdown"
      },
      {
        "points": [
          {
            "value": 12,
            "dateTime": "2022-07-14T15:37:26Z"
          }
        ],
        "label": "JSON"
      },
      {
        "points": [
          {
            "value": 10,
            "dateTime": "2022-07-14T15:37:26Z"
          }
        ],
        "label": "PLSQL"
      },
      {
        "points": [
          {
            "value": 3,
            "dateTime": "2022-07-14T15:37:26Z"
          }
        ],
        "label": "Shell"
      }
    ]
  }
}

Merge request reports

Loading