Ensure merge request metrics exist when updating them
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.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Stan Hu