Skip to content

Insights/api frozen insights filter

Administrator requested to merge insights/api-frozen-insights-filter into main

Created by: coury-clark

Stacked on https://github.com/sourcegraph/sourcegraph/pull/32390 Closes #32190 (closed)

Removes the dataSeries field if the insight is frozen.

Test plan

Not frozen:

{
  "data": {
    "insightViews": {
      "nodes": [
        {
          "id": "aW5zaWdodF92aWV3OiIyNVU3alhuVWNUbjZZaWNkZ01MZXN1Q0F1ZmUi",
          "isFrozen": false,
          "appliedFilters": {
            "excludeRepoRegex": null,
            "includeRepoRegex": null
          },
          "defaultFilters": {
            "excludeRepoRegex": null,
            "includeRepoRegex": null
          },
          "dataSeriesDefinitions": [
            {
              "query": "func"
            }
          ],
          "dataSeries": [
            {
              "points": [
                {
                  "value": 137802,
                  "dateTime": "2022-03-09T18:02:46Z"
                },
                {
                  "value": 137802,
                  "dateTime": "2022-03-08T18:03:59Z"
                },
                {
                  "value": 137804,
                  "dateTime": "2022-03-07T00:44:21Z"
                },
                {
                  "value": 137804,
                  "dateTime": "2022-03-06T00:44:20Z"
                },
                {
                  "value": 137801,
                  "dateTime": "2022-03-05T00:44:17Z"
                },
                {
                  "value": 136671,
                  "dateTime": "2022-03-04T21:31:47Z"
                },
                {
                  "value": 136546,
                  "dateTime": "2022-02-23T16:18:14Z"
                },
                {
                  "value": 136531,
                  "dateTime": "2022-02-22T00:00:00Z"
                },
                {
                  "value": 133480,
                  "dateTime": "2022-01-22T00:00:00Z"
                },
                {
                  "value": 129676,
                  "dateTime": "2021-12-22T00:00:00Z"
                },
                {
                  "value": 139668,
                  "dateTime": "2021-11-22T00:00:00Z"
                },
                {
                  "value": 117560,
                  "dateTime": "2021-10-22T00:00:00Z"
                },
                {
                  "value": 115804,
                  "dateTime": "2021-09-22T00:00:00Z"
                },
                {
                  "value": 112511,
                  "dateTime": "2021-08-22T00:00:00Z"
                },
                {
                  "value": 110260,
                  "dateTime": "2021-07-22T00:00:00Z"
                },
                {
                  "value": 109154,
                  "dateTime": "2021-06-22T00:00:00Z"
                },
                {
                  "value": 107799,
                  "dateTime": "2021-05-22T00:00:00Z"
                },
                {
                  "value": 104730,
                  "dateTime": "2021-04-22T00:00:00Z"
                },
                {
                  "value": 103631,
                  "dateTime": "2021-03-22T00:00:00Z"
                }
              ]
            }
          ]
        }
      ]
    }
  }
}

After setting frozen to true:

{
  "data": {
    "insightViews": {
      "nodes": [
        {
          "id": "aW5zaWdodF92aWV3OiIyNVU3alhuVWNUbjZZaWNkZ01MZXN1Q0F1ZmUi",
          "isFrozen": true,
          "appliedFilters": {
            "excludeRepoRegex": null,
            "includeRepoRegex": null
          },
          "defaultFilters": {
            "excludeRepoRegex": null,
            "includeRepoRegex": null
          },
          "dataSeriesDefinitions": [
            {
              "query": "func"
            }
          ],
          "dataSeries": []
        }
      ]
    }
  }
}

Merge request reports

Loading