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

tools: remove mockery from tools.go #9196

Merged
merged 2 commits into from Aug 9, 2022
Merged

tools: remove mockery from tools.go #9196

merged 2 commits into from Aug 9, 2022

Conversation

williambanfield
Copy link
Contributor

@williambanfield williambanfield commented Aug 8, 2022

The mockery project recommends against using a binary of mockery that has been created using go install. vektra/mockery#456. Developers of Tendermint wishing to generate mocks should avoid having a version of mockery on their path that does not match the version listed in mockery_generate.sh. To make this easier for developers, the mockery_generate.sh script uses a containerized copy of mockery if mockery is not present on the developer's PATH. This containerized version of mockery uses the same version of mockery as our CI pipelines and allows all developers to automatically use the same version without having to manage it themselves.

PR checklist

  • Tests written/updated, or no tests needed
  • CHANGELOG_PENDING.md updated, or no changelog entry needed
  • Updated relevant documentation (docs/) and code comments, or no
    documentation updates needed

@williambanfield williambanfield changed the title workflow: update mockery version tools: remove mockery from tools.go Aug 8, 2022
@williambanfield williambanfield marked this pull request as ready for review August 8, 2022 18:43
@williambanfield williambanfield requested a review from a team August 8, 2022 18:43
@mark-rushakoff
Copy link
Contributor

At the end of the discussion at vektra/mockery#456, the core developer says he will continue to support go install.

Why not just keep the entry in tools.go and unconditionally call go run github.com/vektra/mockery from mockery_generate.sh? Now that go run supports modules, that will unambiguously run the correct version of mockery regardless of a version that may be on your path.

@williambanfield
Copy link
Contributor Author

williambanfield commented Aug 8, 2022

At the end of the discussion at vektra/mockery#456, the core developer says he will continue to support go install.

Why not just keep the entry in tools.go and unconditionally call go run github.com/vektra/mockery from mockery_generate.sh?

Yeah, I noticed that comment. They still recommend against relying on go install for running mockery. Their recommendation was based on not wanting to break users' workflows. If the mockery project updates the required Go version, this will break users' workflows that still use old versions of the Go tooling.

Frankly, I'm a bit ambivalent on the way of managing the mockery version. I would simply like us to have only one way of managing it. Beyond that, I could go either way. I usually keep my Go tooling near or at the latest version and I suspect many people do; however, using go install or go run to manage it means a mockery point release could cause our CI to break unexpectedly.

@williambanfield
Copy link
Contributor Author

@mark-rushakoff Switched to use the tools.go pattern.

@williambanfield williambanfield added the S:automerge Automatically merge PR when requirements pass label Aug 9, 2022
@mergify mergify bot merged commit 0bea064 into main Aug 9, 2022
@mergify mergify bot deleted the wb/update-mockery branch August 9, 2022 15:12
samricotta pushed a commit that referenced this pull request Aug 10, 2022
The `mockery` project recommends against using a binary of `mockery` that has been created using `go install`. vektra/mockery#456. Developers of Tendermint wishing to generate mocks should avoid having a version of `mockery` on their path that does not match the version listed in  [mockery_generate.sh](https://github.com/tendermint/tendermint/blob/10e1ac8feabd8ce7fd560ebecb11b929376fcb9c/scripts/mockery_generate.sh#L11). To make this easier for developers, the `mockery_generate.sh` script uses a containerized copy of `mockery` if `mockery` is not present on the developer's `PATH`. This containerized version of `mockery` uses the same version of mockery as our CI pipelines and allows all developers to automatically use the same version without having to manage it themselves. 

#### PR checklist

- [ ] Tests written/updated, or no tests needed
- [ ] `CHANGELOG_PENDING.md` updated, or no changelog entry needed
- [ ] Updated relevant documentation (`docs/`) and code comments, or no
      documentation updates needed
