Police-Data-Accessibility-Project / data-sources-app

An API and UI for using and maintaining the Data Sources database
MIT License
2 stars 5 forks source link

Set up Prod/Stg/Sandbox environment setup #342

Open maxachis opened 3 months ago

maxachis commented 3 months ago

Discussed previously in #340, here is the implementation!

TODO

Optional/Debatable TODO

maxachis commented 3 months ago

automation.pdap.io now has two builds: One for Sandbox, and one for Stage. They should occur around the same time, but this allows us to be more flexible if we need to in the future.

Next up is the question of dummy data.

In some cases, we may not need any dummy data and can simply use data from the tables -- tables such as zip_codes and state_names don't contain any sensitive information, so we could just use those.

Then there are some cases where we simply don't need to include all that data -- for example, quick_search_query_logs, as previously discussed, has an oversized amount of content that we don't need and which will slow things down.

We also want to be mindful that our schemas will change, so the more dummy data we believe we should possess, the more dummy data to modify if we adjust our schemas.

Additionally, some newly-created tables, such as requests_v2, do not have any data at all, and adding some dummy data will help us test it out ahead of bringing it into production.

For now, I think we can get away with a handful of dummy data in sensitive tables such as users, access_tokens, session_tokens, and data_requests, empty tables such as requests_v2, and importing en-masse from other tables, while ignoring quick_search_query_logs.

maxachis commented 3 months ago

Scripts modified so that sandbox database has non-sensitive data added from production. Next up is dummy data.

Dummy Data TODO

maxachis commented 3 months ago

Additionally, in the course of developing this logic, I came to the conclusion that Python would be preferable to shell scripts, and made an issue accordingly.

maxachis commented 3 months ago

@josh-chamberlain I'll need to be made a member of the Notion workspace to add a "Testing" page with information on the Stage and Sandbox databases ⛑️

josh-chamberlain commented 3 months ago

Nice work! I like your optionals, too.