Skip to content

Split up RelativeLinkFilter into UploadLinkFilter and RepositoryLinkFilter

Sean McGivern requested to merge split-up-relativelinkfilter into master

What does this MR do?

RelativeLinkFilter handled two types of relative link:

  1. Uploaded files in the same project.
  2. Repository files in the same project.

Although these are both relative links, they are otherwise quite different. In particular, optimisations like !16824 (merged) work when we have lots of repository links, but actually increase the number of Gitaly calls when we have lots of upload links and no repository links.

Instead of trying to thread the needle further, this MR just splits this into two filters: UploadLinkFilter and RepositoryLinkFilter. UploadLinkFilter must come first as it can act as a short-circuit: when we only have upload links, we don't need to process any repository links, and therefore can make zero Gitaly calls.

Commits (more details in commit messages):

  1. Remove an unused pipeline.
  2. Rename RelativeLinkFilter -> RepositoryLinkFilter.
  3. Add UploadLinkFilter.
  4. Remove upload link handling from RepositoryLinkFilter and add spec to ensure that no Gitaly calls are made in this case.

For #34404 (closed).

Edited by Sean McGivern

Merge request reports