Open vitorfhc opened 2 years ago
@vitorfhc I think this makes sense and is worth exploring
@vitorfhc spent some time looking into the feasibility of this and discovered that our source download functionality is handled by hashicorp/go-getter. Any updates to the behavior would have to be made there.
@tonerdo interesting point. But, isn't it possible to parse the url before using go-getter?
Example:
I use ref=v1.2.3
and since this is a valid SemVer with all parts specified I just pass it ahead.
But, if I use ref=1.2.x
we have a variant part which is the patch. Now we query that Git tags and find the latest tag, which x
is the higher number.
I don't believe this is all new feature, some tools already explored this. It's acting like a middleware between getting the source url and downloading the file.
What do you think?
Edit: hashicorp/go-version
I just use dependabot or renovate to help me keep module versions updated.
I just use dependabot or renovate to help me keep module versions updated.
Does it work nicely with terragrunt?
Yeah absolutely, or I wouldn't be here!
The problem
Keeping the latest version of anything is hard today. Terragrunt is no different.
Let's take this example:
Cool, we imported a module with its fixed version
v0.84.3
. But what if I want to easily update it? I would have to go to the code and bump it myself to another version. How can I automate that? I wish there was an easy way.Version constraints help with that. For example, on Terraform we could do
~>0.84
and it would always update the minor version on anyterraform init
. Would be nice to add this feature to Terragrunt.The proposal
How viable is it to make this feature in Terragrunt? I believe there are some ways we could implement that.
One idea would be that
~>0.84
would be equal to:I removed the patch version and now it always gets the latest patch from
v0.84
.I could also do:
And now we have the latest
v0.x.y
, never going above the major version, which translates to>= v0.0.0
and< v1.0.0
.This is just an idea and one way of implementing that. I would love it since I could automate easily these updates and guarantee the latest versions.