Skip to content

insights: update series query data

Administrator requested to merge insights/api/series-update-2 into main

Created by: CristinaBirkel

Closes: #25979 (closed) Stacked on top of: https://github.com/sourcegraph/sourcegraph/pull/26744

Description

The idea with this PR is to:

  • Support the rest of the series update
  • Manage the re-use of existing series, and marking orphaned series as deleted. (Background process to clean them up can be a separate issue.) This re-use will work for both creation and updates.

Related issues for future work:

Testing Steps

There are several cases to consider here, based on whether the user is updating a BE or FE series. (For now, we consider a series lacking any repositories to be backend, and otherwise is frontend.) A change to this field could change a BE series to a FE series or vice versa.

All of this can be checked via the API and in the database to verify it is doing what's expected.

  1. FE series -> FE series: This is the easiest one to handle. The series just gets updated in place.
  2. BE series -> BE series, BE -> FE, FE -> BE: All 3 of these should have the same behavior.
  • Detach the series from the insight
  • Find or create a series to attach
  • If the detached series was not being used by any other insight, mark it as deleted

I have poked around at the various cases and it seems to be working as expected, but I wouldn't be surprised if I missed something. Let me know if you see anything unusual!

Merge request reports

Loading