sourcegraph/internal/uploadstore
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
..
mocks bazel: native go-mockgen in Bazel (#60386) 2024-02-16 13:26:48 +00:00
BUILD.bazel bazel: native go-mockgen in Bazel (#60386) 2024-02-16 13:26:48 +00:00
config_test.go uploadstore: Don't read AWS config for blobstore backend (#57431) 2023-10-19 20:37:18 +02:00
config.go uploadstore: Don't read AWS config for blobstore backend (#57431) 2023-10-19 20:37:18 +02:00
expirer.go goroutine: Refactor constructors for periodic goroutines (#52806) 2023-06-01 17:44:38 -05:00
gcs_api.go {blobstore, uploadstore}: general cleanup (#45042) 2022-12-02 12:23:45 -07:00
gcs_client_test.go uploadstore: list with prefix (#56538) 2023-09-15 14:49:02 +02:00
gcs_client.go bazel: first pass at moving moving logging linting into nogo (#58910) 2024-01-02 10:07:25 -08:00
lazy_client.go uploadstore: list with prefix (#56538) 2023-09-15 14:49:02 +02:00
mocks_test.go {blobstore, uploadstore}: general cleanup (#45042) 2022-12-02 12:23:45 -07:00
observability.go uploadstore: add method to list all keys (#54682) 2023-07-07 12:39:26 +02:00
pool.go goroutine: Remove pool.go (#52801) 2023-06-01 16:25:00 -07:00
reader.go Embeddings: flesh out tracing (#53577) 2023-06-16 15:29:20 +00:00
s3_api.go {blobstore, uploadstore}: general cleanup (#45042) 2022-12-02 12:23:45 -07:00
s3_client_test.go {blobstore, uploadstore}: general cleanup (#45042) 2022-12-02 12:23:45 -07:00
s3_client.go gomod: update or vendor buildkit, docker, hostmatcher and saml to resolve CVEs (#60130) 2024-02-05 13:14:15 +02:00
store_test.go bazel: first pass at moving moving logging linting into nogo (#58910) 2024-01-02 10:07:25 -08:00
store.go uploadstore: list with prefix (#56538) 2023-09-15 14:49:02 +02:00