thoughtbot / parity

Shell commands for development, staging, and production parity for Heroku apps
https://thoughtbot.com
MIT License
889 stars 57 forks source link

What to use when 'development' means development in Heroku pipeline #183

Closed danielmcquillen closed 4 years ago

danielmcquillen commented 4 years ago

Sorry if this is obvious and I'm just missing it!

'development' seems reserved for the local database. How would you configure parity if one wants development restore-from production to copy the heroku production database to the heroku development server in a pipeline and something like local restore-from production to copy it to the local db.

I imagine defining 'local' and 'development' in the database.yml is a step in that direction, but then confused as to how I'd invoke parity on the command line if the first term is an (arbitrary) name like 'local' defined in the database.yml.

Many thanks for the helpful tool!

geoffharcourt commented 4 years ago

Hi!

Heroku strongly advises against putting production data in review application databases (I think you're talking about review apps when you're talking about development servers?).

Copying full database contents to a Review apps is not currently supported. Copying production data to test apps means risk of data leaks or other programming mistakes operating on recent customer data. Instead, we recommend seeding databases comprehensively with non-production data using seed scripts run with the postdeploy command.

I think if your PR apps were named using the deterministic naming structure (note: not the default in the new pipelines, but configurable) that you could leverage the pr_app command to restore a production backup. Something like this:

pr_app myapp-staging-pr-1234 restore-from production

If there's a gap here and there's a PR to make the Backup or Environment class facilitate a staging restore to a PR app database I'd be very happy to review a PR.

danielmcquillen commented 4 years ago

@geoffharcourt Thanks for the quick response. Aha. I guess you're right, I'm trying to bend parity to do something I probs shouldn't. I'll close the issue. Thanks again.