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

configs: deprecate version argument inside provider configuration blocks #26135

Merged
merged 3 commits into from Sep 8, 2020

Conversation

mildwonkey
Copy link
Contributor

The version argument is deprecated in Terraform v0.14 in favor of
required_providers and will be removed in a future version of terraform
(expected to be v0.15). The provider configuration documentation already
discourages use of 'version' inside provider configuration blocks, so it
only needed an extra note that it is actively deprecated.

I took advantage of an existing test, TestProviderReservedNames in provider_test.go, to verify the diagnostic, instead of writing a test just for this. That felt ok to do since we'll be removing it all in v0.15 (probably).

The version argument is deprecated in Terraform v0.14 in favor of
required_providers and will be removed in a future version of terraform
(expected to be v0.15). The provider configuration documentation already
discourages use of 'version' inside provider configuration blocks, so it
only needed an extra note that it is actively deprecated.
@@ -83,13 +83,12 @@ func testNestedModuleConfigFromDir(t *testing.T, path string) (*Config, hcl.Diag

parser := NewParser(nil)
mod, diags := parser.LoadConfigDir(path)
assertNoDiagnostics(t, diags)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a little odd: It doesn't really make sense for a helper to call another helper, or to bail out early instead of letting the caller decide what to do with diagnostics.

There are also only 2 tests using this code, which I eyeballed, and I think I wrote this anyway so it was probably a thoughtless copy-pasta.

@mildwonkey mildwonkey requested a review from a team September 4, 2020 18:47
@mildwonkey
Copy link
Contributor Author

(fixing failing test now)

@codecov
Copy link

codecov bot commented Sep 4, 2020

Codecov Report

Merging #26135 into master will decrease coverage by 0.02%.
The diff coverage is 20.68%.

Impacted Files Coverage Δ
terraform/graph.go 80.76% <0.00%> (-14.89%) ⬇️
terraform/graph_walk.go 14.28% <0.00%> (-23.22%) ⬇️
terraform/graph_walk_context.go 77.50% <0.00%> (-16.44%) ⬇️
configs/provider.go 83.18% <100.00%> (+0.94%) ⬆️

Copy link
Member

@alisdair alisdair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@mildwonkey mildwonkey merged commit 923e157 into master Sep 8, 2020
@mildwonkey mildwonkey deleted the mildwonkey/deprecate-providerconfig-version branch September 8, 2020 12:19
bflad added a commit to hashicorp/terraform-provider-aws that referenced this pull request Sep 8, 2020
bflad added a commit to hashicorp/terraform-provider-aws that referenced this pull request Sep 17, 2020
@ghost
Copy link

ghost commented Oct 13, 2020

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.

@hashicorp hashicorp locked as resolved and limited conversation to collaborators Oct 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants