Skip to content

Commit

Permalink
ci: fix infinite loop edge case bug in deploy script (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-butler-irl authored May 16, 2024
1 parent e086005 commit c6b7313
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions stackDeploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -848,15 +848,12 @@ def main() -> None:

if parallel:
# All configs with state_code awaiting_validation can be validated
deployed_configs = []
error_occurred = False
while len(deployed_configs) < len(config_ids) and not error_occurred:
while config_ids and not error_occurred:
ready_to_deploy = []
# identify all configs that can be deployed
for config in config_ids:
# skip already deployed configs
if config in deployed_configs:
continue
config_name = get_config_name(project_id, list(config.values())[0]['config_id'])

try:
Expand All @@ -868,6 +865,7 @@ def main() -> None:

current_state = get_config_state(project_id, list(config.values())[0]['config_id'])
if current_state == State.DEPLOYED:
config_ids.remove(config)
continue

logging.info(f"Checking for config {config_name} ID: {list(config.values())[0]['config_id']} "
Expand Down Expand Up @@ -912,8 +910,7 @@ def main() -> None:
error_messages.append(str(future.exception()))
error_occurred = True
break
else:
deployed_configs.append(future.result())

else:
for config in config_ids:
try:
Expand Down

0 comments on commit c6b7313

Please sign in to comment.