Commit Graph

10 Commits

Author SHA1 Message Date
Erik Seliger
84b2afc235
worker: Reduce frequency of very frequently run jobs (#62864)
worker: Reduce frequency of very frequent jobs

I looked at background routines and noticed that many routines are running _very_ frequently, which can cause higher than necessary load, and also stress on redis to store all these runs.

I tried to put in some more sensible numbers (aligning it with what most other routines seem to use). For many instances, this will mean a 30x reduction in job invocations.

Test plan:

Code review from owners, and will watch S2 and dotcom for potential issues.
2024-05-23 18:31:20 +02:00
Noah S-C
9b6ba7741e
bazel: transcribe test ownership to bazel tags (#62664) 2024-05-16 15:51:16 +01:00
Keegan Carruthers-Smith
e9d0d57d81
all: use observation.TestContextTB instead of TestContext (#61751)
observation.TestContextTB is better to use since your logs will be
scoped to your test and it will use a more pedantic prometheus registry.
To be honest TestContext should be removed but this is the first step.

This is a mechanical change. I replaced "&observation.TestContext" with
"observation.TestContextTB(t)". I then undid the change each time it
caused a compilation error (was only a handful of times).

Test Plan: go test
2024-04-10 14:07:39 +02:00
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
Camden Cheek
539a5e2b38
Chore: construct logger inside dbtest.NewDB (#57549)
construct logger inside dbtest.NewDB
2023-10-11 20:41:11 -05:00
Eric Fritz
e04d225bf7
codenotify: dr. fritz is kil (#57313) 2023-10-03 16:19:55 +00:00
Keegan Carruthers-Smith
384f17e144
all: gofmt -s -w . (#55454)
Ran with go1.20.3. Our CI usually enforces this, but may be using a
different version of go or we have a regression.

Test Plan: CI
2023-07-31 20:39:29 +00:00
Camden Cheek
3ff5ad2839
Backend: remove enterprise/internal (#54872) 2023-07-12 22:51:02 +02:00
Jean-Hadrien Chabran
5bea6c78c8
bazel: build the //lib folder (#46929) 2023-01-27 15:30:35 +01:00
Randell Callahan
27cb0c6330
Move Log Execution out of workerutil (#46742) 2023-01-26 09:58:29 -07:00