sourcegraph/cmd/frontend/internal/httpapi
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
..
releasecache bazel: native go-mockgen in Bazel (#60386) 2024-02-16 13:26:48 +00:00
webhookhandlers logger: update log lib and remove use of description (#57690) 2023-10-18 17:29:08 +02:00
api_test.go httpapi: put router for external API in same place as handler (#57988) 2023-10-31 12:57:29 +00:00
auth_test.go Using new function for security even logs (#59245) 2024-01-03 17:24:44 -05:00
auth.go [dotcom] add refresh token endpoint with sams authenticator (#60145) 2024-02-06 18:50:30 +05:30
BUILD.bazel bazel: native go-mockgen in Bazel (#60386) 2024-02-16 13:26:48 +00:00
db_test.go bazel: first pass at moving moving logging linting into nogo (#58910) 2024-01-02 10:07:25 -08:00
doc.go Publish Sourcegraph as open source 🚀 2018-09-30 23:13:36 -07:00
graphql_test.go treat unknown actors as internal for the purpose of audit logs (#54876) 2023-07-12 16:34:24 -05:00
graphql.go Improve GQL ratelimits (#58563) 2023-12-27 14:04:54 +01:00
helpers.go all: use any instead of interface{} (#35102) 2022-05-09 10:59:39 +02:00
httpapi.go Fix panic on startup (#60226) 2024-02-06 19:07:44 +00:00
internal_test.go httpapi: put internal API router next to handlers (#57990) 2023-11-01 15:37:29 +01:00
internal.go Remove HTTP for inter-service RPC (#59093) 2024-01-11 19:46:32 +01:00
metrics.go Instrument GraphQL requests to publish metrics to Prometheus (#29320) 2022-01-11 09:48:00 +01:00
mocks_test.go chore: Update go-mockgen (#44305) 2022-11-11 19:24:00 +00:00
opencodegraph.go OpenCodeGraph prototype (#58675) 2023-12-06 21:39:33 -08:00
repo_shield_test.go Chore: clean up RepositoryResolver, part II (#59405) 2024-01-09 17:17:06 +00:00
repo_shield.go httpapi: Remove unused param (#45721) 2022-12-15 18:18:02 +01:00
search_test.go Remove HTTP for inter-service RPC (#59093) 2024-01-11 19:46:32 +01:00
search.go Remove HTTP for inter-service RPC (#59093) 2024-01-11 19:46:32 +01:00
src_cli_test.go src-cli: Fix version output (#40928) 2022-08-26 11:37:12 -05:00
src_cli.go logger: update log lib and remove use of description (#57690) 2023-10-18 17:29:08 +02:00
ssc.go chore: Remove accidental debugging leftovers (#60200) 2024-02-06 19:21:27 +05:30
stream_blame_test.go gitserver: Migrate Blame to rpc call (#59851) 2024-01-28 06:35:42 +01:00
stream_blame.go gitserver: Consistently return os.ErrNotExist on subrepo error (#59921) 2024-01-29 12:44:33 +00:00