:wave: I am trying to get adoption of Atlantis in ...
# atlantis-community
j
👋 I am trying to get adoption of Atlantis in my organization. I've got it set up, but there looks to be an issue with with the
undiverged
behavior that is preventing me from moving forward. An issue as in - it just flat doesn't work. This is pretty important functionality to have I would think as you can make some big mistakes by either seeing the wrong plan or your apply being destructive. I have the following requirements set in my repo config:
Copy code
plan_requirements: [undiverged]
apply_requirements: [approved, mergeable, undiverged]
import_requirements: [approved, mergeable, undiverged]
as I understand, the checkout strategy for
undiverged
also has to be set to
merge
, so I have changed that behavior as well:
Copy code
ATLANTIS_CHECKOUT_STRATEGY: merge
I am also using GitHub. In a PR that is behind the base branch (main), I type
atlantis plan
and the plan just plans when it shouldn't. It also applies when it shouldn't as well. There's no checking going on that the branch is dirty and needs to be rebased. To troubleshoot, I dug around github issues and found https://github.com/runatlantis/atlantis/issues/4051, which has a very similar issue that I am experiencing. They suggested it might be due to parallel planning/applying, so I also disabled any parallelization around those actions. Unfortunately, without success. I also found this thread here: https://atlantis-community.slack.com/archives/C5MGGAV0C/p1709226454828869, but there wasn't anything in here that I haven't already tried. Does this feature work at all?
👍 1
l
There was a bug in undiverged where it wasn't actually pulling in new refs that I fixed in https://github.com/runatlantis/atlantis/pull/3832, which I think got in 0.27.0
I hadn't seen 4051, let me take a look at that
j
Hi Luke. Interesting, I am on 0.27.0, but I still can't seem to get this to work.
Copy code
$ atlantis version
atlantis v0.27.0 (commit: bb08b7d) (build date: 2023-12-12T18:50:23.560Z)
l
yeah I'll poke at this when I get a chance in the next few days, it does seem like a similar bug
That said you're welcome to take a closer look too if you're able, it would be good to share notes!
a
Hello @Luke Massa @Joey McDaniel any update on this? how can I help?
j
No update from me. We've rolled Atlantis out in a minimum capacity and just have it available to a small set of people. I never got this working and have moved on to other projects though.
a
🥲 @lkysow any input on this?
l
ah sorry I lost track of this. I'll try to get to this in the next few days
OK so I'm looking at this and thinking it through, and I think the actual issue is in the notion of
undiverged
as a "plan requirement" at all
Undiverged "Prevent applies if there are any changes on the base branch since the most recent plan."
I can confirm this is happening
however, it's unclear to me what an
undiverged
plan requirement should do at all
If you use the
merge
strategy what happens is: 1. Cut
branch
from
main
2. Make a few commits to
branch
3. Push branch up, it runs a plan by creating
atlantis-merge
as an essentially "empty commit" on top of
branch
4. Move
main
forward one commit 5. Run
atlantis plan
again, it will create a new
atlantis-merge
commit as a merge of
main
and
branch
So it's true it bypasses
undiverged
, but I'm not actually sure what
undiverged
should mean at all if you have
merge
strategy, since it's doing what it's supposed to be doing and incorporating changes from main
So I think the correct thing to do in this situation is to disallow
undiverged
as a "plan requirement" and change the docs. Thoughts?
I made a comment on the PR. I'm happy to look into this because it's interesting to me and I know this section of the code now, just want to understand the use case better first