https://www.runatlantis.io/ logo
Title
a

AaronC

03/13/2023, 5:29 PM
Hey folks - I seem to be having some issues with Gitlab and the
auto-planning
feature. I had this working previously but since I upgraded to the latest release it seems like no matter what I do the auto-plan is never triggered. I can see the
atlantis.yaml
file is being parsed correctly on each merge requests yet I constantly see the log message
0 projects are to be planned based on their when_modified config
I am sure I am missing something trivial here but the pathing is correct etc, so I don’t really know what else I should be toggling.
version: 3
automerge: true
delete_source_branch_on_merge: true
parallel_plan: true
parallel_apply: true
projects:
  - name: some-module
    dir: some/nested/path/some-module
    branch: /main/
    workflow: terragrunt
    delete_source_branch_on_merge: true
    repo_locking: true
    autoplan:
      when_modified:
        [
          "../../../../inputs/base/test/data.yaml",
        ]
      enabled: true
    apply_requirements: [mergeable, approved, undiverged]
    import_requirements: [mergeable, approved, undiverged]
Any help would be appreciated.
p

PePe Amengual

03/14/2023, 3:09 AM
in which version was this working for you with the same config?
if you just upgraded without touching anything it could be a bug in the new version
a

AaronC

03/14/2023, 1:19 PM
@PePe Amengual - I actually managed to track down the issue late last night. It seems like it may have just been awkward timing that I ran into this issue. But to answer your question yes nothing changed in the config. It actually turns out that It almost seems like a race condition. I built a custom version of
atlantis
with some extra debugging around the
GetModifiedFiles
function for Gitlab. It seems that it’s actually getting an empty slice of changes from Gitlab when it queries it immediately after the web-hook is triggered, all the other fields are in place but
Changes:[]
is empty. Which makes no sense because when I hit the exact same API call I see a list of changes. Just to prove this out in a brute force method I put a sleep inside the function to ensure Gitlab had fully updated everything before we ask for the changes, it has worked every single time after about 2 dozen tests.
It should also be mentioned that the Gitlab API you are currently calling has been deprecated.
p

PePe Amengual

03/14/2023, 4:20 PM
do you think you could create an issue with that information?
that way in case someone have time to update the api to solve the issue, they will have the information to do it
slack messages are not permanent (we are on a free version)
a

AaronC

03/14/2023, 5:02 PM
Yep no problem.
Just talking with Gitlab about this, It seems like a bug - But either way I will create an issue today
p

PePe Amengual

03/14/2023, 5:27 PM
a bug in gitlab or Atlantis or both?
a

AaronC

03/14/2023, 5:28 PM
I would say Gitlab, but it could also be corrected/checked on the Atlantis side. Once I get a valid response back from Gitlab I will include it in the Atlantis Gitlab issue.
p

PePe Amengual

03/14/2023, 5:29 PM
thanks a lot