Skip to content

Resolve "ActiveRecord::RecordNotUnique: PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_ci_builds_meta..."

Tomasz Maczukin requested to merge 44922-fix-build-metadata-creation into master

What does this MR do?

Resolves the problem, when concurrent requests for a CI/CD job end with a ActiveRecord::RecordNotUnique. Additionally it adds one frontend fix and simplifies used presenter for CI::BuildMetadata.

In other words it fixes a regression introduced with !17221 (merged).

Are there points in the code the reviewer needs to double check?

Since this is a fix for a change, that was not released yet, I think it doesn't need a CHANGELOG entry.

Why was this MR needed?

Please read #44922 (closed) for a context.

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #44922 (closed)

Edited by Tomasz Maczukin

Merge request reports