Skip to content

Add caching on call to Repository#merge_to_ref

What does this MR do?

Repository#merge_to_ref has been identified as an expensive call, and it stands to reason that for a given target/source sha combination, subsequent calls should result in the same result.. so why call it more than once for a given combination (especially since this can be a slow, weighty call to make to Gitaly?)

I considered pushing caching down into #merge_to_ref itself, but that felt more disruptive and widespread than applying it here in the service.

I also considered adding circuit breakers to the Gitaly client, but that again is a deeper, more invasive change that needs to be thought out a bit more.

Screenshots or Screencasts (strongly suggested)

How to setup and validate locally (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

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

Related to #337450 (closed) and #336979 (closed)

Edited by Kerri Miller

Merge request reports