-
Notifications
You must be signed in to change notification settings - Fork 135
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
Treat schema availability as not essential #83
Comments
Should we just init with |
As per our offline discussion - I believe that:
|
I just noticed that this is also important for when the client for any reason triggers It will just |
Not sure, but this is possibly a duplicate of or at least related to #106 |
Hi, We aren't using And the settings |
Hi @devTechi Before asking question or filing an issue on the client side though, please note that the VSCode v2 extension was slimmed down in functionality with the aim of reimplementing it in the language server, so it's reusable across other IDEs too. This means that some of the old v1 settings may not be applicable/relevant, because the client doesn't contain the same functionality. If there's a particular functionality you miss from v1 I would encourage you to file an issue here. We can figure out what needs to be done on the server or client side.
The language server does and will depend on terraform for the foreseeable future as the CLI represents a stable consumable API from Terraform's perspective (unlike importing Go packages from the project, which is explicitly not supported). We plan to explore some ways of gathering data directly from the plugin/provider binaries in the future, so that might reduce the reliance on Terraform in some scenarios, but it's likely that you'd still need to get the provider binaries somehow to the local workstation and Pulling schema data from providers directly is essential for the language server to scale and work with any version of any provider and it also means we don't have to bundle schemas of 100+ popular providers with the language server in any way. With all that said I understand that initializing the backend(s) is an excessive requirement and it's something I'd like to address somehow. The main reason it's a requirement from Terraform's perspective is because it needs to read not only the config, but also the state, to understand which providers to initialize. In order to access the state, it needs to initialize the backend. In many/most language server scenarios though the user doesn't really care about the state (assuming it won't I do plan to close this issue when language server doesn't error out on missing schema, but we can create a separate one to track the backend initialization requirement? |
@devTechi is your issue with the repetitive download of providers? |
@radeksimko Downloading the providers is not an issue and could be manageable via settings (like a providers list or something). I am using AWS, archive, template and null in most cases. But AWS is the main provider I need. But I don't have access to the S3 statebucket at all. Just via pipelines. This is a customers requirement. This won't be changed. @FernandoMiguel That being said. For me this extension stopped working (besides the syntax highlighting). And thanks for the quick answer :) |
That is fair. To be clear while the Terraform CLI was designed to be stable as an API, it predates any language server, so it will likely need some tweaking along the way and we will work with the relevant team to tweak it accordingly.
Selecting, downloading and most importantly updating providers is actually quite a complex problem when done right (with verification, semver resolution etc.). More importantly that problem is already solved in the existing configuration and
That is a reasonable requirement and I wouldn't expect you (or your customer) to change that practice. I just think that the language server needs to have a way of accessing the schema without having to access the state. I'd like for that solution to live in Terraform itself (e.g. as a flag of I'm sorry it's not ideal experience right now, but I hope the explanation makes sense. |
but wouldnt an init without accessing the real state, and just download and init the providers locally achieve all that? |
@radeksimko Regarding |
your local terraform should be the same version as the pinned for your codebase/remotestate. do invest a week in upgrading to 0.12, before 0.11 is EOL. |
Why should it be the same? It wasn't the same before and it was no problem. Of course I had some issues with the changed coding styles and validation. But I knew that. And I have other projects where I have the latest Terraform version. So this is not the solution. |
i've migrated two orgs with very large code bases, and it took me less than a week on both. the benefits is that now you have a new TF with lots of bugs fixed, and allows you to use new features on your code like |
Thanks. I know TF 0.12 and know why I would upgrade |
I'm not sure if this is the correct place to comment or not. It has to do with no
In this case subproject one and two might have different providers. It would be nice for the language server to work up the folder tree for the currently editing file and find where its parent project providers are initialized for suggesting the appropriate autocompletes, etc. @radeksimko I have not read enough of the code and issues to know if this is not already the design goal, just wanted to throw out my use case. If it would be better as another issue, just let me know and I can create one. |
@danieladams456 This feedback is very useful - thank you! It would be even more useful under #32 (we are collating all the different hierarchies there) This issue will get closed probably much sooner, but only because "unsupported" hierarchies don't error anymore. #32 is about supporting more hierarchies. |
@radeksimko Perfect thanks! I'll copy/paste over there. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Current Version
Use-cases
Sometimes the user may open a directory which has not been
terraform init
d - which is then surfaced asinitialize
error and the server doesn't start at all as unavailability of schema is treated as essential for its functioning.We could still provide limited functionality that doesn't require schema - e.g. formatting and make schema watching/obtaining non-essential.
Proposal
Provide limited functionality if schema isn't available and inform the user of the limited functionality via diagnostics.
We should also figure out how/whether we can detect when user runs
terraform init
for the first time, so they don't have to reopen the whole folder/IDE after doing so. This practically depends on whether we can watch file/dir creations in a given path.References
#84
The text was updated successfully, but these errors were encountered: