Skip to content

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

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

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.

@klesh

klesh commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Thanks for working on this! #9088 was fixed by #9179: main now tracks only doc.go placeholders under backend/mocks, so go mod tidy works on a fresh clone without committing the generated mocks. Closing as superseded.

@klesh klesh closed this Nov 10, 2026
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

2 participants