Merge request metrics has outdated pipeline information
As noticed at https://gitlab.com/gitlab-org/gitlab-ce/issues/50620#note_144910117, merge_request_metrics table has outdated information in the following columns:
latest_build_started_atlatest_build_finished_atpipeline_id
It seems like need a background migration similar to https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/23564 to handle such merge requests.
It currently affects our merge request API as we use merge_request.metrics.pipeline information.
Ultimately with this issue we'd also want to make sure this data is updated accordingly when new pipelines are created.
Edited by Oswaldo Ferreira