Skip to content

Mitigate "NoMethodError: undefined method `map' for "15":String"

What does this MR do and why?

Users are seeing the error NoMethodError, but the reason on why that is happening is hard to track and reproduce, being caused by malformed jupyter notebooks.

This error currently affects 3% of the users, and to avoid blocking this feature for everyone else we are logging the error and displaying the notebook in it's classic format.

This is a mitigation change and the follow up is already being reviewed.

How to set up and validate locally

  1. Enable the feature flag:
  2. Open the rails consoles (rails c)
  3. Feature.enable(:jupyter_clean_diffs)
  4. Create a mirror of https://gitlab.com/gitlab-org/incubation-engineering/mlops/ipynb-test-projects/diff-sample into your GDK instance
  5. Open the commit edae647e3ddf1b89933c5c7c9809768e0637d686 (http://gdk.test:3000/<path-to-mirror>/-/commit/edae647e3ddf1b89933c5c7c9809768e0637d686)
    • If no change applied, should crash with NoMethodError / 500
    • If change applied, renders regular JupyterDiff: image

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #345963 (closed)

Edited by Eduardo Bonet

Merge request reports