Eliminate the root cause of duplicate npm packages
🔥 Context
At this moment it's possible to have duplicate npm packages when creating them.
A root cause of the issue could be a race condition.
🚒 Solution
We have to change the way we create a new npm package.
Helpful links on how to simulate a parallel execution:
- with a rake task !75483 (merged)
- with a spec https://gitlab.com/gitlab-org/gitlab/-/blob/bbc951b36f29668d2a3ab4de5c5f6f1910ef44d7/spec/models/container_repository_spec.rb#L1122-1150
More details could be found here
Edited by Dzmitry (Dima) Meshcharakou