Commit 028990cb authored by Stan Hu's avatar Stan Hu

Ensure NPM dev fixtures have unique name

NPM package names must be unique across a namespace. Previously the
development seed would fail if 2 of the 5 random projects selected to be
seeded were in the same group because the same package name would be
reused to seed the second project. To fix this, we append a random hex
string so that this conflict is unlikely to happen.

Closes https://gitlab.com/gitlab-org/gitlab/-/issues/213786
parent 0534e35b
# frozen_string_literal: true
class Gitlab::Seeder::Packages
attr_reader :project
......@@ -12,7 +13,7 @@ class Gitlab::Seeder::Packages
def seed_npm_packages
5.times do |i|
name = "@#{@project.root_namespace.path}/npm_package_#{i}"
name = "@#{@project.root_namespace.path}/npm_package_#{SecureRandom.hex}"
version = "1.12.#{i}"
params = JSON.parse(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment