-
Notifications
You must be signed in to change notification settings - Fork 324
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
terraform idiomatic files don't work with aqua (.terraform-version
)
#3311
Comments
oh awesome, looks like you have talked about this: |
idk how I feel about asdf-hashicorp supporting ASDF_HASHICORP_TERRAFORM_VERSION_FILE as a way to customize the list behavior. That wouldn't even work with mise very well since mise caches the results of Looking at souregraph this does not appear to be a commonly used configuration. I'm inclined to say we should not support that feature. |
Ha, I actually just came here to ask about this. I've ignored it for ages and finally got to the point where it's being a nuisance in my daily work.
It would be cool to support this, but I'm sure it isn't trivial. EDIT: |
well right now with the aqua backend it isn't going to look for this file at all, so you at least won't see that error |
So I'm not sure if aqua supports .terraform-version.
mise doesn't execute aqua. mise just uses aqua-registry. About expr, the expression used in registry.yaml for Terraform is very simple. version_constraint: semver(">= 1.0.2") |
sorry I think my question got a bit complex. Let me simplify—you got most of it right but a couple of things I think got confused. My main question is whether or not you plan to support However if you were planning to support That's why I brought up expr, because I think it could be a solution for that. We could have these properties in the registry for idiomatic files in registry.yaml used by both mise and aqua: idiomatic_file_names: [".terraform-versions"] # equivalent of https://github.com/asdf-community/asdf-hashicorp/blob/master/bin/list-legacy-filenames
idiomatic_parse: |
body | trimPrefix "^" Anyhow, I think the right plan for mise right now is to implement this logic inside of mise and not in the registry, however if and when you do want to come up with a way to implement this in the aqua registry that would be my proposal for it. Also for what it's worth, mise never supported semver versions in |
Ah, I see. Thank you for your explanation! |
this is a problem for all aqua tools I'm surprised nobody has reported but I just realized it. I haven't actually tested this but I don't see why it wouldn't be the case knowing how things work. aqua has no support for idiomatic files like
.terraform-version
and I don't even know if that's something aqua would be interested in adding. I'm calling out terraform here because it's probably the most popular tool that I know uses idiomatic files.In the meantime if you want this, just install the asdf plugin manually, disable the aqua backend, or alias terraform to
asdf:https://github.com/asdf-community/asdf-hashicorp
.(the rest of this is addressed to @suzuki-shunsuke specifically)
these files sometimes are just parsed as raw versions, e.g.:
.node-version
can just be20.0.0
but in the case of terraform, the logic is fairly complex: https://github.com/asdf-community/asdf-hashicorp/blob/master/bin/parse-legacy-fileI don't know if you've considered supporting files like this. I know in asdf they called them "legacy version files" which to me implies that they didn't want people to use them. I think they're great though and I know users are quite fond of them since it allows project maintainers to not specify what tool manager their developers use. I think this is a feature in mise that certainly has been good for my project.
I think to support this we could add a field to specify the names of the files, then an optional field using expr to parse the files like this:
I had to build a rust version of expr which wasn't easy and only partially complete but it's complete enough that this shouldn't be that hard to support if this were available.
anyhow lmk. I think if you aren't interested I'll probably need to either fork the aqua registry or maintain this information inside the mise codebase somehow, either is fine but not as ideal.
The text was updated successfully, but these errors were encountered: