Skip to content

Flush internal_id records on unique violations

Carla Drago requested to merge 352382-flush-records into master

What does this MR do and why?

This flushes relevant records from the internal_ids table when unique id violations are raised during ci pipeline creation. It fixes an issue with possible race conditions when resetting iid tracking after importing projects.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

This is tricky to validate as the error occurs due to a race condition.

One way to check the error is raised and the InternalId is flushed is to:

  1. In the rails console, manually added an InternalId with usage: "ci_pipelines" for an imported project that doesn't already have an internal_id
  2. In the UI run a pipeline in the project. It should failed with the error message added in this MR: image
  3. Re-run the pipeline. It should not fail this time.

Related to #352382 (closed)

Edited by Carla Drago

Merge request reports