Fix composer package seeder using the seeder as the project

What does this MR do and why

The seed bound project to the seeder itself and threw away the project the helper returns:

project = Gitlab::Seeder::ComposerPackages.new(organization: organization)
project.create_real_project!(path)

Gitlab::Seeder::ComposerPackages defines organization, group, user and create_real_project!, and has no superclass. The later lines call project.repository and project.owner, which the seeder does not respond to, so seeding raises NoMethodError.

create_real_project! also returns nil on the failure path, after printing the model errors. Simply reassigning would trade a NoMethodError on the seeder for a NoMethodError on nil whenever an import fails, so this MR skips the iteration in that case.

How to verify

Read the seeder class: the four methods above are all it has, and none of them is repository or owner. The nil return is on the branch that prints project.errors.full_messages.

Spotted by itaruby(to be released), a Ruby type checker I'm working on.

Merge request reports

Loading
Loading