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

chore(all) updated mockery to 2.49.0 #2173

Merged
merged 3 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ dir: "{{.InterfaceDir}}/mocks"
mockname: "{{.InterfaceNameCamel}}"
filename: "{{.InterfaceNameSnake}}.mock.go"
outpkg: "mocks"
resolve-type-alias: False # see https://vektra.github.io/mockery/latest/deprecations/#resolve-type-alias
abi87 marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This seems to me the bare minimum to appease the make generate command. However we should consider if we need to add

issue-845-fix: True # see https://vektra.github.io/mockery/latest/deprecations/#issue-845-fix

too

Copy link
Contributor

Choose a reason for hiding this comment

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

We don't have inpackage parameter I don't think we need fix for issue-845 ? The issue arises only when inpackage is set to true.

mockery ignored the outpkg: parameter if inpackage: was set to True

Copy link
Contributor

Choose a reason for hiding this comment

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

I ran make generate with this fix and it outputs multiple warnings that we should set the issue-845-fix to True. When I set that option the warnings went away so we probably should add that too?

issue-845-fix: True # see https://vektra.github.io/mockery/latest/deprecations/#issue-845-fix
Comment on lines +30 to +31
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Mockery version needs to be updated to v2.49.0

The verification shows that mockery is currently at v2.43.2 in build/tools/go.mod, but the PR objectives require updating to v2.49.0. While the configuration changes in .mockery.yaml are correct, the version upgrade is incomplete.

  • Update mockery version in build/tools/go.mod from v2.43.2 to v2.49.0
  • Update the version in the generate command in build/scripts/codegen.mk from @latest to @v2.49.0 to ensure consistent version usage
🔗 Analysis chain

LGTM! Configuration changes align with requirements.

The added configuration options properly address:

  1. Disabling type alias resolution as required
  2. Fixing issue-845 warnings during mock generation

Let's verify the mockery version upgrade:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify mockery version in go.mod and that mock generation works

# Check mockery version in go.mod
rg -A 1 "github.com/vektra/mockery/v2" go.mod

# Verify mock generation works without warnings
make generate-check 2>&1 | rg -i "warning|error"

Length of output: 138


Script:

#!/bin/bash
# Let's try different approaches to verify mockery version and configuration

# 1. Look for go.mod in any subdirectory
fd -t f "go.mod$"

# 2. Look for mockery binary version in Makefile or similar files
fd -t f "(Makefile|\.mk)$" --exec grep -l "mockery"

# 3. Check if there's a tools.go or similar that might specify mockery version
fd -t f "tools\.go$"

# 4. Look for any mockery-related files
fd -t f "mock.*\.go$"

Length of output: 1987


Script:

#!/bin/bash
# Let's check the tools.go and codegen.mk files for mockery version

# Check tools.go for mockery version
cat build/tools/tools.go

# Check codegen.mk for mockery-related commands
cat build/scripts/codegen.mk

# Check tools/go.mod for mockery version
cat build/tools/go.mod | grep -A 1 "github.com/vektra/mockery"

Length of output: 2749

packages:
github.com/berachain/beacon-kit/mod/execution/pkg/client/ethclient:
config:
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mod/node-api/backend/mocks/availability_store.mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mod/node-api/backend/mocks/beacon_block_header.mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mod/node-api/backend/mocks/beacon_state.mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mod/node-api/backend/mocks/block_store.mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mod/node-api/backend/mocks/deposit_store.mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mod/node-api/backend/mocks/node.mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mod/node-api/backend/mocks/state_processor.mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mod/node-api/backend/mocks/storage_backend.mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mod/node-api/backend/mocks/validator.mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mod/node-api/backend/mocks/withdrawal.mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mod/node-core/pkg/services/registry/mocks/basic.mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mod/primitives/pkg/crypto/mocks/bls_signer.mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mod/storage/pkg/interfaces/mocks/db.mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mod/storage/pkg/pruner/mocks/beacon_block.mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mod/storage/pkg/pruner/mocks/block_event.mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mod/storage/pkg/pruner/mocks/prunable.mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mod/storage/pkg/pruner/mocks/pruner.mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading