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

Ensure terraform_version is downloaded when using non built-in step. Fixes #675 #722

Merged
merged 1 commit into from
Aug 1, 2019

Conversation

maximede
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Jul 29, 2019

Codecov Report

Merging #722 into master will decrease coverage by 0.07%.
The diff coverage is 65.21%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #722      +/-   ##
==========================================
- Coverage   72.45%   72.37%   -0.08%     
==========================================
  Files          61       61              
  Lines        4679     4695      +16     
==========================================
+ Hits         3390     3398       +8     
- Misses       1039     1044       +5     
- Partials      250      253       +3
Impacted Files Coverage Δ
server/events/runtime/runtime.go 78.94% <ø> (ø) ⬆️
server/server.go 66.89% <100%> (+0.11%) ⬆️
server/events/runtime/run_step_runner.go 90% <60%> (-10%) ⬇️
server/events/terraform/terraform_client.go 78.06% <60%> (-0.98%) ⬇️

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 ba8f947...d6f2579. Read the comment docs.

@maximede maximede force-pushed the issue-675 branch 2 times, most recently from 5829859 to 6190d38 Compare July 30, 2019 18:50
@malnick malnick self-assigned this Aug 1, 2019
@malnick malnick self-requested a review August 1, 2019 18:31
@malnick
Copy link
Contributor

malnick commented Aug 1, 2019

Thanks @maximede, can you remove the binary that was committed here? We should add that to our .gitignore, simple easy to accidentally commit that.

@maximede
Copy link
Contributor Author

maximede commented Aug 1, 2019

Thanks @maximede, can you remove the binary that was committed here? We should add that to our .gitignore, simple easy to accidentally commit that.

Good catch, sorry I missed the file.
I added golangci-lint to gitignore

Copy link
Contributor

@malnick malnick left a comment

Choose a reason for hiding this comment

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

Thanks again, can you squash to a single commit before I merge?

@malnick malnick merged commit 5f9412b into runatlantis:master Aug 1, 2019
c.versionsLock.Lock()
_, err = ensureVersion(log, c.downloader, c.versions, v, c.binDir)
c.versionsLock.Unlock()
if err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

can just return err here


err := r.TerraformExecutor.EnsureVersion(ctx.Log, tfVersion)
if err != nil {
err = fmt.Errorf("%s: Downloading terraform Version %s", err, tfVersion.String())
Copy link
Member

Choose a reason for hiding this comment

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

Use errors.Wrapf, use all lowercase:

err = errors.Wrapf(err, "downloading terraform version %s", tfVersion.String()

err := r.TerraformExecutor.EnsureVersion(ctx.Log, tfVersion)
if err != nil {
err = fmt.Errorf("%s: Downloading terraform Version %s", err, tfVersion.String())
ctx.Log.Debug("error: %s", err)
Copy link
Member

Choose a reason for hiding this comment

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

I see that this is a Debug log below as well but I think this makes more sense as an Err log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants