Skip to content

Ensure merge request metrics exist when updating them

Stan Hu requested to merge sh-ensure-merge-request-metrics-exist into master

What does this MR do and why?

Normally merge request metrics are created in the after_commit hook of a merge request. If for some reason the merge request metrics failed to create after creation, we need to make sure they are present here because the after_commit hook only fires in the update case after a merge request update has been committed to the database. However, during the update, the metrics themselves may be modified before that can happen.

Relates to #26911 (closed)

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Stan Hu

Merge request reports