Skip to content

insights: Fix dashboard ping, coalesce all values with 0 in case of nulls

Warren Gifford requested to merge insights/dashboard-ping-fix into main

Created by: CristinaBirkel

Closes https://github.com/sourcegraph/sourcegraph/issues/32404

Description

If there were no insights attached to dashboards, NULL would be returned for these values and cause an error. This fix makes sure to return 0 instead.

Test plan

I ran this with locally with no insights attached to dashboards, and verified this result, and that no error is present in the logs.

      "InsightsPerDashboard": {
          "Avg": 0,
          "Max": 0,
          "Min": 0,
          "Median": 0,
          "StdDev": 0
      },

Merge request reports

Loading