-
Notifications
You must be signed in to change notification settings - Fork 233
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
V2 DeprecationMessage missing configuration file and line context #660
Comments
I think what's happened here is that the new SDK is making a very fair assumption that I think the answer is "this is not what Sadly though, I believe that's not the specific provider's concern and the right thing to do here is remove that and accept |
@chrisarcand Yeah totally. I don't take issue with the addition of The only thing that is actually a problem for me is that the pointer to the configuration file and line context/number are gone. Without that, there's no way to tell what resource a warning is coming from. |
I agree with @chrisarcand's interpretation of this issue, I think. This isn't really the intended usage of But it shouldn't have lost its file/line context, and I think that is related to some diagnostics work we did in v2 of the SDK. There are a number of issues with diagnostics not retaining file/line numbers properly, and we just need to do a sweep to make sure they're getting bubbled up correctly everywhere. |
I've dug into this a bit more, and as far as I can tell, this is an upstream terraform issue. Have you seen it work with v1 and not with v2 using the same version of Terraform? Diagnostics are how we return error and warning information like this to Terraform, and they're getting populated (as you can see by the message appearing at all). They're not populating the The fact that the warning is showing up, therefore, leads me to believe we're doing everything necessary on the SDK side of the gRPC barrier. Terraform is where those errors get associated with config filenames and lines, and as far as I can tell, is where it's going awry. But poking around a bit, I'm seeing the code I would expect in the call to |
Absolutely! It definitely does warn even when users aren't using the
Yeah, when I first noticed this I did some testing to see if it was something I changed that broke things. I tested it with v1 (version 0.23.0 of the TFE provider) & Terraform 0.13.5 and it worked as expected. Then I tested it with v2 (this version of the TFE provider hasn't been released yet so I was working with a local build from master), still using Terraform 0.13.5 and saw the missing line number/file context. |
Incredibly bizarre! I'll poke at this some more and see if I can't track down what the heck happened here, because I'm not going to lie, I'm stumped. |
This is likely related to #696. |
I think #696 should have resolved this. If anyone is still running into it when using SDK 2.4.4 or higher, please let us know. :) |
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. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
SDK version
Relevant provider source code
TFE provider data source with a DeprecationMessage
Terraform Configuration Files
This uses a local build of the TFE provider because we haven't released the version with the V2 upgrade yet.
To see the expected behavior with V1 of the SDK, switch the provider version to 0.23.0.
Debug Output
Please let me know if you need this. I don't think this contains info that would help here but I'm not 100% sure.
Expected Behavior
Running
terraform plan
should have shown the deprecation message and the relevant configuration file and line context like it did in V1 of the SDK (which you can see by using v0.23.0 of the TFE provider)Actual Behavior
Running
terraform plan
showed the deprecation message but didn't include any information about the configuration file, line context, or which resource/data source it came from.Steps to Reproduce
terraform init
terraform plan
References
#561 seems similar but not exactly the same.
The text was updated successfully, but these errors were encountered: