Skip to content

insights: Remove series from view before deleting insight

Warren Gifford requested to merge insights/delete-series into main

Created by: CristinaBirkel

Closes https://github.com/sourcegraph/sourcegraph/issues/29050, https://github.com/sourcegraph/sourcegraph/issues/35882

Description

When an insight was deleted, the corresponding series were not being marked as deleted. This made it so that our background cleanup job never cleaned those series up. Explicitly removing the series from the view makes use of the logic to mark series as deleted when they are no longer attached to any view.

Test plan

  1. Before this fix: I created a new insight with several series, deleted it, and verified that its series were not marked as deleted.
  2. After this fix: Same, but verified that the series are now being marked as deleted. Upon restarting the service they are cleaned up by the background job as expected.

Merge request reports

Loading