File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,20 +25,22 @@ jobs:
2525 run : |
2626 echo "ENVIRONMENT=${{ vars.PROD_MOBILITY_FEEDS_ENVIRONMENT }}" >> $GITHUB_ENV
2727 echo "PROJECT_ID=${{ vars.PROD_MOBILITY_FEEDS_PROJECT_ID }}" >> $GITHUB_ENV
28+ echo "REGION=${{ vars.MOBILITY_FEEDS_REGION }}" >> $GITHUB_ENV
2829 echo "DEPLOYER_SERVICE_ACCOUNT=${{ vars.PROD_MOBILITY_FEEDS_DEPLOYER_SERVICE_ACCOUNT }}" >> $GITHUB_ENV
30+ echo "TASKS_EXECUTOR_URL=https://${{ vars.MOBILITY_FEEDS_REGION }}-${{ vars.PROD_MOBILITY_FEEDS_PROJECT_ID }}.cloudfunctions.net/tasks_executor-${{ vars.PROD_MOBILITY_FEEDS_ENVIRONMENT }}" >> $GITHUB_ENV
2931
3032 # Schedule a task to update the validation report in 24 hours from now to allow runners of the web validator
3133 # to be properly updated with the new version of the GTFS Validator
3234 - name : Create task to run cloud function
3335 run : |
3436 gcloud tasks create-http-task \
35- --queue=update-validation-report-task -queue \
36- --url=https://${{ vars.MOBILITY_FEEDS_REGION }}-${PROJECT_ID}.cloudfunctions.net/update-validation-report \
37+ --queue=validator- update-trigger -queue \
38+ --url=${TASKS_EXECUTOR_URL} \
3739 --schedule-time=$(date -u -d "+24 hours" +%Y-%m-%dT%H:%M:%SZ) \
3840 --oidc-service-account-email=${DEPLOYER_SERVICE_ACCOUNT} \
39- --location=${{ vars.MOBILITY_FEEDS_REGION } } \
41+ --location=${REGION } \
4042 --header=Content-Type:application/json \
41- --body-content='{}'
43+ --body-content='{"task": "rebuild_missing_validation_reports", "payload": {"dry_run": false, "force_update": true} }'
4244 notify-slack-on-failure :
4345 needs : [ validator-update ]
4446 if : failure() && (github.event_name != 'workflow_dispatch')
Original file line number Diff line number Diff line change @@ -1333,6 +1333,10 @@ output "function_tokens_name" {
13331333 value = google_cloudfunctions2_function. tokens . name
13341334}
13351335
1336+ output "tasks_executor_url" {
1337+ value = google_cloudfunctions2_function. tasks_executor . url
1338+ }
1339+
13361340
13371341# Task queue to invoke refresh_materialized_view function
13381342resource "google_cloud_tasks_queue" "refresh_materialized_view_task_queue" {
@@ -1393,6 +1397,27 @@ resource "google_cloud_tasks_queue" "web_revalidation_task_queue" {
13931397 }
13941398}
13951399
1400+ # Task queue for the validator-update GitHub Action to schedule tasks_executor calls 24h ahead.
1401+ # Static name (new, never previously used) avoids GCP queue-name-reuse restrictions.
1402+ resource "google_cloud_tasks_queue" "validator_update_trigger_queue" {
1403+ project = var. project_id
1404+ location = var. gcp_region
1405+ name = " validator-update-trigger-queue"
1406+
1407+ rate_limits {
1408+ max_concurrent_dispatches = 50
1409+ max_dispatches_per_second = 1
1410+ }
1411+
1412+ retry_config {
1413+ # Retry for ~4 hour: 31 attempts × 120s fixed backoff
1414+ max_attempts = 124
1415+ min_backoff = " 120s"
1416+ max_backoff = " 120s"
1417+ max_doublings = 0
1418+ }
1419+ }
1420+
13961421# Task queue to invoke gbfs_validator_batch function for the scheduler
13971422resource "google_cloudfunctions2_function_iam_member" "gbfs_validator_batch_invoker" {
13981423 project = var. project_id
You can’t perform that action at this time.
0 commit comments