Skip to content
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
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
run: make lint

# ---------------------------------------------------------------------------
# TIDY (module files + BUILD files in sync)
# TIDY (module files + BUILD files + mocks in sync)
# ---------------------------------------------------------------------------
tidy:
name: Tidy
Expand All @@ -67,6 +67,9 @@ jobs:
- name: Check BUILD files are up to date
run: make check-gazelle

- name: Check mocks are up to date
run: make check-mocks

# ---------------------------------------------------------------------------
# BUILD AND UNIT TESTS (parallel jobs, separate Bazel caches)
# ---------------------------------------------------------------------------
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -631,9 +631,12 @@ GO_GENERATE_PACKAGES := \
./submitqueue/gateway/extension/storage/... \
./submitqueue/orchestrator/extension/storage/...

mocks: ## Generate mock files using mockgen
mocks: ## Generate mock files using the pinned mockgen
@echo "Generating mocks..."
@$(BAZEL) run @rules_go//go -- generate $(GO_GENERATE_PACKAGES)
@$(BAZEL) build @org_uber_go_mock//mockgen
@mkdir -p bin/mockgen
@cp -f "$$($(BAZEL) cquery --output=files @org_uber_go_mock//mockgen 2>/dev/null)" bin/mockgen/mockgen
@PATH="$(CURDIR)/bin/mockgen:$$PATH" $(BAZEL) run @rules_go//go -- generate $(GO_GENERATE_PACKAGES)
@echo "Mocks generated successfully!"

proto: ## Generate protobuf files from .proto definitions
Expand Down
2 changes: 1 addition & 1 deletion doc/howto/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ brew install grpcurl

`make help` lists every target. The table below is the day-to-day set.

CI runs `make lint`, `make check-tidy`, and `make check-gazelle`. `make lint` includes the format check, license headers, the tracked-binary check, the message-ID check, and the queue-shard check. `make fmt`, `make tidy`, and `make gazelle` apply the corresponding fixes. `make mocks` regenerates the checked-in mockgen files; `make check-mocks` fails when that output differs from the tree. `make clean` removes the Bazel cache and `bin/`. Generated protobuf Go files stay in the source tree until `make clean-proto`; `make proto` writes them again.
CI runs `make lint`, `make check-tidy`, `make check-gazelle`, and `make check-mocks`. `make lint` includes the format check, license headers, the tracked-binary check, the message-ID check, and the queue-shard check. `make fmt`, `make tidy`, and `make gazelle` apply the corresponding fixes. `make mocks` regenerates the checked-in mockgen files with the `mockgen` pinned in `go.mod`, which Bazel builds into `bin/mockgen/` and puts first on `PATH`, so no local install is needed and a different `mockgen` on your `PATH` is ignored; run `go generate` directly only with that binary on `PATH`. `make check-mocks` fails when that output differs from the tree. `make clean` removes the Bazel cache and `bin/`. Generated protobuf Go files stay in the source tree until `make clean-proto`; `make proto` writes them again.

| Target | Description |
|--------|-------------|
Expand Down
Loading