Skip to content

Prevent ActiveRecord::RecordNotUnique errors for Code Quality

rossfuhrman requested to merge rf-cq-dup-index-key into master

What does this MR do and why?

Addresses ActiveRecord::RecordNotUnique: PG::UniqueViolat... (#389928)

We are seeing unique DB index violations in Sentry (linked in issue), that this change hopes to address. It is modeled after similar code in app/services/ci/pipeline_artifacts/coverage_report_service.rb.

How to set up and validate locally

I have been unable to replicate the problem locally so that could confirm this fixes the problem. I did however comment out the check for pipeline.has_codequality_mr_diff_report? and confirmed the specs worked as expected.

MR acceptance checklist

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

Edited by rossfuhrman

Merge request reports

Loading