Skip to content
Snippets Groups Projects

Nullify merge_request_metrics pipeline_id on pipeline deletion

Merged Patrick Bajao requested to merge 26911-nullify-metrics-pipeline-lfk into master
  1. Apr 25, 2022
    • Patrick Bajao's avatar
      Nullify merge_request_metrics pipeline_id on pipeline deletion · 4cbd01b1
      Patrick Bajao authored
      Before, when a pipeline is deleted, the associated
      `merge_request_metrics` record will be deleted as well. This is a
      destructive thing as `merge_request_metrics` include other data
      not related to a pipeline.
      
      To fix this issue, instead of deleting the association record, we
      nullify the `pipeline_id` on `merge_request_metrics` instead. When
      this happens, related build data (`latest_build_started_at` and
      `latest_build_finished_at`) will be nullified as well. This is to
      ensure that when those data are requested, it'll still behave the
      same way as before.
      
      Changelog: fixed
      4cbd01b1
Loading