Skip unused reference filters when extracting issue references
What does this MR do and why?
The merge request page renders its full shell on every tab, and the first-load widget payload needs the "mentioned issues" links. Building those runs the title and description through the full GitLab Flavored Markdown pipeline, so every reference filter executes — including the commit one. A commit reference is any 7-64 character hex word, so an md5, asset digest or webpack chunk hash in a description gets resolved through Gitaly on every render, even though only issue references are wanted.
Extraction now uses a pipeline that drops every reference filter running after the issue filters, since a later filter can never change what an earlier one already matched. Filters running before them are kept, including the design reference filter that claims #123[file.png] first. The drop list is computed from the GFM pipeline at runtime, so EE-only filters and future additions need no upkeep.
Reproduction steps
- Put a 32-character hex string (for example
86cf52818ce35ddc67a9aed6cc5ce19c) in a merge request description. - Load the merge request page with the performance bar open.
- Check the Gitaly panel: before this change there is a
commit_service#list_commits_by_oidcall for that string; after this change there is none. - Put an issue reference in the description instead and confirm the widget still shows "Mentions issue ...".