Avoid N+1 on MRs page when metrics merging date cannot be found
What does this MR do?
- Do not allow reverting a MR when we can't find the
merged_at
timestamp - Make it easier to fetch the merging timestamp for MRs
Are there points in the code the reviewer needs to double check?
Why was this MR needed?
Experiencing N+1's when opening merged merge requests which the merged_at
timestamp couldn't be found, so we used spend a lot of time fetching notes.
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added -
Tests added for this feature/bug - Conforms to the code review guidelines
-
Has been reviewed by a Backend maintainer
-
-
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides -
If you have multiple commits, please combine them into a few logically organized commits by squashing them -
Internationalization required/considered -
End-to-end tests pass ( package-and-qa
manual pipeline job)