sourcegraph/internal/database/migration
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
..
cliutil Docs: update links to point to new site (#60381) 2024-02-13 00:23:47 +00:00
definition migrations: Validate concurrent index creations are isolated (#55788) 2023-08-11 14:34:45 +00:00
drift bazel: fix depgard regexp typo (#58073) 2023-11-02 16:17:21 +02:00
multiversion Docs: update links to point to new site (#60381) 2024-02-13 00:23:47 +00:00
runner bazel: native go-mockgen in Bazel (#60386) 2024-02-16 13:26:48 +00:00
schemas mvu: optionally skip drift check in autoupgrade (#53992) 2023-06-26 14:11:18 +01:00
shared bazel: move schema migrations fetching from GCS to bazel repository (#59879) 2024-02-14 17:40:39 +00:00
stitch bazel: move schema migrations fetching from GCS to bazel repository (#59879) 2024-02-14 17:40:39 +00:00
store logger: update log lib and remove use of description (#57690) 2023-10-18 17:29:08 +02:00
BUILD.bazel Migrator: db dsns behind SRC_LOG_LEVEL (#56817) 2023-09-20 15:48:28 +00:00
CODENOTIFY codenotify: dr. fritz is kil (#57313) 2023-10-03 16:19:55 +00:00
runner.go Migrator: db dsns behind SRC_LOG_LEVEL (#56817) 2023-09-20 15:48:28 +00:00