Skip to content

Fix analytics tracking for new merge request notes

Stan Hu requested to merge sh-fix-issue-197464 into master

When a new note is created for a merge request with no associated metrics, Sidekiq will error out with NoMethodError: undefined method 'first_comment_at' for nil:NilClass.

This commit ensures a merge request metrics exists before attempting to update it. There is still an outstanding question of why no such metrics were created, but that can happen for older merge requests.

Closes #197464 (closed)

Edited by Stan Hu

Merge request reports