Skip to content

insights: during just in time migration make series look like it was created now

Administrator requested to merge cw/fix-jit-migration-series-date into main

Created by: chwarwick

When migrating just in time the backfill start date is based on the series created at time . This is incorrect the backfill should start from the current time. This change preserves the created at date but sends the current time to the scoped backfiller so that it backfills the 12 most recent points.

closes https://github.com/sourcegraph/sourcegraph/issues/39866

Test plan

  • Set the code_insights_deprecate_jit feature flag to false

  • Create Just in time Track Changes insight and a Detect & track insight scoped to a repo then manually backdate the created atScreen Shot 2022-08-03 at 8 38 13 AM

  • Verify insights display 7 historical points from now Screen Shot 2022-08-03 at 8 38 45 AM

  • Set the code_insights_deprecate_jit feature flag to true

  • Restart the worker so the code to convert Just in time insights runs

  • Verify 12 data points with the most recent being start of current day UTC Screen Shot 2022-08-03 at 8 41 07 AM

  • Verify next recording date is 1 interval from now and next snapshot is start of next day Screen Shot 2022-08-03 at 8 41 45 AM

Merge request reports

Loading