Resolve "Integrate rb-ipynbdiff into Gitlab"
Why
Code reviewing Jupyter Notebooks is currently not possible, and a pain point for our users.
Epic: &6589 (closed)
What
- Adds a dependency to rb-ipynbdiff (https://gitlab.com/gitlab-org/incubation-engineering/mlops/rb-ipynbdiff)
- When displaying diffs, detects a ipynb file and converts the blobs to a markdown version
- When displaying diffs, creates a new diff based on the markdown version
Screenshots
Before | After | |
---|---|---|
Diff | ||
MR |
Testing
- Clone https://gitlab.com/gitlab-org/incubation-engineering/mlops/ipynb-test-projects/diff-sample
- Navigate to the first commit diff
- The diff should be displayed as the before screenshot above, since the feature flag is disabled
- Enable the feature flag:
- Open the rails consoles (
rails c
) Feature.enable(:jupyter_clean_diffs)
- Open the rails consoles (
- For MR, create a merge request from branch
adding_new_file
intomain
- Make sure the feature is enabled
Concerns
- We understand this is a heavy operation to be added at request time. We are currently exploring alternatives on how to enable special diff rendering for varied file types on this issue: #342143 (closed)
- At the moment we generate the diff, we have already fetched the info from gitaly, so the limits of file size area already applied at this point
Edited by Eduardo Bonet