ShelterTechSF / askdarcel-api

Backend of the "Ask Darcel" app.
GNU General Public License v3.0
8 stars 24 forks source link

Decouple Dev/Staging/Test environments from main Airtable #499

Open drcaramelsyrup opened 4 years ago

drcaramelsyrup commented 4 years ago

Currently we have a working Airtable integration in our API that pushes SFSG organization data to Airtable courtesy of Max in this PR. However, we're seeing issues where Dev, Test, and Staging environments that people work on can also push changes to that Airtable, not just Prod.

This task is to decouple Dev/Staging/Test environments from main airtable:

  1. First, create three spare tables on Airtable for Dev, Staging, and Test.
  2. Then, link Dev, Staging, and Test ENVs to their respective separate tables.

Afterwards, we should re-upload Org Names, IDs, & Statuses from our Prod DB to Airtable to overwrite changes previously made by testing/dev/staging envs. (This can be a separate Github issue.)

Clubhouse story link: https://app.clubhouse.io/sheltertech/story/491/create-api-link-our-db-airtable Our Airtable's generated API: https://airtable.com/appItSYNzRjTx08hN/api/docs#curl/introduction Link to Airtable itself (sign in with tools@sheltertech.org): https://airtable.com/tblGTFGqrwXZ7ZWxB/viwGQIyXbg722yoic?blocks=hide

walt-r commented 4 years ago

So far, I've created a new base in airtable that is a copy of the "AskDarcel / SF Service Guide Data" base. The new one is called "[Dev] AskDarcel / SF Service Guide Data". This new base has the same tables, but currently none of the data. New link: https://airtable.com/tblgVTZueuwP8UKrT/viwNFgLzbO9PWeTHX?blocks=hide

Adding this new base to the environment config file could set up local development to hit this dev base/table instead of production. config/initializers/airrecord_airtable_api.rb

walt-r commented 4 years ago

What I don't see is how to change config/initializers/airrecord_airtable_api.rb only for dev and not for production.

drcaramelsyrup commented 4 years ago

@Maxastuart do you have any immediate insight into this?