Cache the commit partials in MRs [RUN ALL RSPEC] [RUN AS-IF-FOSS]

Merged Robert May requested to merge cached-mr-commit-partials into master

What does this MR do?

Caches the commit partial renders in the commits tab on MRs and in the /commits path. This scopes the current pipeline status into the cache key, meaning that old commits with finished pipelines will usually be served from the cache and save significant rendering time.

The amount of time saved is hard to calculate locally, but I would expect at least a 25% improvement in the rendering speed of the commits action. Optimistically something like 75% wouldn't be impossible. Locally an example MR without pipelines drops from 140ms to 90ms.

Related #209912

Screenshots (strongly suggested)

Does this MR meet the acceptance criteria?


Availability and Testing


Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Robert May