Skip to content

Rspec Failure: spec/lib/gitlab/background_migration/sanitize_confidential_todos_spec.rb:81

Reported in today's master-broken incidents:

Failures:

  1) Gitlab::BackgroundMigration::SanitizeConfidentialTodos#perform deletes todos where user can not read its note and logs deletion
     Failure/Error: @subject.noteable.work_item_type.widgets.include?(::WorkItems::Widgets::Notes)

     NoMethodError:
       undefined method `widgets' for nil:NilClass
     # ./app/policies/note_policy.rb:26:in `block in <class:NotePolicy>'
     # ./app/models/ability.rb:86:in `allowed?'

Introduced by !104412 (merged)

the above MR somehow is missing the pipeline:mr-approved label, which prevented this merge request from running the rspec migration pg12 job containing sanitize_confidential_todos_spec because of this rule, so we weren't able to catch this issue before it's merged in master.

Edited by Jennifer Li