Skip to content

atlantis_plan_all

Functions for applying atlantis changes.

atlantis_plan(state, max_plans)

Comments atlantis plan on all PRs where plans are failed or do not exist.

Source code in dapla_team_cli/pr/atlantis_plan/atlantis_plan_all.py
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
@batch_handler
def atlantis_plan(state: State, max_plans: int) -> None:
    """Comments atlantis plan on all PRs where plans are failed or do not exist."""
    print("[magenta]Probing succeeded workflows and plans for repositories..")
    probe_workflows(state)
    commented_plans = 0

    print("\n\n[cyan]Commenting 'atlantis plan' in unplanned repositories")
    for repo in state.repos.values():
        if commented_plans >= max_plans:
            print("[blue]Max plans reached, stopping")
            break

        if _do_atlantis_plan(repo):
            commented_plans += 1