Stack locking doesn't support Atlantis-style apply before merge workflow
If you’re implementing an apply-before-merge workflow with Spacelift, you quickly notice that multiple open PRs from different people can quickly cause issues from stepping on toes (i.e., PR A apply reverts changes from PR B because A and B are simultaneously testing changes).
An obvious potential solution to this is to use stack locking, but this has some big drawbacks. First, if the stack lock is owned by a pull request ID, then no humans can modify it. Second, if the stack has autodeploy disabled, then no human can confirm an unconfirmed run.
It would be nice if Spacelift offered a variation of stack locking that could support this use case, or shared an opinionated workflow for how to faciliate quick testing of Terraform changes.
- Problem
Log in to comment and vote
Comments4
Black Breeze
May 8, 2025
Thanks for raising this! To understand better: what’s the real job you’re trying to do with apply-before-merge? Are you hitting actual collisions in Terraform state, or looking for a faster feedback loop before merge? Curious what’s not working in your current setup, and what progress would look like.