sourcegraph/internal/codeintel/codenav
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
..
internal/lsifstore codeintel: Fix path-matching query fragment for diagnostics in GraphQL (#57613) 2023-10-17 12:18:57 +08:00
shared codeintel: consolidate enterprise & oss codeintel packages (#54431) 2023-07-05 14:58:41 +01:00
transport/graphql 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
commit_cache.go gitserver: Simplify client (#59772) 2024-01-24 13:56:54 +01:00
gittree_translator_test.go Gitserver: move subrepo permissions client to the gitserver client struct (#57429) 2023-10-09 15:05:25 +00:00
gittree_translator.go Gitserver: move subrepo permissions client to the gitserver client struct (#57429) 2023-10-09 15:05:25 +00:00
iface.go codeintel: consolidate enterprise & oss codeintel packages (#54431) 2023-07-05 14:58:41 +01:00
init.go codeintel: consolidate enterprise & oss codeintel packages (#54431) 2023-07-05 14:58:41 +01:00
mocks_test.go codeintel: consolidate enterprise & oss codeintel packages (#54431) 2023-07-05 14:58:41 +01:00
observability.go codeintel: consolidate enterprise & oss codeintel packages (#54431) 2023-07-05 14:58:41 +01:00
request_state.go gitserver: Simplify client (#59772) 2024-01-24 13:56:54 +01:00
service_definitions_test.go chore: Remove dead code (#57083) 2023-10-03 17:34:51 -05:00
service_diagnostics_test.go codenav: Add service method to search by symbol name (#54628) 2023-07-05 13:38:02 -05:00
service_hover_test.go gitserver: Simplify client (#59772) 2024-01-24 13:56:54 +01:00
service_new_test.go gitserver: Simplify client (#59772) 2024-01-24 13:56:54 +01:00
service_new.go chore: Remove dead code (#57083) 2023-10-03 17:34:51 -05:00
service_ranges_test.go Gitserver: move subrepo permissions client to the gitserver client struct (#57429) 2023-10-09 15:05:25 +00:00
service_references_test.go chore: Remove dead code (#57083) 2023-10-03 17:34:51 -05:00
service_snapshot_test.go gitserver: Unify filereader API (#59782) 2024-01-24 13:53:57 +01:00
service_stencil_test.go codenav: Add service method to search by symbol name (#54628) 2023-07-05 13:38:02 -05:00
service_test.go Separate database package mocks to dbmocks package (#55778) 2023-08-14 10:48:45 +02:00
service.go all: use stdlib slices package (#60086) 2024-02-02 13:54:59 +00:00
types.go codenav: Add service method to search by symbol name (#54628) 2023-07-05 13:38:02 -05:00
utils.go gitserver: Simplify client (#59772) 2024-01-24 13:56:54 +01:00