Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

follow symlinks for path_relative_to_include #1550

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Patricol
Copy link

Closes #543

My use case involves wanting to prefix terragrunt dirs with numbers to make the stage order obvious, generate state keys based on path to ensure uniqueness, and use a fair number of terraform_remote_state objects.

Reordering or inserting stages is a time-consuming process involving moving many different state files, adjusting terraform_remote_state objects, and renaming folders.

Also, cding isn't as frictionless as it could be; with the extra often 0-padded prefixes.

Creating numbered symlinks to the terragrunt dirs (but having terragrunt ignore those symlinks) would be an ideal solution.

Things to consider:

  • I think path_relative_to_include should take a boolean argument if possible; defaulting to the old behavior but allowing the use of this behavior.
  • Should this be done for path_relative_from_include too?
  • Haven't yet tested. Especially if not implementing the bool toggle; need to see how this behaves when a relative include path is valid from one but not both of the real and symlinked directories.
  • Is it alright that this runs filepath.Clean on the path too?

@Patricol
Copy link
Author

@brikis98 @yorinasub17

Happy to work on this more if I get confirmation that the 'help wanted' tag on #543 is still accurate. (Maybe after >2 years the change is no longer desired?)

@brikis98
Copy link
Member

@Patricol Sorry for the delay. We are super, super buried right now. The PR is very much appreciated and we'll review it as soon as we can!

@brikis98
Copy link
Member

Thanks for the PR and your patience as we got around to reviewing it!

Things to consider:

  • I think path_relative_to_include should take a boolean argument if possible; defaulting to the old behavior but allowing the use of this behavior.

Unless you know of a specific use case where the current approach would break as a result, I'd rather avoid extra flags / branches.

  • Should this be done for path_relative_from_include too?

Yes, probably.

  • Is it alright that this runs filepath.Clean on the path too?

Sure.

Note that for symlinks to work, we may also need to solve #1611.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

path_relative_to_include and symlinks
2 participants