This PR is a result/followup of the improvements we've made in the [SAMS repo](https://github.com/sourcegraph/sourcegraph-accounts/pull/199) that allows call sites to pass down a context (primarily to indicate deadline, and of course, cancellation if desired) and collects the error returned from `background.Routine`s `Stop` method.
Note that I did not adopt returning error from `Stop` method because I realize in monorepo, the more common (and arguably the desired) pattern is to hang on the call of `Start` method until `Stop` is called, so it is meaningless to collect errors from `Start` methods as return values anyway, and doing that would also complicate the design and semantics more than necessary.
All usages of the the `background.Routine` and `background.CombinedRoutines` are updated, I DID NOT try to interpret the code logic and make anything better other than fixing compile and test errors.
The only file that contains the core change is the [`lib/background/background.go`](https://github.com/sourcegraph/sourcegraph/pull/62136/files#diff-65c3228388620e91f8c22d91c18faac3f985fc67d64b08612df18fa7c04fafcd).
* First pass at moving moving logging linting into Bazel
* fixed negation operators
* Update dev/linters/logging/logging.go
Co-authored-by: William Bezuidenhout <william.bezuidenhout@sourcegraph.com>
* added more exceptions and refactored one or two impls
* added nogo lint pragmas to offending files
* ran configure
* reverted git-combine refactor
* ran configure
* reverted test as well
---------
Co-authored-by: William Bezuidenhout <william.bezuidenhout@sourcegraph.com>
A few small cleanups which are easier now that everything is in the gitserver package:
- Move Rel function into gitserver package as it is only used there
- Make LStat private
- Consistently move checker parameters as second parameter after context
- Remove unused db param from client.ReadDir
We want to handle SIGTERM in addition to SIGINT for graceful shutdowns. They are the mechanism used by k8s to inform about an impending pod termination. We currently don't support this and our applications seem to just exit immediately when they receive a SIGTERM.
* Appease and enforce goimports lint
This commit fixes all goimports lint errors by running
`goimports -w -local github.com/sourcegraph/sourcegraph .`
and enables goimports as an enforced lint.
It also adds a goimports call to the `generate.sh` so generated
code doesn't trigger goimports lint warnings.
* Remove requirement to goimports with -local