Skip to content

atlantis_apply_all

Functions for applying atlantis changes.

atlantis_apply(state, max_apply)

Comments atlantis apply on all uncommented and open PRs.

Source code in dapla_team_cli/pr/atlantis_apply/atlantis_apply_all.py
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
@batch_handler
def atlantis_apply(state: State, max_apply: int) -> None:  # noqa: 3901
    """Comments atlantis apply on all uncommented and open PRs."""
    print("[magenta]Probing succeeded workflows and plans for repositories..")
    probe_workflows(state)

    answer = questionary.confirm("Do you want to proceed with 'atlantis apply'?").ask()
    if not answer:
        sys.exit(1)

    current_apply = 0
    print("\n\n[cyan]Commenting 'atlantis apply' in repositories")
    for repo in state.repos.values():
        if current_apply >= max_apply:
            print("[blue]Max applies commented, stopping")
            break

        print(f"[bold magenta]{repo.name}")
        if _do_atlantis_apply(repo):
            current_apply += 1