sourcegraph/cmd
Noah S-C 19d9cfc73b
bazel: native go-mockgen in Bazel (#60386)
Adds a new:
- gazelle generator
- rule + rule targets + catchall target
for generating go-mockgen mocks & testing for their being up-to-date.

Each go_mockgen macro invocation adds targets for generating mocks, copying to the source tree, as well as testing whether the current source tree mocks are up-to-date.

How to use this: `bazel run //dev:go_mockgen` for the catch-all, or `bazel run //some/target:generate_mocks` for an individual package, and `bazel test //some/target:generate_mocks_tests` to test for up-to-date-ness. There is no catch-all for testing

This currently uses a fork of go-mockgen, with an open PR for upstream here: https://github.com/derision-test/go-mockgen/pull/50.

Closes https://github.com/sourcegraph/sourcegraph/issues/60099

## Test plan

Extensive testing during development, including the following cases:
- Deleting a generated file and its entry in a go_library/go_test `srcs` attribute list and then re-running `sg bazel configure`
- Adding a non-existent output directory to mockgen.test.yaml and running the bash one-liner emitted to prepare the workspace for rerunning `sg bazel configure`

The existing config tests a lot of existing paths anyway (creating mocks for a 3rd party library's interface, entries for a given output file in >1 config file etc)
2024-02-16 13:26:48 +00:00
..
batcheshelper bazel: don't build most oci_tarball targets with bazel build //... by tagging them all manual (#60529) 2024-02-15 09:02:50 +00:00
blobstore bazel: don't build most oci_tarball targets with bazel build //... by tagging them all manual (#60529) 2024-02-15 09:02:50 +00:00
bundled-executor bazel: don't build most oci_tarball targets with bazel build //... by tagging them all manual (#60529) 2024-02-15 09:02:50 +00:00
cody-gateway bazel: native go-mockgen in Bazel (#60386) 2024-02-16 13:26:48 +00:00
embeddings bazel: don't build most oci_tarball targets with bazel build //... by tagging them all manual (#60529) 2024-02-15 09:02:50 +00:00
executor bazel: native go-mockgen in Bazel (#60386) 2024-02-16 13:26:48 +00:00
executor-kubernetes bazel: don't build most oci_tarball targets with bazel build //... by tagging them all manual (#60529) 2024-02-15 09:02:50 +00:00
frontend bazel: native go-mockgen in Bazel (#60386) 2024-02-16 13:26:48 +00:00
gitserver bazel: native go-mockgen in Bazel (#60386) 2024-02-16 13:26:48 +00:00
loadtest bazel: don't build most oci_tarball targets with bazel build //... by tagging them all manual (#60529) 2024-02-15 09:02:50 +00:00
migrator bazel: don't build most oci_tarball targets with bazel build //... by tagging them all manual (#60529) 2024-02-15 09:02:50 +00:00
msp-example bazel: don't build most oci_tarball targets with bazel build //... by tagging them all manual (#60529) 2024-02-15 09:02:50 +00:00
pings bazel: don't build most oci_tarball targets with bazel build //... by tagging them all manual (#60529) 2024-02-15 09:02:50 +00:00
precise-code-intel-worker bazel: don't build most oci_tarball targets with bazel build //... by tagging them all manual (#60529) 2024-02-15 09:02:50 +00:00
repo-updater bazel: don't build most oci_tarball targets with bazel build //... by tagging them all manual (#60529) 2024-02-15 09:02:50 +00:00
searcher bazel: don't build most oci_tarball targets with bazel build //... by tagging them all manual (#60529) 2024-02-15 09:02:50 +00:00
server server: use syntect_server binary (#60557) 2024-02-15 17:50:18 +02:00
symbols bazel: native go-mockgen in Bazel (#60386) 2024-02-16 13:26:48 +00:00
syntactic-code-intel-worker bazel: don't build most oci_tarball targets with bazel build //... by tagging them all manual (#60529) 2024-02-15 09:02:50 +00:00
telemetry-gateway telemetry-gateway: log reported instance URL in request start log (#60574) 2024-02-16 00:48:32 +04:00
worker bazel: native go-mockgen in Bazel (#60386) 2024-02-16 13:26:48 +00:00
README.md Reminder to keep architecture diagram in-sync (#36869) 2022-06-08 19:40:36 -07:00

This directory contains Sourcegraph services and binaries.

When a services is added, removed, or when a service's dependencies change, update our architecture diagram.