V2 YAML seeding
What does this MR do and why?
The second iteration for the AwesomeCo Demo Data Seeder -
To make the seeder more usable, especially for those not familiar with ruby, a YAML format has been devised to allow seeding.
This YAML format is a 1:1 translation of what can be passed into FactoryBot.
Example
seed.yaml.erb
labels:
- name: Test
color: "#FFFFFF"
# will produce: FactoryBot.create(:label, name: 'Test', color: '#FFFFFF')
issues:
- name: Issue
description: |
# This is markdown
traits:
- confidential
# will produce: FactoryBot.create(:issue, :confidential, name: 'Issue', description: '# This is markdown')
Closes [V2] => Create a developer friendly version of ... (#361997 - closed)
Next Steps
- [V2] =>Extend YAML parsing to allow variable re... (#390598 - closed)
- Define "beautiful data" => Define ideal user st... (#373741 - closed)
- [V2] => Add documentation for Seeding harness (#361988 - closed)
How to set up and validate locally
Seed Test Data
Running the command below will seed:
- 4 Priority Labels
- 6 Squad Labels
- 8 Priority Labels
- 8 Workflow Labels
- 2 Version Labels
- 4 Capability Labels
- 4 Component Labels
- 4 Effort Labels
- 4 Group Milestones
$ bundle exec rake "ee:gitlab:seed:awesome_co[awesome_co.yml.erb,1]"
Run Tests
$ bundle exec rspec ee/spec/db/seeds/awesome_co/awesome_co_spec.rb
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Dan Davison