mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 20:31:48 +00:00
This change extracts `monitoring` into a submodule for import in `sourcegraph/controller` (https://github.com/sourcegraph/controller/pull/195) so that we can generate dashboards for Cloud instances. These steps were required: 1. Initialize a `go.mod` in `monitoring` 2. Extract `dev/sg/internal/cliutil` into `lib` to avoid illegal imports from `monitoring` 3. Add local replaces to both `sourcegraph/sourcegraph` and `monitoring` 4. `go mod tidy` on all submodules 5. Update `go generate ./monitoring` commands to use `sg`, since the `go generate` command no longer works 6. Update `grafana/build.sh`, `prometheus/build.sh` to build the submodule 7. Amend linters to check for multiple `go.mod` files and ban imports of `github.com/sourcegraph/sourcegraph` 8. Update `sg generate go` to run in directories rather than from root The only caveat is that if you use VS code, you will now need to open `monitoring` in a separate workspace or similar, like with `lib`. Co-authored-by: Joe Chen <joe@sourcegraph.com> |
||
|---|---|---|
| .. | ||
| api | ||
| batches | ||
| cliutil | ||
| codeintel | ||
| errors | ||
| gitservice | ||
| group | ||
| iterator | ||
| output | ||
| process | ||
| go.mod | ||
| go.sum | ||
| README.md | ||
| tools.go | ||
Sourcegraph lib module
This directory is the root of a separate go module from the primary module rooted at sourcegraph/sourcegraph. This module exists to hold code that we want to reuse outside of the sourcegraph/sourcegraph repo.
Code in this module should not import from sourcegraph/sourcegraph or from other Sourcegraph repositories to avoid complicated dependency relationships. Instead consider moving code from elsewhere into this module.