Loading
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_deriskflag from !263894 (merged). This type is never default-enabled, so the removal is one MR. DiffHelper#diff_optionssetsuse_extra_viewer_as_main: falsefordiffs_metadata,diff_files_metadataanddiffs_stats. These responses used the rendered notebook only foradded_linesandremoved_lines, so they now report the counts of the raw.ipynbdiff.- 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_batchand#diffs_for_streamingcallGitlab::Diff::FileCollection::Base#diff_paths, which now reads the raw diffs.#paginated_diffsalso gives the raw diffs toCompare#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" compareddiffs_metadatawith its flag-off response. It now comparesdiffs_metadatawithdiffs_batch, except for the line counts. A newdiffs_batchexample 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
- Related to https://gitlab.com/gitlab-org/gitlab/-/work_items/635109
- Flag introduced in !263894 (merged)
- Sibling MR: !269553 (merged) removes
cache_notebook_diffsandstop_notebook_text_diff_at_timeout. It also editsspec/lib/gitlab/diff/file_collection/base_spec.rbandspec/requests/projects/merge_requests/notebook_diff_rendering_spec.rb, so the MR that merges second can need a rebase.cap_rendered_notebook_sizestays.
Screenshots or screen recordings
No UI change.
How to set up and validate locally
- In a GDK project, push a branch that changes the output of one cell in a
.ipynbfile, then open a merge request for it. - Open the merge request's Changes tab.
Expect: the notebook diff renders as on
master. - Visit
http://gdk.test:3000/<namespace>/<project>/-/merge_requests/<iid>/diffs_metadata.json. Expect:added_linesandremoved_linesof the notebook file are the line counts of the raw.ipynbdiff.
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