Skip to content

Atlantis tries to plan an empty directory when moving to contents to a different directory #5511

Open
@nitrocode

Description

@nitrocode

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Overview of the Issue

I noticed that when migrating files into a subdirectory such as parent/*.tf to parent/subdir/*tf, it will try to plan the empty parent/ dir even though there aren’t any matching *.tf files and fail to plan. Anyone know of a configuration fix for this or is this a bug?

To get around this, I’m thinking of updating the workflow to check if the directory is empty before the init workflow and if it is, just do an early exit 0

This issue makes refactoring more difficult.

Reproduction Steps

  1. Find a directory of terraform files e.g. parent/*.tf
  2. Create a new directory within that directory parent/subdir
  3. Move the contents of parent/*.tf to parent/subdir
  4. Create a PR

Atlantis will try to plan both parent/ and parent/subdir. The latter will succeed and the former will fail because there are no terraform files here.

Logs

Environment details

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions