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: Accept and minimally validate a "language" argument #27941

Merged
merged 1 commit into from
Feb 26, 2021

Conversation

apparentlymart
Copy link
Contributor

@apparentlymart apparentlymart commented Feb 26, 2021

We expect that in order to continue to evolve the language without breaking existing modules we will at some point need to have a way to mark when a particular module is expecting a newer interpretation of the language.

Although it's too early to do any deep preparation for that, this commit aims to proactively reserve an argument named "language" inside "terraform" blocks, which currently only accepts the keyword TF2021 that is intended to represent "the edition of the Terraform language as defined in 2021".

Since TF2021 represents the language as currently defined without setting language, in practice there's no real reason to set this today, but this minimal validation is intended to give better feedback to users of older Terraform versions in the event that we introduce a new language edition later and they try to use an module incompatible with their Terraform version. Specifically, it will recommend that they upgrade to a newer version rather than just reporting that the language argument isn't supported.


This is a v0.15 backport because this change will meet its goals best if it's included in as early a Terraform CLI release as possible, to minimize the number of pre-0.15 uses of Terraform still around at the point where we might introduce a new edition keyword.

We expect that in order to continue to evolve the language without
breaking existing modules we will at some point need to have a way to mark
when a particular module is expecting a newer interpretation of the
language.

Although it's too early to do any deep preparation for that, this commit
aims to proactively reserve an argument named "language" inside
"terraform" blocks, which currently only accepts the keyword TF2021 that
is intended to represent "the edition of the Terraform language as defined
in 2021".

That argument also defaults to TF2021 if not set, so in practice there's
no real reason to set this today, but this minimal validation today is
intended to give better feedback to users of older Terraform versions in
the event that we introduce a new language edition later and they try to
use an module incompatible with their Terraform version.
@codecov
Copy link

codecov bot commented Feb 26, 2021

Codecov Report

Merging #27941 (012cdb5) into main (6697245) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted Files Coverage Δ
configs/parser_config.go 87.91% <ø> (ø)
configs/experiments.go 79.31% <100.00%> (+6.58%) ⬆️
internal/providercache/dir.go 67.34% <0.00%> (-6.13%) ⬇️

@apparentlymart apparentlymart added the 0.15-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged label Feb 26, 2021
@ghost
Copy link

ghost commented Mar 29, 2021

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.

@ghost ghost locked as resolved and limited conversation to collaborators Mar 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
0.15-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged config enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants