Skip to content

Factory

The Data Seeder uses what are called “Factories” to seed data.

What is a factory?

A factory is a FactoryBot definition that is housed in a file residing in spec/factories/*.rb, or ee/spec/factories/*.rb, or both.

Factory over API

The Data Seeder uses Factories for the purpose of speed. The Data Seeder uses FactoryBot which operates on the ORM level, which is the fastest method of data fabrication.

Additionally, the GitLab API does not provide a way to create data that happened in the past.

With the Data Seeder, you can create an issue that was opened 1 month ago, assigned 4 days ago, and closed 1 day ago.

Maintenance

The Data Seeder’s factories will never fall out of date.

GitLab Factories are maintained and used by GitLab regularly, meaning that any change in the back, will instantly be reflected in a seed file.