MobilityData / mobility-feed-api

Apache License 2.0
9 stars 4 forks source link

fix: trigger downstream tasks when a new feed is added #815

Closed cka-y closed 1 week ago

cka-y commented 1 week ago

Summary: This pull request introduces updates to enhance logging, authentication, and error handling in api/src/scripts/load_dataset_on_create.py and related files.

Issue Explanation:

Several issues were identified and addressed in this update:

  1. Lack of Confirmation for Message Publishing: Previously, we did not wait for confirmation of message publication to Pub/Sub topic, which led to silent failures. This issue went unnoticed after moving the database instance from DEV to QA, as logs did not indicate the failure caused by a permission error.
  2. Misconfigured Project ID and Pub/Sub Topic: After fixing the permission issue, I discovered that the project_id and pubsub_topic_name were incorrectly set. These variables were initialized at a high level in the script before the environment file was fully loaded, resulting in attempts to publish to the default (dev) topic instead of the QA topic or PROD topic.

Testing Instructions:

To test the updates:

Please make sure these boxes are checked before submitting your pull request - thanks!