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] Auto-install if a .tf file contains a Terraform required_version block #31

Open
skyzyx opened this issue Jan 5, 2024 · 8 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@skyzyx
Copy link

skyzyx commented Jan 5, 2024

Please replicate this feature from tfswitch. https://tfswitch.warrensbox.com/Quick-Start/#use-versiontf-file

@kvendingoldo
Copy link
Contributor

@skyzyx looks great! We'll take it to work

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

Hi, I am working on a a golang rewrite : https://github.com/dvaumoron/gotofuenv

The tofu proxy of gotofuenv default behaviour is latest-allowed, with a fallback to latest-stable if no required_version from .tf files are found.

I would appreciate a chat to pool our effort together...

@kvendingoldo
Copy link
Contributor

kvendingoldo commented Jan 11, 2024

Hi @dvaumoron. Your projects looks great. We had the same in our plans, because bash-based application is not a good idea for different operation systems. Some time ago we started to work on tenv (https://github.com/tofuutils/tenv) application that should be able to manage Terraform and OpenTofu versions. We kicked off it on golang and I think that it would be better to work on it together to reduce amount of Terraform/OpenTofu wrappers.

At this moment tenv is just a wrapper for tfenv and tofuenv, but we had in out plan to rewrite all logic into Golang.It would be fantastic if you'd contribute to 'tenv' instead of creating another wrapper. It will allow us to release a stable version of the 'tenv' utility more quickly.

Let's make a new generation of Terraform/OpenTofu version switcher based on Golang together.

@dvaumoron
Copy link

dvaumoron commented Jan 11, 2024

gotofuenv is functional (currently only tested on linux/amd64 with .deb installation or brew installation). That's not a wrapper but a pair of standalone executable (the tofu proxy and gotofuenv cli)

However it lack Terraform retrieval support, and adding a bunch of automated test would be great.

@kvendingoldo
Copy link
Contributor

kvendingoldo commented Jan 11, 2024

@dvaumoron tenv is also designed not as wrapper, but as a in-depended binary program for managing OpenTofu as well as Terraform.

For now I made a rough implementation that is a Golang wrapper under tfenv/tofuenv, but it was made to reduce release date. We are going to make tenv independent soon.

It would be good to merge your gotofuenv into tenv. By that OpenTofu/Terraform community have just a one tool in the near future to manage versions.

@dvaumoron
Copy link

I take a look on tenv, i am unsure about the best way to integrate my work in it

@dvaumoron
Copy link

dvaumoron commented Jan 11, 2024

If i separate my initCmds from main package of gotofuenv, it will be callable to be added as subcommand, but that's quick and dirty mode, it will leave duplication (your package to call github api does not work the same as mine) and inconsistencies (i do not use logrus for my display)

@kvendingoldo
Copy link
Contributor

kvendingoldo commented Jan 11, 2024

@dvaumoron it will be good for the beginning. In the future we can merge tenv and gotofuenv to one repository and you can take a lead under OpenTofu support in this tool.

Today we gonna post an initial design for main tenv methods, it probably can be a good for the future implementation.

Also, we can disscuss technical details like logrus / github package. It helps us to make our future repositories merge less painfull. I invite you to talk about all of this technical stuff inside of tenv repository.

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 help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants