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

  1. Put a 32-character hex string (for example 86cf52818ce35ddc67a9aed6cc5ce19c) in a merge request description.
  2. Load the merge request page with the performance bar open.
  3. Check the Gitaly panel: before this change there is a commit_service#list_commits_by_oid call for that string; after this change there is none.
  4. Put an issue reference in the description instead and confirm the widget still shows "Mentions issue ...".

🤖 Generated with Claude Code

Merge request reports

Loading
Loading