Skip to content

Conversation

@bschaatsbergen
Copy link
Member

@bschaatsbergen bschaatsbergen commented Sep 19, 2025

No description provided.

@bschaatsbergen bschaatsbergen changed the title [WIP] Add atlantis cancel command to cancel queued operations feat: add atlantis cancel command to cancel queued operations Sep 20, 2025
@ramonvermeulen ramonvermeulen force-pushed the f/atlantis-cancel branch 3 times, most recently from 1f281de to 8a53e95 Compare October 13, 2025 13:30
bschaatsbergen and others added 24 commits October 13, 2025 15:30
Signed-off-by: Bruno Schaatsbergen <[email protected]>
Signed-off-by: Ramon Vermeulen <[email protected]>
…5677)

Signed-off-by: Ryan Barry <[email protected]>
Co-authored-by: PePe Amengual <[email protected]>
Signed-off-by: Ramon Vermeulen <[email protected]>
Signed-off-by: PePe Amengual <[email protected]>
Signed-off-by: Ramon Vermeulen <[email protected]>
…s#5679)

Signed-off-by: Rui Chen <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Rui Chen <[email protected]>
Signed-off-by: Ramon Vermeulen <[email protected]>
…#5659)

Signed-off-by: Moritz Wirth <[email protected]>
Signed-off-by: Bruno Schaatsbergen <[email protected]>
Signed-off-by: Moritz Wirth <[email protected]>
Signed-off-by: PePe Amengual <[email protected]>
Signed-off-by: Ryan Barry <[email protected]>
Signed-off-by: Rui Chen <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Bruno Schaatsbergen <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: PePe Amengual <[email protected]>
Co-authored-by: Ryan Barry <[email protected]>
Co-authored-by: Rui Chen <[email protected]>
Signed-off-by: Ramon Vermeulen <[email protected]>
…est to a871848 in .github/workflows/test.yml (main) (runatlantis#5642)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Ramon Vermeulen <[email protected]>
…t to e8a84ee in go.mod (main) (runatlantis#5646)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Ramon Vermeulen <[email protected]>
…unatlantis#5654)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Ramon Vermeulen <[email protected]>
…ockerfile (main) (runatlantis#5698)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Ramon Vermeulen <[email protected]>
…3.0 [security] (main) (runatlantis#5664)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Ramon Vermeulen <[email protected]>
…workflows/testing-env-image.yml (main) (runatlantis#5700)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Ramon Vermeulen <[email protected]>
…ub/workflows/atlantis-image.yml (main) (runatlantis#5701)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Ramon Vermeulen <[email protected]>
… to b434c2f in dockerfile.dev (main) (runatlantis#5702)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Ramon Vermeulen <[email protected]>
…est to 143a71d in .github/workflows/test.yml (main) (runatlantis#5703)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Ramon Vermeulen <[email protected]>
…kflows/website.yml (main) (runatlantis#5706)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Ramon Vermeulen <[email protected]>
…est to 725981e in .github/workflows/test.yml (main) (runatlantis#5712)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Ramon Vermeulen <[email protected]>
renovate bot and others added 21 commits October 13, 2025 15:30
…unatlantis#5864)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Ramon Vermeulen <[email protected]>
…/workflows/scorecard.yml (main) (runatlantis#5865)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Ramon Vermeulen <[email protected]>
Signed-off-by: Luke Massa <[email protected]>
Co-authored-by: Rui Chen <[email protected]>
Signed-off-by: Ramon Vermeulen <[email protected]>
Signed-off-by: Luke Massa <[email protected]>
Co-authored-by: Luke Massa <[email protected]>
Co-authored-by: Rui Chen <[email protected]>
Signed-off-by: Ramon Vermeulen <[email protected]>
runatlantis#5872)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Ramon Vermeulen <[email protected]>
…ockerfile (main) (runatlantis#5873)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Ramon Vermeulen <[email protected]>
Signed-off-by: Luke Massa <[email protected]>
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Ramon Vermeulen <[email protected]>
…/workflows/codeql.yml (main) (runatlantis#5876)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Ramon Vermeulen <[email protected]>
…/workflows/codeql.yml (main) (runatlantis#5878)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Ramon Vermeulen <[email protected]>
Signed-off-by: Gabriel Martinez <[email protected]>
Signed-off-by: Ramon Vermeulen <[email protected]>
…er-compose.yml (main) (runatlantis#5882)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Ramon Vermeulen <[email protected]>
…/workflows/scorecard.yml (main) (runatlantis#5883)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Ramon Vermeulen <[email protected]>
Signed-off-by: Ramon Vermeulen <[email protected]>
…tests

This was a small side effect from moving from 1 to two methods.
Originally this check was already done beforehand because it was an
apart method for parallel as well as sequential.

Signed-off-by: Ramon Vermeulen <[email protected]>
Refactor towards package methods (in `project_command_pool_executor.go`)
to make the implementation more DRY. In essence the code patterns
between the plan and apply command runner seems to be exactly the same.

Signed-off-by: Ramon Vermeulen <[email protected]>
@ramonvermeulen ramonvermeulen force-pushed the f/atlantis-cancel branch 2 times, most recently from c85d1d1 to 4149364 Compare October 13, 2025 13:38
@ramonvermeulen
Copy link

Did some manual testing for this:

Cancelling a plan

Used atlantis.yaml configuration:

version: 3
automerge: true
parallel_plan: false
parallel_apply: false
projects:
  - name: atlantis-test-suite-a
    dir: .
    workspace: default-a
    terraform_version: v1.12.2
    autoplan:
      when_modified: ["*.tf"]
      enabled: true
  - name: atlantis-test-suite-b
    dir: .
    workspace: default-b
    terraform_version: v1.12.2
    autoplan:
      when_modified: ["*.tf"]
      enabled: true
  - name: atlantis-test-suite-c
    dir: .
    workspace: default-c
    terraform_version: v1.12.2
    autoplan:
      when_modified: ["*.tf"]
      enabled: true
  - name: atlantis-test-suite-d
    dir: .
    workspace: default-d
    terraform_version: v1.12.2
    autoplan:
      when_modified: ["*.tf"]
      enabled: true
  - name: atlantis-test-suite-e
    dir: .
    workspace: default-e
    terraform_version: v1.12.2
    autoplan:
      when_modified: ["*.tf"]
      enabled: true
image

Cancelling a running apply

Used the same atlantis.yaml configuration, used the time provider for a random sleep during apply:

provider "random" {}
provider "time" {}

resource "time_sleep" "wait_30_seconds" {
  depends_on = [random_password.password]

  create_duration = "30s"
}

resource "random_password" "password" {
  length           = 26
  special          = true
  override_special = "!#$%&*()-_=+[]{}<>:?"
}

output "random_password" {
  value     = random_password.password.bcrypt_hash
  sensitive = true
}

I commented atlantis cancel during the execution of project atlantis-test-suite-c.

image

Cancel with execution order groups during apply

I used the following atlantis.yaml configuration:

version: 3
automerge: true
parallel_plan: false
parallel_apply: true
projects:
  - name: atlantis-test-suite-a
    dir: .
    workspace: default-a
    terraform_version: v1.12.2
    autoplan:
      when_modified: ["*.tf"]
      enabled: true
    execution_order_group: 1
  - name: atlantis-test-suite-b
    dir: .
    workspace: default-b
    terraform_version: v1.12.2
    autoplan:
      when_modified: ["*.tf"]
      enabled: true
    execution_order_group: 1
  - name: atlantis-test-suite-c
    dir: .
    workspace: default-c
    terraform_version: v1.12.2
    autoplan:
      when_modified: ["*.tf"]
      enabled: true
    execution_order_group: 2
  - name: atlantis-test-suite-d
    dir: .
    workspace: default-d
    terraform_version: v1.12.2
    autoplan:
      when_modified: ["*.tf"]
      enabled: true
    execution_order_group: 2
  - name: atlantis-test-suite-e
    dir: .
    workspace: default-e
    terraform_version: v1.12.2
    autoplan:
      when_modified: ["*.tf"]
      enabled: true
    execution_order_group: 3

I did an atlantis apply directly followed by an atlantis cancel resulting in only the first execution order group (containing atlantis-test-suite-a and atlantis-test-suite-b) to finish. The rest got cancelled.

image

And another example where I commented atlantis cancel during the execution of the 2nd order group so only the last (3rd) did not get applied:

image

Signed-off-by: Ramon Vermeulen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.