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

Use SemVer matching constraints #1266

Conversation

scruplelesswizard
Copy link
Contributor

Use SemVer matching constraints to find the correct version of Terraform for non-explicit constraint patterns.

Fixes #1217

@scruplelesswizard scruplelesswizard marked this pull request as ready for review November 23, 2020 22:12
@scruplelesswizard
Copy link
Contributor Author

The contributing documentation doesn't explicitly cover vendoring. If you want changes on this PR's structure please let me know

@scruplelesswizard
Copy link
Contributor Author

scruplelesswizard commented Nov 23, 2020

@scruplelesswizard scruplelesswizard force-pushed the feature/fix-1217-use-semver-constraints branch from 4a68de9 to e272564 Compare November 23, 2020 23:54
@codecov
Copy link

codecov bot commented Nov 23, 2020

Codecov Report

Merging #1266 (32bff6c) into master (fe6dd45) will increase coverage by 0.14%.
The diff coverage is 91.30%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1266      +/-   ##
==========================================
+ Coverage   70.00%   70.15%   +0.14%     
==========================================
  Files          74       75       +1     
  Lines        5585     5596      +11     
==========================================
+ Hits         3910     3926      +16     
+ Misses       1312     1309       -3     
+ Partials      363      361       -2     
Impacted Files Coverage Δ
server/events/releases_lister.go 0.00% <0.00%> (ø)
server/events/project_command_builder.go 82.40% <100.00%> (+3.47%) ⬆️
server/server.go 62.06% <100.00%> (+0.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fe6dd45...32bff6c. Read the comment docs.

@scruplelesswizard scruplelesswizard force-pushed the feature/fix-1217-use-semver-constraints branch from 8d3d362 to 30badbe Compare December 15, 2020 01:14
@chenrui333
Copy link
Member

looks like you need to rebase a bit for your changes.

@scruplelesswizard scruplelesswizard force-pushed the feature/fix-1217-use-semver-constraints branch 2 times, most recently from e751c22 to b4b28a6 Compare December 15, 2020 02:34
@scruplelesswizard
Copy link
Contributor Author

Was missing upstream vendor changes, got them sorted. Sorry about the inconvenience, and thank you for taking a look!

@scruplelesswizard scruplelesswizard force-pushed the feature/fix-1217-use-semver-constraints branch from d814d41 to 7cfa7ea Compare January 15, 2021 21:17
Comment on lines +523 to +529
for _, version := range versions {
if constraints.Check(version) {
ctx.Log.Info("detected module requires version: %q", version)
return version
}

}
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't this change the implementation to basically allow more than just "=" version constraints? I don't think we want to just silently upgrade/downgrade the terraform version for a workspace based on the constraints.

Please tell me if im not understanding this correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nishkrishnan This allows for us to use any version constraints supported by Terraform (which follows the SemVer spec). The expected behaviour is that I can use any of the SemVer operators allowed by Terraform and that Atlantis will use the correct version based on the SemVer constraint.

If a user wants to use an explicit version they can do that by using the = operator. If they want to use the most recent patch version of 0.12 for example they could specify ~> 0.12.0. You can read more in my comment on the issue.

@nishkrishnan nishkrishnan added the waiting-on-response Waiting for a response from the user label Jan 28, 2021
@TiagoJMartins
Copy link

Any updates regarding this? Anything I can do to help?

@scruplelesswizard
Copy link
Contributor Author

@TiagoJMartins I am just waiting on review, though it looks like other PR's touching the same sections have landed so I have some rebasing to do here to bring this back into a mergable state. Hopefully I can devote some cycles to this in the next few days, but I am not sure I can free many up atm.

@scruplelesswizard scruplelesswizard deleted the feature/fix-1217-use-semver-constraints branch October 12, 2022 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-on-review Waiting for a review from a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow additional specifiers in terraform's required_version other than = e.g. ~> and >
4 participants