runatlantis / atlantis

Terraform Pull Request Automation
https://www.runatlantis.io
Other
7.82k stars 1.06k forks source link

Feature: Priority Directories, Priority Plans #3241

Open natalysheinin opened 1 year ago

natalysheinin commented 1 year ago

Community Note


Describe the user story As a developer, I want to be able to create a PR that bootstraps a bunch of required infrastructure & targets changes across various directories (1+ statefiles). For a good UX, I want to guarantee that the atlantis workflow will help me succeed without the complexities of order of operations.

As an atlantis admin, I want to configure certain statefiles/directories to have priority such that in a single PR, atlantis ensures that a priority plan/apply workflow gets completed before others.

Describe the solution you'd like

Describe the drawbacks of your solution

Describe alternatives you've considered

1) Do this in 2 separate PRs - annoying UX 2) Consolidate state and use "depends_on"- breaks intended code organization of state file per team function / infrastructure function

jamengual commented 1 year ago

have you seen this? https://github.com/runatlantis/atlantis/pull/2146

natalysheinin commented 1 year ago

Related to: https://github.com/runatlantis/atlantis/issues/391

jamengual commented 1 year ago

@natalysheinin do you think that this : https://github.com/runatlantis/atlantis/pull/3292 could work for you?

vincentgna commented 1 year ago

As I'm working on this feature currently, I would like to propose the following functionality expanding #3292 depends_on functionality with a configurable behaviour:

  1. During plan, do not plan projects which have unapplied dependencies, update the commit status for these projects with a new state flag indicating "plan is pending"
  2. During apply, only apply planned projects
  3. (potentially automatically after apply?) Autoplan any dependant projects in "pending" state after apply run is complete
  4. Repeat until all projects impacted by a PR are in applied state (automerge PR when all planned projects are successfully applied)

I see a few concerns:

Without this built-in functionality within Atlantis, it is the "executor" that is responsible to orchestrate the plan/apply steps.

For example:

Refs:

aldojimenez commented 5 months ago

I'm currently in a situation where I have encountered this limitation with our Atlantis setup, in particular how to handle un-applied dependencies when first deploying new stacks. Wanted to check the current state of this feature.

jamengual commented 5 months ago

no one seems to be working on this, Atlantis is community driven mostly.

I will recommend checking the docs on execution_order_groups and other options that have been added.

On Fri, May 31, 2024, 1:20 a.m. Aldo Jimenez @.***> wrote:

I'm currently in a situation where I have encountered this limitation with our Atlantis setup, in particular how to handle un-applied dependencies when first deploying new stacks. Wanted to the current state of this feature.

— Reply to this email directly, view it on GitHub https://github.com/runatlantis/atlantis/issues/3241#issuecomment-2141461124, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQ3ERF7LKPYENHUK4AFGYTZFAXDPAVCNFSM6AAAAAAV6XKNKOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBRGQ3DCMJSGQ . You are receiving this because you commented.Message ID: @.***>