Commit 0153b060 authored by Thong Kuah's avatar Thong Kuah

Merge branch '344904-feature-flag-jupyter_clean_diffs-feature-flag-cleanup' into 'master'

[Feature Flag] jupyter_clean_diffs - Clean up log events

See merge request gitlab-org/gitlab!74099
parents 49b81ec2 ad40fc17
...@@ -126,13 +126,9 @@ class BlobPresenter < Gitlab::View::Presenter::Delegated ...@@ -126,13 +126,9 @@ class BlobPresenter < Gitlab::View::Presenter::Delegated
def transformed_blob_data def transformed_blob_data
@transformed_blob ||= if blob.path.ends_with?('.ipynb') @transformed_blob ||= if blob.path.ends_with?('.ipynb')
new_blob = IpynbDiff.transform(blob.data, IpynbDiff.transform(blob.data,
raise_errors: true, raise_errors: true,
options: { include_metadata: false, cell_decorator: :percent }) options: { include_metadata: false, cell_decorator: :percent })
Gitlab::AppLogger.info(new_blob ? 'IPYNBDIFF_BLOB_GENERATED' : 'IPYNBDIFF_BLOB_NIL')
new_blob
end end
@transformed_blob ||= blob.data @transformed_blob ||= blob.data
......
...@@ -463,9 +463,7 @@ module Gitlab ...@@ -463,9 +463,7 @@ module Gitlab
diff.diff = new_diff.scan(/.*\n/)[2..-1].join('') if new_diff diff.diff = new_diff.scan(/.*\n/)[2..-1].join('') if new_diff
Gitlab::AppLogger.info({ message: new_diff ? 'IPYNB_DIFF_GENERATED' : 'IPYNB_DIFF_NIL', Gitlab::AppLogger.info({ message: new_diff ? 'IPYNB_DIFF_GENERATED' : 'IPYNB_DIFF_NIL' })
from: from&.to_s, to: to&.to_s,
lib_version: Gem.loaded_specs["ipynbdiff"].version.version })
rescue IpynbDiff::InvalidNotebookError => e rescue IpynbDiff::InvalidNotebookError => e
Gitlab::ErrorTracking.track_exception(e, issue_url: 'https://gitlab.com/gitlab-org/gitlab/-/issues/344676') Gitlab::ErrorTracking.track_exception(e, issue_url: 'https://gitlab.com/gitlab-org/gitlab/-/issues/344676')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment