Skip to content

fix(build): make go mod tidy work on a fresh clone - #55

Closed
DoDiODev wants to merge 1 commit into
release-pr9088-basefrom
pr/gomod-mock-placeholders
Closed

DoDiODev wants to merge 1 commit into
release-pr9088-basefrom
pr/gomod-mock-placeholders

Conversation

@DoDiODev

Copy link
Copy Markdown
Owner

Fork-only CI verification for the upstream PR (refs apache#9088). Runs the unmodified upstream workflows against a copy of upstream/main. Will be closed after the run.

backend/mocks/ is git-ignored, but helpers/unithelper and 22 test files
import five of its packages. On a fresh clone those import paths do not
exist inside the main module, so go mod tidy tries to resolve them as
external modules and fails with "no matching versions for query latest".
This also keeps Dependabot's gomod updater from producing any update.

Track one doc.go placeholder (package mocks, no code) in each imported
mock package, so the paths resolve locally. The generated mocks stay
git-ignored, and make mock now removes only the generated files instead
of the whole directory.

Add a step to the unit-test workflow that runs go mod tidy on the fresh
checkout, before any mocks are generated, and fails on a diff. A new mock
import without a placeholder, or an untidy go.mod, is caught there.

Refs apache#9088
@DoDiODev
DoDiODev force-pushed the pr/gomod-mock-placeholders branch from a712067 to cf96ac5 Compare September 28, 2026 11:04
@DoDiODev

Copy link
Copy Markdown
Owner Author

CI verification done (9/9 green on cf96ac5).

@DoDiODev DoDiODev closed this Sep 28, 2026
@DoDiODev
DoDiODev deleted the pr/gomod-mock-placeholders branch October 4, 2026 18:18
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.

1 participant