-
Notifications
You must be signed in to change notification settings - Fork 357
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
Allow version constraints in plugin version
#1181
Comments
TFLint plugins are sourced from GitHub releases. So this is definitely possible by paginating through releases until a match is found if a range is provided, rather than getting a specific tag. https://github.com/terraform-linters/tflint/blob/master/plugin/install.go |
Support for latest will come at the same time as ranges I think. We don't want to be steering the bulk of users towards |
version
Thank you for your feedback. I understand the desire to always use the latest plugin version. The reason why I didn't adopt version constraints is that I couldn't be sure if the TFLint plugin ecosystem would require constraints. In Terraform, each module can declare its own constraints and must select a version that takes them into consideration, so version constraints are important. However, TFLint does not have such a situation. Also, if we adopt version constraints or the Due to such issues, I started offering the tflint-bundle image. Does this help solve the problem? |
Renovate might: https://docs.renovatebot.com/modules/datasource/ We might be able to write a Renovate preset that handles this for TFLint plugins. Constraints allow some flexibility without turning everyone to |
I didn't think there was a reasonable reason to allow version constraints on the plugin block, but there may be cases like #1217. If you share a config file with many workspaces, you may want to use different plugin versions for each workspace. In this case, it makes sense to allow version constraints in the config file. However, this may be an advanced use case, and I'm not sure if there really is such a requirement. Either way, support for this requires hacks to avoid rate limiting and lock file design. |
This seems like the most promising direction for automated version updates: https://docs.renovatebot.com/getting-started/use-cases/#custom-dependency-extraction Renovate can use GitHub tags/releases as a data source. It can be told how to parse the config file. Assuming this can be done with just config, it could be made into a preset and shared. |
To the original question, here's my updated thoughts:
Omitting version is not equivalent to latest, it means any. Only if no match is found locally will the latest be downloaded to fulfill the requirement. If you run TFLint on disposable machines, you would always get the latest plugin version. If you run on a computer with permanent storage, you will never get new versions after the initial This is fairly close to how Terraform works. |
don't think that's a problem since that's the requested behavior
agreed, let's just support grabbing the latest plugin version with: |
Using the latest version is inherently unpredictable, but Terraform allows it anyway. It's not necessarily a good idea but at most the software will print a warning. If you are able to explicitly specify Again there's a clear example to follow from Terraform, where the default behavior is the latter (cache heavy) but you can |
Ok so I don't mind working on this a bit. As described above this would work like Terraform, minus constraints.
Upgrades will ignore all specific versions. |
Are tflint plugins initialized often enough in the same environment for that to matter? Seems fine |
Another issue when the In my experience, this non-deterministic behavior is fatal and I believe it is not useful in many environments, but if there are use cases where this is useful, I think it's not a bad idea to implement a feature like #1181 (comment)
I'm interested in this question. Is your use case like this?
If so, Could you resolve it by providing a command like |
Renovate now supports TFLint plugins. |
Hi!
I just saw the warning regarding the aws bundled plugin deprecation and I started my migration to the
.tflint.hcl
way of defining plugins. I was surprised to find versioning implemented in a very strict way.There is no support for setting
latest
or using something like>= 0.3
. Dependabot does not supporttflint
, so this will lead to a lot of manual version bumping. I, like a lot of other users, want to always run with the latest and full ruleset available.Any chance
tflint
can get full versioning support, just like Terraform has? If not, any chance for alatest
version as a workaround?The text was updated successfully, but these errors were encountered: