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

[tfswitch-parity] Support version ranges defined in terragrunt.hcl #27

Closed
kvendingoldo opened this issue Jan 24, 2024 · 4 comments
Closed
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@kvendingoldo
Copy link
Collaborator

Describe the solution you'd like
Please replicate this feature from tfswitch. https://tfswitch.warrensbox.com/Quick-Start/#use-terragrunthcl-file

Additional context
It's backport of the original issue from tofuenv: tofuutils/tofuenv#33
cc @skyzyx

@kvendingoldo kvendingoldo added enhancement New feature or request good first issue Good for newcomers labels Jan 24, 2024
@dvaumoron
Copy link
Contributor

Does not seem complicated to do (there is already hcl parsing for .tf files), what should be the prioritiy order ? I suggest forcing env var , then version files (.opentofu-version or .terraform-version), then terragrunt.hcl file, and last scanning for .tf files

I want to underline that if we continue to add support for more ways to choose a version to use, the priority rules should be clearly indicated by the documentation.

@dvaumoron dvaumoron self-assigned this Jan 25, 2024
dvaumoron added a commit that referenced this issue Jan 25, 2024
@dvaumoron
Copy link
Contributor

dvaumoron commented Jan 25, 2024

Change done, however the code in semantic.go is not very readable, i will think about a way to refactor it.

dvaumoron added a commit that referenced this issue Jan 25, 2024
dvaumoron added a commit that referenced this issue Jan 25, 2024
dvaumoron added a commit that referenced this issue Jan 25, 2024
dvaumoron added a commit that referenced this issue Jan 25, 2024
@dvaumoron
Copy link
Contributor

I think that's better. Any remark ?

@kvendingoldo
Copy link
Collaborator Author

@dvaumoron I think so! Great!

dvaumoron added a commit that referenced this issue Feb 23, 2024
dvaumoron added a commit that referenced this issue Feb 23, 2024
dvaumoron added a commit that referenced this issue Feb 23, 2024
dvaumoron added a commit that referenced this issue Feb 23, 2024
dvaumoron added a commit that referenced this issue Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants