-
-
Notifications
You must be signed in to change notification settings - Fork 477
Data Setup
compwron edited this page Sep 21, 2022
·
1 revision
For CASA, afterparty tasks SHOULD run in production. Seed should NOT run in production.
afterparty tasks are run:
- once in qa (until we delete the db... which has happened and will probably happen again, but which I would rather not do in general)
- once in staging (until we delete the db... which has happened and will probably happen again, but which I would rather not do in general)
- once in PROD!
- on every new developer's laptop! (maybe more than once if a developer deletes their database sometimes- which happens often)
Purposes of afterparty tasks:
- If data needs to be updated in prod in a way not accomplishable via the UI, afterparty tasks with tests are hugely preferable to me updating data in prod by hand in rails console.
- afterparty tasks, just like rails migrations, provide a record of what we did and why
- maybe something else that doesn't come to mind right now?
Mechanics of afterparty tasks: heroku runs the Procfile when deploying. the procfile includes a call to afterparty. afterparty writes a record to a table in the database recording which tasks it has run (just like migrations)
Seed is run:
rake db:seed
rake db:seed:replant
- manually on a developer machine to get a little data so viewing the UI locally makes sense
- manually on QA so there are convenient accounts to log in with for testing features from newly merged code
- manually on staging to produce a whole bunch of data so we can give realistic tours to new users, and also find performance problems
- NOT on prod!
Seed is for: Making data like casa orgs, contact types, volunteers, supervisors, casa_admins, and the data they need to use the system realistically (i.e. data which, in prod, an all_casa_admin or a casa_admin would create/import)