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

CLOUDP-126655: golangci-lint isn't properly installed by Makefile #1334

Merged
merged 9 commits into from
Jun 29, 2022

Conversation

fmenezes
Copy link
Collaborator

@fmenezes fmenezes commented Jun 27, 2022

Proposed changes

golangci-lint isn't properly installed by Makefile, this PR changes the install location to be $GOPATH/bin instead of /path/to/mongodb-atlas-cli/bin and adds it to $PATH when running commands.

Jira ticket: CLOUDP-126655

Closes #[issue number]

Checklist

  • I have signed the MongoDB CLA
  • I have added tests that prove my fix is effective or that my feature works
  • I have added any necessary documentation in document requirements section listed in CONTRIBUTING.md (if appropriate)
  • I have addressed the @mongodb/docs-cloud-team comments (if appropriate)
  • I have updated test/README.md (if an e2e test has been added)
  • I have run make fmt and formatted my code

Further comments

This PR changes:

  • the installation directory of golangci-lint to be in GOPATH (go env GOPATH) which makes it globally available
  • added missing tool into make setup (github.com/google/go-licenses)
  • made GOPATH consistent across all tasks in evergreen

@fmenezes fmenezes marked this pull request as ready for review June 27, 2022 16:35
@fmenezes fmenezes requested a review from a team June 27, 2022 16:35
tibulca
tibulca previously approved these changes Jun 27, 2022
Copy link
Collaborator

@gssbzn gssbzn left a comment

Choose a reason for hiding this comment

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

The main reason why requesting changes is that then projects that have different versions will clash with it each other, see terraform which is a couple of version behind

Also tho has gotten better support installing from source is not recommended by the golangci-lint project, there are known issues

Finally the problem here is not an installation issue but a PATH export issue which only happens in mac

@gssbzn
Copy link
Collaborator

gssbzn commented Jun 28, 2022

@fmenezes
Copy link
Collaborator Author

@gssbzn I've replicated the change you've mentioned

@fmenezes fmenezes requested a review from gssbzn June 28, 2022 10:49
gssbzn
gssbzn previously approved these changes Jun 28, 2022
Copy link
Collaborator

@gssbzn gssbzn left a comment

Choose a reason for hiding this comment

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

LGTM

@fmenezes fmenezes requested review from gssbzn and removed request for tibulca June 28, 2022 10:58
@fmenezes
Copy link
Collaborator Author

@gssbzn sorry, one more, I've realized we were missing one tool

@fmenezes fmenezes removed the request for review from gssbzn June 28, 2022 11:27
@fmenezes fmenezes requested a review from gssbzn June 29, 2022 09:49
Copy link
Collaborator

@gssbzn gssbzn left a comment

Choose a reason for hiding this comment

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

LGTM good work with this one, specially the windows checks

.PHONY: setup
setup: deps setupgolangcilint ## Set up dev env
.PHONY: devtools
devtools: ## Install dev tools
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@gssbzn I'm not too sure we need to change anything since make setup is still available.

I've only added make devtools as separated target because evergreen would benefit from it.

@fmenezes fmenezes merged commit 992d11c into master Jun 29, 2022
@fmenezes fmenezes deleted the CLOUDP-126655 branch June 29, 2022 15:26
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