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

Resolve version correctly for backend schema #1453

Merged
merged 2 commits into from
Oct 10, 2023
Merged

Conversation

radeksimko
Copy link
Member

@radeksimko radeksimko commented Oct 10, 2023

This is to address:

Depends on:


This PR changes the meaning of the version in the snippet of code being changed. Previously it referred to the discovered/installed Terraform version, whether or not we had the schema for it. With this patch, the meaning changes to "language/schema version".

In practice though it remains the same for the likely majority of cases (any stable version between 0.12 and 1.6) but not for the other cases, where we fall back on either 0.12.0 or latest known version (currently 1.6.0).

Importantly, this does not impact the discovered/installed version we persist and make available, e.g. here

2023-10-10 11 26 34

Also, the new logic inside ResolveVersion reflects the way we handled various edge cases in the previous implementation, as shown in the attached test in hashicorp/terraform-schema#275

@radeksimko radeksimko added the bug Something isn't working label Oct 10, 2023
@radeksimko radeksimko changed the title F resolve version Resolve version correctly for backend schema Oct 10, 2023
@radeksimko radeksimko marked this pull request as ready for review October 10, 2023 10:33
@radeksimko radeksimko requested a review from a team as a code owner October 10, 2023 10:33
@radeksimko radeksimko self-assigned this Oct 10, 2023
Copy link
Member

@dbanck dbanck left a comment

Choose a reason for hiding this comment

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

I like this approach

@radeksimko radeksimko merged commit d7cd582 into main Oct 10, 2023
20 checks passed
@radeksimko radeksimko deleted the f-resolve-version branch October 10, 2023 11:31
Copy link

I'm going to lock this pull request 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 related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants