Skip to content

fix(build): commit generated mocks so fresh clones work with plain Go tooling - #9128

Open
bujjibabukatta wants to merge 1 commit into
apache:mainfrom
bujjibabukatta:fix/9088
Open

fix(build): commit generated mocks so fresh clones work with plain Go tooling#9128
bujjibabukatta wants to merge 1 commit into
apache:mainfrom
bujjibabukatta:fix/9088

Conversation

@bujjibabukatta

Copy link
Copy Markdown
Contributor

Closes: #9088

Summary

backend/mocks/ is gitignored but imported by tracked source code
(helpers/unithelper) and test files (helpers/pluginhelper/api).
On a fresh clone this breaks go mod tidy, go build ./..., IDE
tooling, and Dependabot's gomod ecosystem.

Root Cause

The mocks are generated via mockery but never committed. Since
helpers/unithelper imports them directly (not as test-only code),
Go can't find these packages on a clean checkout and tries to fetch
them as external modules, which fails.

Fix

  • Removed backend/mocks/ from .gitignore.
  • Committed the generated mock files (make mock, mockery v3.7.4).
    No changes to go.mod/go.sum.
  • Added a CI step to run make mock and diff against the committed
    mocks, so they can't silently go stale.

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.

[Bug][Build] go mod tidy fails on a fresh clone because backend/mocks/ is gitignored but imported by tracked sources

1 participant