samricotta pushed a commit that referenced this pull request Aug 11, 2022
The `mockery` project recommends against using a binary of `mockery` that has been created using `go install`. vektra/mockery#456. Developers of Tendermint wishing to generate mocks should avoid having a version of `mockery` on their path that does not match the version listed in  [mockery_generate.sh](https://github.com/tendermint/tendermint/blob/10e1ac8feabd8ce7fd560ebecb11b929376fcb9c/scripts/mockery_generate.sh#L11). To make this easier for developers, the `mockery_generate.sh` script uses a containerized copy of `mockery` if `mockery` is not present on the developer's `PATH`. This containerized version of `mockery` uses the same version of mockery as our CI pipelines and allows all developers to automatically use the same version without having to manage it themselves. 

#### PR checklist

- [ ] Tests written/updated, or no tests needed
- [ ] `CHANGELOG_PENDING.md` updated, or no changelog entry needed
- [ ] Updated relevant documentation (`docs/`) and code comments, or no
      documentation updates needed
samricotta pushed a commit that referenced this pull request Aug 11, 2022
The `mockery` project recommends against using a binary of `mockery` that has been created using `go install`. vektra/mockery#456. Developers of Tendermint wishing to generate mocks should avoid having a version of `mockery` on their path that does not match the version listed in  [mockery_generate.sh](https://github.com/tendermint/tendermint/blob/10e1ac8feabd8ce7fd560ebecb11b929376fcb9c/scripts/mockery_generate.sh#L11). To make this easier for developers, the `mockery_generate.sh` script uses a containerized copy of `mockery` if `mockery` is not present on the developer's `PATH`. This containerized version of `mockery` uses the same version of mockery as our CI pipelines and allows all developers to automatically use the same version without having to manage it themselves. 

#### PR checklist

- [ ] Tests written/updated, or no tests needed
- [ ] `CHANGELOG_PENDING.md` updated, or no changelog entry needed
- [ ] Updated relevant documentation (`docs/`) and code comments, or no
      documentation updates needed
samricotta pushed a commit that referenced this pull request Aug 12, 2022
The `mockery` project recommends against using a binary of `mockery` that has been created using `go install`. vektra/mockery#456. Developers of Tendermint wishing to generate mocks should avoid having a version of `mockery` on their path that does not match the version listed in  [mockery_generate.sh](https://github.com/tendermint/tendermint/blob/10e1ac8feabd8ce7fd560ebecb11b929376fcb9c/scripts/mockery_generate.sh#L11). To make this easier for developers, the `mockery_generate.sh` script uses a containerized copy of `mockery` if `mockery` is not present on the developer's `PATH`. This containerized version of `mockery` uses the same version of mockery as our CI pipelines and allows all developers to automatically use the same version without having to manage it themselves. 

#### PR checklist

- [ ] Tests written/updated, or no tests needed
- [ ] `CHANGELOG_PENDING.md` updated, or no changelog entry needed
- [ ] Updated relevant documentation (`docs/`) and code comments, or no
      documentation updates needed
samricotta pushed a commit that referenced this pull request Aug 16, 2022
The `mockery` project recommends against using a binary of `mockery` that has been created using `go install`. vektra/mockery#456. Developers of Tendermint wishing to generate mocks should avoid having a version of `mockery` on their path that does not match the version listed in  [mockery_generate.sh](https://github.com/tendermint/tendermint/blob/10e1ac8feabd8ce7fd560ebecb11b929376fcb9c/scripts/mockery_generate.sh#L11). To make this easier for developers, the `mockery_generate.sh` script uses a containerized copy of `mockery` if `mockery` is not present on the developer's `PATH`. This containerized version of `mockery` uses the same version of mockery as our CI pipelines and allows all developers to automatically use the same version without having to manage it themselves.

- [ ] Tests written/updated, or no tests needed
- [ ] `CHANGELOG_PENDING.md` updated, or no changelog entry needed
- [ ] Updated relevant documentation (`docs/`) and code comments, or no
      documentation updates needed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S:automerge Automatically merge PR when requirements pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants