In Cloud Functions…
we will maintain 2 deployed versions, hip-log-bot-cf for production and hip-log-bot-cf-test for testing
In Firestore…
we will maintain two versions, which are implemented as two separate collections, Users for production and UsersTest for testing. These will be configured 1:1 with the corresponding Cloud Function
In Dialogflow… we only get one Agent per project so we when we want to test from DialogFlow or Messenger, we will toggle the setting (”fulfillment webhook url”)

cd to the source code folder hip-log-bot-cloud-function/src/gcloud functions deploy hip-log-bot-cf-test \
--gen2 \
--runtime=python311 \
--region=us-central1 \
--source=. \
--entry-point=main \
--trigger-http \
--allow-unauthenticated \
--set-env-vars FIRESTORE_COLLECTION_NAME=UsersTest,ENVIRONMENT=test
It’s the same steps as above, but with these changes:
hip-log-bot-cf-test > hip-log-bot-cf)UsersTest > Users)local > production)gcloud functions deploy hip-log-bot-cf \
--gen2 \
--runtime=python311 \
--region=us-central1 \
--source=. \
--entry-point=main \
--trigger-http \
--allow-unauthenticated \
--set-env-vars FIRESTORE_COLLECTION_NAME=Users,ENVIRONMENT=production
FIRESTORE_COLLECTION_NAME to configure the deployed instance with the database-collection (eg a prod vs test one) in HipLogDB::__init__