Skip to content

Resolve "ActionView::Template::Error: undefined method `gsub' for #<Array:0x00007f1af5351c88>"

Why

Notebooks can have an edgecases where png outputs are multiline. Upgrades ipynbdiff gem to 0.4.6

Diff for the update (note we can't use gitlab UI to display this diff because of the bug this MR fixes)

How to test

  1. Create a repository and add the offending file:

    mkdir error_notebook
    cd error_notebook
    curl https://gitlab.com/gitlab-org/gitlab/uploads/f1920fb37e2410ac2ef8b37718c14699/array-png.ipynb -o array-png.ipynb
    git init -b main
    git add -A 
    git commit -am "Adding offending notebook"
    git remote add origin <your local repository>
    git push --upstream origin main
  2. Enable the feature flags

    Feature.enable(:ipynb_semantic_diff)
    Feature.enable(:rendered_diffs_viewer)
  3. Restart GDK and open the commit

  4. Without the changes, opening the commit will cause gitlab to 500

  5. With the changes, the transformed diff is shown image

Edited by Eduardo Bonet

Merge request reports