File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -861,8 +861,6 @@ jobs:
861861 remove_env_vars+=("STRATEGY_PLUGIN_ALERT_TELEGRAM_BODY_MAX_CHARS")
862862 fi
863863
864- remove_env_vars+=("MONITOR_DISPATCH_TARGETS_JSON" "LONGBRIDGE_MONITOR_DISPATCH_TARGETS_JSON")
865-
866864 gcloud_args=(
867865 run services update "${CLOUD_RUN_SERVICE}"
868866 --region "${CLOUD_RUN_REGION}"
@@ -1315,6 +1313,8 @@ jobs:
13151313 or scheduler.get("location")
13161314 or target.get("region")
13171315 or target.get("cloud_run_region")
1316+ or os.environ.get("CLOUD_SCHEDULER_LOCATION")
1317+ or os.environ.get("CLOUD_RUN_REGION")
13181318 or ""
13191319 ).strip()
13201320 if service_name:
Original file line number Diff line number Diff line change @@ -13,10 +13,21 @@ def test_replacement_probe_and_precheck_exist_before_shared_dispatcher_cleanup()
1313 assert precheck < cleanup_job < cleanup
1414
1515 cleanup_section = workflow [cleanup_job :]
16+ sync_section = workflow [:cleanup_job ]
1617 assert "needs: sync" in cleanup_section
1718 assert "environment: longbridge-sg" in cleanup_section
1819 assert 'replacement_jobs=("${service_name}-probe-scheduler" "${service_name}-precheck-scheduler")' in cleanup_section
1920 assert "if: steps.replacements.outputs.ready == 'true'" in cleanup_section
21+ assert "MONITOR_DISPATCH_TARGETS_JSON" not in sync_section
22+ assert "LONGBRIDGE_MONITOR_DISPATCH_TARGETS_JSON" not in sync_section
23+
24+
25+ def test_replacement_verifier_falls_back_to_global_scheduler_location () -> None :
26+ workflow = Path (".github/workflows/sync-cloud-run-env.yml" ).read_text (encoding = "utf-8" )
27+ cleanup_section = workflow [workflow .index ("cleanup-shared-monitor:" ) :]
28+
29+ assert 'or os.environ.get("CLOUD_SCHEDULER_LOCATION")' in cleanup_section
30+ assert 'or os.environ.get("CLOUD_RUN_REGION")' in cleanup_section
2031
2132
2233def test_existing_scheduler_cron_rejects_ambiguous_day_fields () -> None :
Original file line number Diff line number Diff line change @@ -209,7 +209,6 @@ grep -Fq 'join_by_delimiter()' "$workflow_file"
209209grep -Fq ' gcloud_args+=(--remove-secrets "$(IFS=,; echo "${remove_secret_vars[*]}")")' " $workflow_file "
210210grep -Fq ' gcloud_args+=(--update-secrets "$(IFS=,; echo "${secret_pairs[*]}")")' " $workflow_file "
211211grep -Fq -- ' --update-env-vars "^|^$(join_by_delimiter "|" "${env_pairs[@]}")"' " $workflow_file "
212- grep -Fq ' remove_env_vars+=("MONITOR_DISPATCH_TARGETS_JSON" "LONGBRIDGE_MONITOR_DISPATCH_TARGETS_JSON")' " $workflow_file "
213212grep -Fq ' Sync Cloud Scheduler schedule' " $workflow_file "
214213grep -Fq ' scheduler_location="${CLOUD_SCHEDULER_LOCATION:-${CLOUD_RUN_REGION}}"' " $workflow_file "
215214grep -Fq ' target_env = target.get("env") or {}' " $workflow_file "
You can’t perform that action at this time.
0 commit comments