Add AwesomeCo demo data harness and AwesomeSoft company with seeded data using FactoryBot
Problem to Solve
Today, Demos of GitLab are given to clients by Solution Architects. These Demos are shown by creating projects in a SaaS. SAs flush the demo environment. The biggest challenge is maintainability.
We need a convenient way to create Demo Data that is time-relevant (Current / Expired / Future milestones, due dates, etc.).
Proposal
We can re-use the Factories already provided by the GitLab source to spin up Demo Data for local GDK instances, GitLab Docker installations, staging environments and potentially even Production environments.
V1
- Create a Rake task that can be invoked in local GDK instances or Docker installations
- Create a Ruby seed file that calls FactoryBot that will create seeds.
Example
# create a group, project and issue.
create(:group, name: 'My Group', ...).tap do |group|
create(:project, :public, name: 'My Project', namespace: group).tap do |project|
create(:issue, title: 'My Issue', project: project, weight: 5)
end
end
V2
Create a more scalable seeding solution by allowing the formatting of seed files to be YAML files. "The YAML level of abstraction is going to be what is adopted by the SAs.
Example
# pseudo
---
# AwesomeCo Seed File
name: AwesomeCo
version: 1
namespace: AwesomeCo
group_labels:
# Priority Labels
- name: priority1
group: {{ namespace }}
title: 'priority::1'
color: '#FF0000'
- name: priority2
group: {{ namespace }}
title: 'priority::2'
color: '#DD0000'
- name: priority3
group: {{ namespace }}
title: 'priority::3'
color: '#CC0000'
- name: priority4
group: {{ namespace }}
title: 'priority::4'
color: '#CC1111'
# Squad Labels
- name: squad_A
group: {{ namespace }}
title: 'squad::a'
color: '#CCCCCC'
- name: squad_B
group: {{ namespace }}
title: 'squad::b'
color: '#CCCCCC'
- name: squad_C
group: {{ namespace }}
title: 'squad::c'
color: '#CCCCCC'
- name: squad_D
group: {{ namespace }}
title: 'squad::d'
color: '#CCCCCC'
- name: squad_E
group: {{ namespace }}
title: 'squad::e'
color: '#CCCCCC'
- name: squad_F
group: {{ namespace }}
title: 'squad::f'
color: '#CCCCCC'
milestones:
# Past Release
- title: 'Release #1'
group: {{ namespace }}
start_date: {{ 1.month.ago }}
due_date: {{ 1.day.ago }}
traits:
- on_group
# Current Ongoing Release
- title: 'Release #2'
group: {{ namespace }}
start_date: {{ 1.month.ago }}
due_date: {{ 1.day.ago }}
traits:
- on_group
# Past Release
- title: 'Release #3'
group: {{ namespace }}
start_date: {{ 1.month.ago }}
due_date: {{ 1.day.ago }}
traits:
- on_group
# Future Release
- title: 'Release #4'
group: {{ namespace }}
start_date: {{ 1.month.ago }}
due_date: {{ 1.day.ago }}
traits:
- on_group
epics:
- title: 'v1.0 Launch [XL]'
description: |
# MVC
A user can create an account, login and modify their settings
# Stand up infra
- [ ] Standup infra `10`
- [x] Task
- [ ] Key Result
- [ ] Task 2
- [ ] Task 3
Edited by Dan Davison