Loading
Remove the suggestion_highlight_uses_note_diff_file feature flag
Removes the suggestion_highlight_uses_note_diff_file feature flag. The flag has been at 100% on GitLab.com since 2026-09-24 with no attributed exceptions, so the flag-on path (highlighting suggestions from the stored diff file instead of a Gitaly compare per discussion) is now the only path.
Resolves #629414 (closed)
Detailed context for AI agents
Flag
suggestion_highlight_uses_note_diff_file, typegitlab_com_derisk, group::code review, introduced in 19.5 by !255964 (merged).- Feature issue: https://gitlab.com/gitlab-com/gl-infra/production/-/issues/22925
- Rollout issue: #629414 (closed)
Why the flag existed
- A production incident where gitlab-org/gitlab hit a Gitaly CommitDiff rate limit on the merge request discussions endpoint.
What the flag gated
Suggestion#diff_file_for_highlightinapp/models/suggestion.rb.- Flag on: returns
note.discussion.diff_file, which is built from the storednote_diff_filesrow of the discussion's first note. - Flag off (old path): returned
note.latest_diff_file, which runs a Gitaly compare (one CommitDiff plus two FindCommit calls) per suggestion-bearing discussion on every discussions.json load.
Rollout history on GitLab.com
- Staging and test project: 2026-09-18
- gitlab-org/gitlab: 2026-09-18
- 25% of actors: 2026-09-22
- 50%: 2026-09-23
- 100%: 2026-09-24
- No exceptions were attributed to the flag. CommitDiff volume from the discussions controller dropped as expected.
Changes in this MR (24 lines deleted, nothing added)
- Deleted the flag check line in
app/models/suggestion.rb. - Deleted
config/feature_flags/gitlab_com_derisk/suggestion_highlight_uses_note_diff_file.yml. - Removed the "when suggestion_highlight_uses_note_diff_file is disabled" context from
spec/models/suggestion_spec.rb. Suggestion#diff_fileis kept becauseoutdated?and the apply path still use it.- The commit has
Changelog: performance.
Behavioural notes (unchanged from the original MR)
- Discussions whose first note has no stored
note_diff_filesrow still fall back to the Gitaly compare insideDiffDiscussion#diff_file. - Cosmetic differences are limited to syntax highlighting of suggestion previews:
- The lexer follows the file path at comment time, so a later rename that changes the extension picks a different lexer.
- The "too large to highlight" check uses blob sizes at the original refs rather than head.
- Applying suggestions is unchanged.
Verification
bundle exec rspec spec/models/suggestion_spec.rb- 36 examples, 0 failures.- Rubocop clean on both changed Ruby files.