fix: add common variables to all functions#1676
Merged
Merged
Conversation
davidgamez
commented
Apr 29, 2026
| logging.info("Task already exists for %s, skipping.", task_name) | ||
| else: | ||
| logging.error("Error creating task: %s", e) | ||
| logging.error("response: %s", response) |
Member
Author
There was a problem hiding this comment.
In case of error, this log was throwing another error due to response variable not initialized
jcpitre
approved these changes
May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
PMTiles generation failed due to missing GCP_REGION and SERVICE_ACCOUNT_EMAIL environment variables, and an error was thrown inside a catch block. This PR ensures that
ENVIRONMENT,PROJECT_ID,GCP_REGION, andSERVICE_ACCOUNT_EMAILare present in all functions.[AI Comment]:
This pull request primarily standardizes and expands the environment variables passed to Google Cloud Functions in Terraform, ensuring consistency and adding missing variables. It also introduces a new utility script to automate the initialization of a local development environment. Additionally, there is a minor improvement to error handling in a Python utility.
Infrastructure improvements (Terraform environment variables):
ENVIRONMENT,PROJECT_ID,GCP_REGION,SERVICE_ACCOUNT_EMAIL) across all Google Cloud Functions in bothinfra/batch/main.tfandinfra/functions-python/main.tf, ensuring all functions have consistent access to deployment context. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14]Developer tooling:
scripts/init-local-folder.shto automate local environment setup, including database rebuilds, model and API stub generation, and function setup. This script supports an optional flag to populate the database with production data.Code quality and error handling:
api/src/shared/common/gcp_utils.pyby removing the unusedresponsevariable and its logging in the exception block ofcreate_http_task_with_name.Expected behavior:
The environment, project ID, service account, and region variables are present in all GCP functions. PMTiles works as expected
Testing tips:
[internal team]
Please make sure these boxes are checked before submitting your pull request - thanks!
./scripts/api-tests.shto make sure you didn't break anything