Skip to content

V2 YAML seeding

Dan Davison requested to merge dj-awesomeco-v2-yaml into master

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

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.

Edited by Dan Davison

Merge request reports

Loading