Reuse the loaded commit in CommitSignature#verification_status
What does this MR do and why?
The commits list page shows the signature status of each commit. For a verified signature, CommitSignature#verification_status checks the committer email. To do this, it loaded the commit again with project.commit(commit_sha). This made one Gitaly FindCommit call for each verified commit on the page. On projects where most commits are verified, this adds up quickly.
Gitlab::Repositories::BaseSignedCommit#signature already has the commit in memory, so it now gives that commit to the signature record. CommitSignature#commit also memoizes the commit for records that do not get one. The verification status does not change, and the FindCommit call for each commit is removed.
References
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.