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

Add ability to specify path to TF binary #109

Merged
merged 3 commits into from
May 21, 2020
Merged

Add ability to specify path to TF binary #109

merged 3 commits into from
May 21, 2020

Conversation

paultyng
Copy link
Contributor

No description provided.

@paultyng paultyng requested a review from radeksimko May 21, 2020 13:42
@paultyng paultyng linked an issue May 21, 2020 that may be closed by this pull request
@paultyng paultyng added this to the v0.3.0 milestone May 21, 2020
Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

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

I didn't test this manually (I trust you did 😄 ), but aside from the nitpicky comments left inline this LGTM 👍

langserver/langserver.go Outdated Show resolved Hide resolved
langserver/session/types.go Outdated Show resolved Hide resolved
langserver/handlers/service.go Outdated Show resolved Hide resolved
@paultyng
Copy link
Contributor Author

@radeksimko made the suggested adjustments, also added some testing of the path string to make sure its a bit more valid as discussed. I cleaned up a few of the other ui.Error calls in another commit as well just for consistency. Let me know if its still good to merge.

Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

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

As for the ui.Error calls - this was actually intentional, as I thought errors should have a blank line below them, to express the visual importance of the message. But I do see how it may look awkward with all these explicit \ns everywhere, so I don't have strong feelings about it.

Thank you for adding the validation logic 👍

I left just one comment, but it's not a blocker.

if stat.IsDir() {
c.Ui.Error(fmt.Sprintf("Expected a Terraform binary, got a directory: %q", path))
return 1
}
Copy link
Member

Choose a reason for hiding this comment

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

Total nitpick, but I assume the above lines could make a validateTfExecPath(string) error function.

@paultyng
Copy link
Contributor Author

The confusing part was they weren't on all errors just some errors, but if its the how it should be presented you could already create a fancy UI implementation that adds the separation.

I was hoping to maybe revisit/refactor this after the release anyway, clean up the hard coded exit codes and flag validation a bit. I'll just write an issue to do so if thats ok with you?

@ghost
Copy link

ghost commented Jun 20, 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 context necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Jun 20, 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.

Add ability to specify path to Terraform binary
2 participants