Remove the reduce_notebook_diff_rendering feature flag

What does this MR do and why?

This MR removes the reduce_notebook_diff_rendering feature flag and keeps its enabled path. The diff metadata and diff stats endpoints no longer render Jupyter notebook diffs, and diffs that come from a repository comparison no longer render each notebook twice. The flag has been at 100% on GitLab.com since 2026-10-29.

Context for reviewers and agents
  • The flag is a gitlab_com_derisk flag from !263894 (merged). This type is never default-enabled, so the removal is one MR.
  • DiffHelper#diff_options sets use_extra_viewer_as_main: false for diffs_metadata, diff_files_metadata and diffs_stats. These responses used the rendered notebook only for added_lines and removed_lines, so they now report the counts of the raw .ipynb diff.
  • A diff comes from a repository comparison when whitespace changes are ignored (every anonymous request) or when the stored diffs were cleaned. In that case MergeRequestDiff#paginated_diffs, #diffs_in_batch and #diffs_for_streaming call Gitlab::Diff::FileCollection::Base#diff_paths, which now reads the raw diffs. #paginated_diffs also gives the raw diffs to Compare#generated_files. The old path decorated (and rendered) each file once before the comparison rendered it again.
  • Spec changes: the disabled-flag contexts are gone. In spec/requests/projects/merge_requests/notebook_diff_rendering_spec.rb, the example "returns the same files as with rendered notebooks" compared diffs_metadata with its flag-off response. It now compares diffs_metadata with diffs_batch, except for the line counts. A new diffs_batch example checks the rendered notebook line counts, which only the flag-off context checked before. Both examples are in the second commit.
  • Rollback: revert this MR.
  • No query changes, so no database review.

References

Screenshots or screen recordings

No UI change.

How to set up and validate locally

  1. In a GDK project, push a branch that changes the output of one cell in a .ipynb file, then open a merge request for it.
  2. Open the merge request's Changes tab. Expect: the notebook diff renders as on master.
  3. Visit http://gdk.test:3000/<namespace>/<project>/-/merge_requests/<iid>/diffs_metadata.json. Expect: added_lines and removed_lines of the notebook file are the line counts of the raw .ipynb diff.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Eduardo Bonet

Merge request reports

Loading
Loading