From 7a86008062545bd076856de29a19671df62e2e54 Mon Sep 17 00:00:00 2001 From: John Coffey Date: Sat, 22 Aug 2026 18:39:25 -0700 Subject: [PATCH] Complete the low-risk half of the Sentry -> Cairn OBS rebrand Sweeps the references that carry no runtime coupling, and fixes one that turned out to be a real bug rather than stale branding. Docker network: sentry_default -> cairnobs_default across 23 runbook and test-header `docker run` commands. Compose derives the network from the directory name, so this lands together with renaming the working copy to cairnobs/ -- the two are only correct as one change. Stale references corrected: four Dockerfile "repo root (sentry/)" headers; .env pointing at the long-renamed deploy/helm/sentry/ chart; five Helm comments describing the topic as sentry.logs.raw when all four code paths have defaulted to cairnobs.logs.raw for some time; an absolute /home/john/Projects/sentry/ path in the operator's package doc, now repo-relative; the hand-written Tenant CRD description in both of its identical copies, whose Go source already said Cairn OBS. Migration 0043 repoints the default tenant's data source. 0026 seeded it with ('sentry', '/var/lib/sentry-search') to match what api/internal/config then defaulted to; the rebrand later moved those defaults to "cairnobs" and /var/lib/cairnobs-search without moving the already-applied row, leaving the default tenant naming a ClickHouse database nothing writes to. Scoped to the exact stale values so it is a no-op on any deployment that set them deliberately. 0026's comment is annotated as superseded; its applied SQL is untouched. Deliberately not included: the gRPC wire packages (sentry.logs.v1, sentry.agent.v1) and proto/sentry/ import paths, which cannot change without a lockstep agent/server upgrade; the Helm chart's sentry_metadata database and sentry role, which need a real Postgres migration on existing deployments; and the compliance audit records in docs/compliance/, which are a dated historical record. go build, go vet, and go test pass for ingest and deploy/operator. --- .env | 2 +- agent/Dockerfile | 2 +- .../sessioncheck_integration_test.go | 2 +- api/Dockerfile | 2 +- api/dashboards/store_integration_test.go | 2 +- api/localauth/store_integration_test.go | 2 +- .../cairnobs/crds/cairnobs.io_tenants.yaml | 2 +- .../cairnobs/templates/enterprise-ingest.yaml | 2 +- deploy/helm/cairnobs/templates/ingest.yaml | 2 +- deploy/helm/cairnobs/templates/redpanda.yaml | 2 +- deploy/helm/cairnobs/values.yaml | 4 +- .../api/v1alpha1/groupversion_info.go | 2 +- .../config/crd/cairnobs.io_tenants.yaml | 2 +- docs/phase-3-runbook.md | 2 +- docs/phase-4-runbook.md | 12 +++--- docs/phase-7-runbook.md | 4 +- enterprise/README.md | 8 ++-- enterprise/internal/audit/integration_test.go | 2 +- enterprise/internal/chrunner/chrunner_test.go | 2 +- enterprise/internal/chwriter/chwriter_test.go | 2 +- .../internal/rbacstore/rbacstore_test.go | 2 +- .../tenantprovision/tenantprovision_test.go | 2 +- hack/alert-load-test/README.md | 2 +- hack/mock-ollama/main.go | 2 +- ingest/Dockerfile | 2 +- ingest/cmd/ingest/main.go | 2 +- .../0026_seed_default_tenant_data_source.sql | 10 ++++- .../0043_rebrand_default_data_source.sql | 38 +++++++++++++++++++ search/Dockerfile | 2 +- 29 files changed, 83 insertions(+), 39 deletions(-) create mode 100644 metadata/migrations/0043_rebrand_default_data_source.sql diff --git a/.env b/.env index 83e1103..71bc87e 100644 --- a/.env +++ b/.env @@ -2,7 +2,7 @@ # default: "single-tenant" (api, Phase 0-3 behavior) or "enterprise" # (enterprise-api, Phase 4 multi-tenant) -- mutually exclusive, the same # choice Helm's enterprise.enabled flag makes for a real cluster -# (deploy/helm/sentry/templates/api.yaml vs enterprise-api.yaml). See +# (deploy/helm/cairnobs/templates/api.yaml vs enterprise-api.yaml). See # the api/enterprise-api service definitions in docker-compose.yml. # # Override per-invocation without editing this file: diff --git a/agent/Dockerfile b/agent/Dockerfile index f84ee00..e382071 100644 --- a/agent/Dockerfile +++ b/agent/Dockerfile @@ -1,4 +1,4 @@ -# Build context must be the repo root (sentry/), not agent/, since this +# Build context must be the repo root (cairnobs/), not agent/, since this # needs both agent/ and proto/: # docker build -f agent/Dockerfile -t cairnobs-agent . diff --git a/alerting/internal/sessioncheck/sessioncheck_integration_test.go b/alerting/internal/sessioncheck/sessioncheck_integration_test.go index 4f46bb0..e2341f5 100644 --- a/alerting/internal/sessioncheck/sessioncheck_integration_test.go +++ b/alerting/internal/sessioncheck/sessioncheck_integration_test.go @@ -7,7 +7,7 @@ // // Skipped unless SESSIONCHECK_TEST_POSTGRES_ADDR is set; run via: // -// docker run --rm --network sentry_default -v $(pwd)/../../..:/src -w /src/alerting \ +// docker run --rm --network cairnobs_default -v $(pwd)/../../..:/src -w /src/alerting \ // -e SESSIONCHECK_TEST_POSTGRES_ADDR=metadata-postgres:5432 \ // -e SESSIONCHECK_TEST_POSTGRES_PASSWORD=cairnobs-dev-only \ // golang:1.25-alpine go test ./internal/sessioncheck/... -run Integration -v diff --git a/api/Dockerfile b/api/Dockerfile index 8117756..47f12de 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -1,4 +1,4 @@ -# Build context must be the repo root (sentry/), since this needs both +# Build context must be the repo root (cairnobs/), since this needs both # api/ and proto/ (api now speaks gRPC to /search, using proto's checked-in # Go bindings via the `replace` directive in api/go.mod): # docker build -f api/Dockerfile -t cairnobs-api . diff --git a/api/dashboards/store_integration_test.go b/api/dashboards/store_integration_test.go index f384e99..6a98179 100644 --- a/api/dashboards/store_integration_test.go +++ b/api/dashboards/store_integration_test.go @@ -9,7 +9,7 @@ // // Skipped unless DASHBOARDS_TEST_POSTGRES_ADDR is set; run via: // -// docker run --rm --network sentry_default -v $(pwd)/../../..:/src -w /src/api \ +// docker run --rm --network cairnobs_default -v $(pwd)/../../..:/src -w /src/api \ // -e DASHBOARDS_TEST_POSTGRES_ADDR=metadata-postgres:5432 \ // -e DASHBOARDS_TEST_POSTGRES_PASSWORD=cairnobs-dev-only \ // golang:1.25-alpine go test ./dashboards/... -run Integration -v diff --git a/api/localauth/store_integration_test.go b/api/localauth/store_integration_test.go index 0daf573..1305e98 100644 --- a/api/localauth/store_integration_test.go +++ b/api/localauth/store_integration_test.go @@ -8,7 +8,7 @@ // // Skipped unless LOCALAUTH_TEST_POSTGRES_ADDR is set; run via: // -// docker run --rm --network sentry_default -v $(pwd)/../../..:/src -w /src/api \ +// docker run --rm --network cairnobs_default -v $(pwd)/../../..:/src -w /src/api \ // -e LOCALAUTH_TEST_POSTGRES_ADDR=metadata-postgres:5432 \ // -e LOCALAUTH_TEST_POSTGRES_PASSWORD=cairnobs-dev-only \ // golang:1.25-alpine go test ./localauth/... -run Integration -v diff --git a/deploy/helm/cairnobs/crds/cairnobs.io_tenants.yaml b/deploy/helm/cairnobs/crds/cairnobs.io_tenants.yaml index 578eaa3..93eaa04 100644 --- a/deploy/helm/cairnobs/crds/cairnobs.io_tenants.yaml +++ b/deploy/helm/cairnobs/crds/cairnobs.io_tenants.yaml @@ -33,7 +33,7 @@ spec: openAPIV3Schema: type: object description: >- - Tenant is the K8s-native representation of one Sentry tenant's + Tenant is the K8s-native representation of one Cairn OBS tenant's deployment-topology state -- see deploy/operator/internal/controller/tenant_controller.go's doc comment for what the controller does and does not manage. diff --git a/deploy/helm/cairnobs/templates/enterprise-ingest.yaml b/deploy/helm/cairnobs/templates/enterprise-ingest.yaml index f2bc0c1..07a36ae 100644 --- a/deploy/helm/cairnobs/templates/enterprise-ingest.yaml +++ b/deploy/helm/cairnobs/templates/enterprise-ingest.yaml @@ -1,7 +1,7 @@ {{/* Only rendered once per-tenant write-routing is actually turned on (see ingest.yaml's -mode=server comment) -- this Deployment is what takes -over consuming sentry.logs.raw once ingest.yaml's own consumer half +over consuming cairnobs.logs.raw once ingest.yaml's own consumer half stops, routing each record to its own tenant's dedicated ClickHouse database (enterprise/internal/chwriter) instead of the one shared table. No Service: this is a pure background worker, nothing calls it, only diff --git a/deploy/helm/cairnobs/templates/ingest.yaml b/deploy/helm/cairnobs/templates/ingest.yaml index d85d429..7ef5b81 100644 --- a/deploy/helm/cairnobs/templates/ingest.yaml +++ b/deploy/helm/cairnobs/templates/ingest.yaml @@ -26,7 +26,7 @@ spec: # -mode=server only: this Deployment stops running the # ClickHouse-writing consumer half (the default -mode=all) # once per-tenant write-routing is on -- enterprise-ingest.yaml - # (below) takes over consuming sentry.logs.raw instead, so it + # (below) takes over consuming cairnobs.logs.raw instead, so it # can write each tenant's records to their own database rather # than the one shared table ingest's own consumer always # writes to. The agent-facing server half (PushBatch, tenant diff --git a/deploy/helm/cairnobs/templates/redpanda.yaml b/deploy/helm/cairnobs/templates/redpanda.yaml index e1c8dfa..5866e32 100644 --- a/deploy/helm/cairnobs/templates/redpanda.yaml +++ b/deploy/helm/cairnobs/templates/redpanda.yaml @@ -72,7 +72,7 @@ spec: - name: admin port: 9644 --- -# One-shot: creates the sentry.logs.raw topic. Same image +# One-shot: creates the cairnobs.logs.raw topic. Same image # transport/Dockerfile builds for docker-compose.yml's redpanda-provision # service. Deliberately a plain Job, not a Helm hook -- see # deploy/helm/cairnobs/README.md's "Startup ordering" section for why diff --git a/deploy/helm/cairnobs/values.yaml b/deploy/helm/cairnobs/values.yaml index 2915df5..8fe7244 100644 --- a/deploy/helm/cairnobs/values.yaml +++ b/deploy/helm/cairnobs/values.yaml @@ -79,7 +79,7 @@ ingest: # -create-ingest-credential-tenant=`) or be refused outright. Also # controls per-tenant write-routing: true switches ingest.yaml's # Deployment to -mode=server only and renders enterprise-ingest.yaml - # to take over consuming sentry.logs.raw, writing each tenant's + # to take over consuming cairnobs.logs.raw, writing each tenant's # records into their own ClickHouse database instead of the one # shared table -- both flags gate together since write-routing is only # meaningful once records actually carry a tenant_id to route on. @@ -164,7 +164,7 @@ enterprise: tag: latest # enterprise-ingest (templates/enterprise-ingest.yaml) -- only # rendered when ingest.requireTenantCredential is also true (see that - # value's comment); takes over consuming sentry.logs.raw from + # value's comment); takes over consuming cairnobs.logs.raw from # ingest.yaml's own consumer once per-tenant write-routing is on. Same # "repo root build context" reasoning as apiImage above -- see # enterprise/cmd/enterprise-ingest/Dockerfile. diff --git a/deploy/operator/api/v1alpha1/groupversion_info.go b/deploy/operator/api/v1alpha1/groupversion_info.go index 989fa93..fcd2197 100644 --- a/deploy/operator/api/v1alpha1/groupversion_info.go +++ b/deploy/operator/api/v1alpha1/groupversion_info.go @@ -1,7 +1,7 @@ // Package v1alpha1 contains the Tenant API's Go types -- kubebuilder's // standard api// layout, hand-written rather than scaffolded // (no kubebuilder/controller-gen binary available in this environment; -// see /home/john/Projects/sentry/deploy/README.md's verification +// see /deploy/README.md's verification // section for what that means for this package specifically: it's real, // compiling, unit-tested Go code, never reconciled against a live // cluster). diff --git a/deploy/operator/config/crd/cairnobs.io_tenants.yaml b/deploy/operator/config/crd/cairnobs.io_tenants.yaml index 578eaa3..93eaa04 100644 --- a/deploy/operator/config/crd/cairnobs.io_tenants.yaml +++ b/deploy/operator/config/crd/cairnobs.io_tenants.yaml @@ -33,7 +33,7 @@ spec: openAPIV3Schema: type: object description: >- - Tenant is the K8s-native representation of one Sentry tenant's + Tenant is the K8s-native representation of one Cairn OBS tenant's deployment-topology state -- see deploy/operator/internal/controller/tenant_controller.go's doc comment for what the controller does and does not manage. diff --git a/docs/phase-3-runbook.md b/docs/phase-3-runbook.md index d145ac7..f98fb30 100644 --- a/docs/phase-3-runbook.md +++ b/docs/phase-3-runbook.md @@ -95,7 +95,7 @@ Bring up a local webhook receiver for testing (no real Slack/PagerDuty needed): ```sh -docker run -d --name cairnobs-webhook-sink --network sentry_default \ +docker run -d --name cairnobs-webhook-sink --network cairnobs_default \ -p 9099:9099 -v $(pwd)/hack/webhook-sink:/src -w /src golang:1.25-alpine go run . ``` diff --git a/docs/phase-4-runbook.md b/docs/phase-4-runbook.md index 77d36ba..cc8091f 100644 --- a/docs/phase-4-runbook.md +++ b/docs/phase-4-runbook.md @@ -344,7 +344,7 @@ This is the fix from Phase 4 task 7/8 (see `/docs/security/threat-model.md`) tenant. Verify the real SQL, not just the fake-store unit tests: ```sh -docker run --rm --network sentry_default -v $(pwd)/api:/src -w /src \ +docker run --rm --network cairnobs_default -v $(pwd)/api:/src -w /src \ -e DASHBOARDS_TEST_POSTGRES_ADDR=metadata-postgres:5432 \ -e DASHBOARDS_TEST_POSTGRES_PASSWORD=cairnobs-dev-only \ golang:1.25-alpine go test ./dashboards/... -run Integration -v @@ -373,7 +373,7 @@ PermissionStore`) have real integration tests, same skip-gated shape as §6 below: ```sh -docker run --rm --network sentry_default -v $(pwd):/src -w /src/enterprise \ +docker run --rm --network cairnobs_default -v $(pwd):/src -w /src/enterprise \ -e RBACSTORE_TEST_POSTGRES_ADDR=metadata-postgres:5432 \ -e RBACSTORE_TEST_POSTGRES_PASSWORD=cairnobs-dev-only \ golang:1.25-alpine go test ./internal/rbacstore/... -run DashboardPermission -v @@ -394,12 +394,12 @@ when `enterprise-api` (not plain `api`) is serving traffic -- see ## 6. `enterprise/internal/rbacstore` and `internal/audit` (already verified — reconfirm here) ```sh -docker run --rm --network sentry_default -v $(pwd):/src -w /src/enterprise \ +docker run --rm --network cairnobs_default -v $(pwd):/src -w /src/enterprise \ -e RBACSTORE_TEST_POSTGRES_ADDR=metadata-postgres:5432 \ -e RBACSTORE_TEST_POSTGRES_PASSWORD=cairnobs-dev-only \ golang:1.25-alpine go test ./internal/rbacstore/... -v -docker run --rm --network sentry_default -v $(pwd):/src -w /src/enterprise \ +docker run --rm --network cairnobs_default -v $(pwd):/src -w /src/enterprise \ -e AUDIT_TEST_POSTGRES_ADDR=metadata-postgres:5432 \ -e AUDIT_TEST_POSTGRES_PASSWORD=audit-writer-dev-only \ -e AUDIT_TEST_ADMIN_PASSWORD=cairnobs-dev-only \ @@ -536,12 +536,12 @@ as an integration test instead of a curl walkthrough since a full login walkthrough isn't scripted yet): ```sh -docker run --rm --network sentry_default -v $(pwd)/enterprise:/src -w /src \ +docker run --rm --network cairnobs_default -v $(pwd)/enterprise:/src -w /src \ -e CHRUNNER_TEST_CLICKHOUSE_ADDR=clickhouse:9000 \ -e CHRUNNER_TEST_CLICKHOUSE_PASSWORD=cairnobs-dev-only \ golang:1.25-alpine go test ./internal/chrunner/... -v -docker run --rm --network sentry_default -v $(pwd)/enterprise:/src -w /src \ +docker run --rm --network cairnobs_default -v $(pwd)/enterprise:/src -w /src \ -e TENANTPROVISION_TEST_CLICKHOUSE_ADDR=clickhouse:9000 \ -e TENANTPROVISION_TEST_CLICKHOUSE_PASSWORD=cairnobs-dev-only \ golang:1.25-alpine go test ./internal/tenantprovision/... -v diff --git a/docs/phase-7-runbook.md b/docs/phase-7-runbook.md index f5f707e..2ec7846 100644 --- a/docs/phase-7-runbook.md +++ b/docs/phase-7-runbook.md @@ -74,7 +74,7 @@ Run it as a container on the compose network with a network alias of `OLLAMA_BASE_URL` at it via a throwaway compose override: ```sh -docker run -d --rm --name cairnobs-mock-ollama --network sentry_default --network-alias ollama \ +docker run -d --rm --name cairnobs-mock-ollama --network cairnobs_default --network-alias ollama \ -v "$(pwd)/hack/mock-ollama:/src" -w /src golang:1.25-alpine \ sh -c "go build -o /tmp/mock-ollama . && /tmp/mock-ollama" @@ -188,7 +188,7 @@ cd api && go build ./... && go vet ./... && go test ./... cd enterprise && go build ./... && go vet ./... && go test ./... # live-Postgres audit tests specifically, against the real dev stack: -docker run --rm --network sentry_default -v "$(pwd):/src" -w /src/enterprise \ +docker run --rm --network cairnobs_default -v "$(pwd):/src" -w /src/enterprise \ -e AUDIT_TEST_POSTGRES_ADDR=metadata-postgres:5432 \ -e AUDIT_TEST_POSTGRES_PASSWORD=audit-writer-dev-only \ -e AUDIT_TEST_ADMIN_PASSWORD=cairnobs-dev-only \ diff --git a/enterprise/README.md b/enterprise/README.md index dda0972..52f0c16 100644 --- a/enterprise/README.md +++ b/enterprise/README.md @@ -369,7 +369,7 @@ integration tests are skipped by default and only run with `AUDIT_TEST_POSTGRES_ADDR` set: ```sh -docker run --rm --network sentry_default -v $(pwd)/..:/src -w /src/enterprise \ +docker run --rm --network cairnobs_default -v $(pwd)/..:/src -w /src/enterprise \ -e AUDIT_TEST_POSTGRES_ADDR=metadata-postgres:5432 \ -e AUDIT_TEST_POSTGRES_PASSWORD=audit-writer-dev-only \ -e AUDIT_TEST_ADMIN_PASSWORD=cairnobs-dev-only \ @@ -380,7 +380,7 @@ docker run --rm --network sentry_default -v $(pwd)/..:/src -w /src/enterprise \ constraints), skipped unless `RBACSTORE_TEST_POSTGRES_ADDR` is set: ```sh -docker run --rm --network sentry_default -v $(pwd)/..:/src -w /src/enterprise \ +docker run --rm --network cairnobs_default -v $(pwd)/..:/src -w /src/enterprise \ -e RBACSTORE_TEST_POSTGRES_ADDR=metadata-postgres:5432 \ -e RBACSTORE_TEST_POSTGRES_PASSWORD=cairnobs-dev-only \ golang:1.25-alpine go test ./internal/rbacstore/... -v @@ -392,12 +392,12 @@ since `internal/chrunner` imports `api/authz`/`api/querylang/executor` via `go.mod`'s `replace` directives to `../api`): ```sh -docker run --rm --network sentry_default -v $(pwd)/..:/src -w /src/enterprise \ +docker run --rm --network cairnobs_default -v $(pwd)/..:/src -w /src/enterprise \ -e TENANTPROVISION_TEST_CLICKHOUSE_ADDR=clickhouse:9000 \ -e TENANTPROVISION_TEST_CLICKHOUSE_PASSWORD=cairnobs-dev-only \ golang:1.25-alpine go test ./internal/tenantprovision/... -v -docker run --rm --network sentry_default -v $(pwd)/..:/src -w /src/enterprise \ +docker run --rm --network cairnobs_default -v $(pwd)/..:/src -w /src/enterprise \ -e CHRUNNER_TEST_CLICKHOUSE_ADDR=clickhouse:9000 \ -e CHRUNNER_TEST_CLICKHOUSE_PASSWORD=cairnobs-dev-only \ golang:1.25-alpine go test ./internal/chrunner/... -v diff --git a/enterprise/internal/audit/integration_test.go b/enterprise/internal/audit/integration_test.go index 7d30315..c473787 100644 --- a/enterprise/internal/audit/integration_test.go +++ b/enterprise/internal/audit/integration_test.go @@ -4,7 +4,7 @@ // mocked pgxpool can't actually exercise. Skipped unless // AUDIT_TEST_POSTGRES_ADDR is set; run via: // -// docker run --rm --network sentry_default -v $(pwd)/../../..:/src -w /src/enterprise \ +// docker run --rm --network cairnobs_default -v $(pwd)/../../..:/src -w /src/enterprise \ // -e AUDIT_TEST_POSTGRES_ADDR=metadata-postgres:5432 \ // -e AUDIT_TEST_POSTGRES_PASSWORD=audit-writer-dev-only \ // -e AUDIT_TEST_ADMIN_PASSWORD=cairnobs-dev-only \ diff --git a/enterprise/internal/chrunner/chrunner_test.go b/enterprise/internal/chrunner/chrunner_test.go index 3347656..7073cbc 100644 --- a/enterprise/internal/chrunner/chrunner_test.go +++ b/enterprise/internal/chrunner/chrunner_test.go @@ -11,7 +11,7 @@ // // Skipped unless CHRUNNER_TEST_CLICKHOUSE_ADDR is set; run via: // -// docker run --rm --network sentry_default -v $(pwd)/../../..:/src -w /src/enterprise \ +// docker run --rm --network cairnobs_default -v $(pwd)/../../..:/src -w /src/enterprise \ // -e CHRUNNER_TEST_CLICKHOUSE_ADDR=clickhouse:9000 \ // -e CHRUNNER_TEST_CLICKHOUSE_PASSWORD=cairnobs-dev-only \ // golang:1.25-alpine go test ./internal/chrunner/... -v diff --git a/enterprise/internal/chwriter/chwriter_test.go b/enterprise/internal/chwriter/chwriter_test.go index 25f908e..3421e03 100644 --- a/enterprise/internal/chwriter/chwriter_test.go +++ b/enterprise/internal/chwriter/chwriter_test.go @@ -6,7 +6,7 @@ // convention as enterprise/internal/chrunner's own tests), skipped // unless that's set; run via: // -// docker run --rm --network sentry_default -v $(pwd)/../../..:/src -w /src/enterprise \ +// docker run --rm --network cairnobs_default -v $(pwd)/../../..:/src -w /src/enterprise \ // -e CHWRITER_TEST_CLICKHOUSE_ADDR=clickhouse:9000 \ // -e CHWRITER_TEST_CLICKHOUSE_PASSWORD=cairnobs-dev-only \ // golang:1.25-alpine go test ./internal/chwriter/... -v diff --git a/enterprise/internal/rbacstore/rbacstore_test.go b/enterprise/internal/rbacstore/rbacstore_test.go index 00061a5..35aa772 100644 --- a/enterprise/internal/rbacstore/rbacstore_test.go +++ b/enterprise/internal/rbacstore/rbacstore_test.go @@ -4,7 +4,7 @@ // wouldn't actually exercise it. Skipped unless RBACSTORE_TEST_POSTGRES_ADDR // is set; run via: // -// docker run --rm --network sentry_default -v $(pwd)/../../..:/src -w /src/enterprise \ +// docker run --rm --network cairnobs_default -v $(pwd)/../../..:/src -w /src/enterprise \ // -e RBACSTORE_TEST_POSTGRES_ADDR=metadata-postgres:5432 \ // -e RBACSTORE_TEST_POSTGRES_PASSWORD=cairnobs-dev-only \ // golang:1.25-alpine go test ./internal/rbacstore/... -v diff --git a/enterprise/internal/tenantprovision/tenantprovision_test.go b/enterprise/internal/tenantprovision/tenantprovision_test.go index 2896d11..ff45baa 100644 --- a/enterprise/internal/tenantprovision/tenantprovision_test.go +++ b/enterprise/internal/tenantprovision/tenantprovision_test.go @@ -3,7 +3,7 @@ // driver.Conn can't meaningfully verify. Skipped unless // TENANTPROVISION_TEST_CLICKHOUSE_ADDR is set; run via: // -// docker run --rm --network sentry_default -v $(pwd)/../../..:/src -w /src/enterprise \ +// docker run --rm --network cairnobs_default -v $(pwd)/../../..:/src -w /src/enterprise \ // -e TENANTPROVISION_TEST_CLICKHOUSE_ADDR=clickhouse:9000 \ // -e TENANTPROVISION_TEST_CLICKHOUSE_PASSWORD=cairnobs-dev-only \ // golang:1.25-alpine go test ./internal/tenantprovision/... -v diff --git a/hack/alert-load-test/README.md b/hack/alert-load-test/README.md index f6c798d..9fae941 100644 --- a/hack/alert-load-test/README.md +++ b/hack/alert-load-test/README.md @@ -14,7 +14,7 @@ go run . --count 500000 # 2. Run a webhook-sink so the (never-firing, by design) rules have a # valid notification target to point at: -docker run -d --name cairnobs-webhook-sink --network sentry_default \ +docker run -d --name cairnobs-webhook-sink --network cairnobs_default \ -p 9099:9099 -v $(pwd)/../webhook-sink:/src -w /src golang:1.25-alpine go run . # 3. Run the load test: diff --git a/hack/mock-ollama/main.go b/hack/mock-ollama/main.go index 47a2616..760008c 100644 --- a/hack/mock-ollama/main.go +++ b/hack/mock-ollama/main.go @@ -11,7 +11,7 @@ // same reason: no live model, deterministic output, fast. // // Not part of any docker-compose service by default -- run it -// standalone (or as a throwaway container on the sentry_default +// standalone (or as a throwaway container on the cairnobs_default // network) and point OLLAMA_BASE_URL at it. See // /docs/phase-7-runbook.md for the exact recipe. package main diff --git a/ingest/Dockerfile b/ingest/Dockerfile index 2d76bef..55132d1 100644 --- a/ingest/Dockerfile +++ b/ingest/Dockerfile @@ -1,4 +1,4 @@ -# Build context must be the repo root (sentry/), not ingest/, since this +# Build context must be the repo root (cairnobs/), not ingest/, since this # needs both ingest/ and proto/: # docker build -f ingest/Dockerfile -t cairnobs-ingest . diff --git a/ingest/cmd/ingest/main.go b/ingest/cmd/ingest/main.go index 4069924..0c4edaa 100644 --- a/ingest/cmd/ingest/main.go +++ b/ingest/cmd/ingest/main.go @@ -1,4 +1,4 @@ -// Command ingest is the Sentry ingest service. It has two halves that can +// Command ingest is the Cairn OBS ingest service. It has two halves that can // run in one process or be split across deployments via --mode: // // - server: mTLS gRPC front end that agents push batches to; forwards diff --git a/metadata/migrations/0026_seed_default_tenant_data_source.sql b/metadata/migrations/0026_seed_default_tenant_data_source.sql index 7d21e0b..8632492 100644 --- a/metadata/migrations/0026_seed_default_tenant_data_source.sql +++ b/metadata/migrations/0026_seed_default_tenant_data_source.sql @@ -1,7 +1,13 @@ -- The 'default' tenant's single data source, pointing at the one -- ClickHouse database ("sentry") and Tantivy index every Phase 0-3 --- deployment already uses -- see api/internal/config's CLICKHOUSE_DATABASE --- default and search's index path default. +-- deployment already used at the time this was written -- then matching +-- api/internal/config's CLICKHOUSE_DATABASE default and search's index +-- path default. +-- +-- SUPERSEDED: the Sentry -> Cairn OBS rebrand moved both of those +-- defaults ("cairnobs" and /var/lib/cairnobs-search) without updating +-- this already-applied seed. 0043 repoints the row. The SQL below is +-- left exactly as applied -- do not edit it; fix forward instead. INSERT INTO data_sources (id, tenant_id, name, clickhouse_database_name, tantivy_index_path) SELECT '00000000-0000-0000-0000-000000000001', 'default', 'default', 'sentry', '/var/lib/sentry-search' WHERE NOT EXISTS (SELECT 1 FROM data_sources WHERE tenant_id = 'default') diff --git a/metadata/migrations/0043_rebrand_default_data_source.sql b/metadata/migrations/0043_rebrand_default_data_source.sql new file mode 100644 index 0000000..612414f --- /dev/null +++ b/metadata/migrations/0043_rebrand_default_data_source.sql @@ -0,0 +1,38 @@ +-- Repoint the 'default' tenant's data source at the post-rebrand +-- ClickHouse database and Tantivy index path. +-- +-- 0026 seeded this row with ('sentry', '/var/lib/sentry-search'), +-- correct at the time: it deliberately mirrored what api/internal/config +-- then defaulted CLICKHOUSE_DATABASE to, and search's index path +-- default. The Sentry -> Cairn OBS rebrand later moved both defaults -- +-- api/internal/config and ingest/internal/config now default to +-- "cairnobs", and every index path in the tree is +-- /var/lib/cairnobs-search (docker-compose's search-index-data mount, +-- the Helm chart's search.yaml, and the per-tenant paths +-- enterprise/cmd/enterprise-api builds) -- but the already-applied +-- 0026 row did not move with them. +-- +-- The result on any database where 0026 ran: the default tenant's data +-- source names a ClickHouse database nothing writes to, and an index +-- path nothing maintains. Editing 0026 in place would not fix those +-- deployments, since it has already been recorded as applied -- hence a +-- forward migration. +-- +-- Scoped by the exact stale values rather than by tenant_id alone, so +-- this is a no-op on: +-- - fresh databases, where 0026's seed already reflects current +-- defaults if it is ever re-run, +-- - deployments that set CLICKHOUSE_DATABASE explicitly and corrected +-- this row by hand. +-- It will not clobber a deliberately-chosen database name. +UPDATE data_sources +SET clickhouse_database_name = 'cairnobs' +WHERE tenant_id = 'default' + AND name = 'default' + AND clickhouse_database_name = 'sentry'; + +UPDATE data_sources +SET tantivy_index_path = '/var/lib/cairnobs-search' +WHERE tenant_id = 'default' + AND name = 'default' + AND tantivy_index_path = '/var/lib/sentry-search'; diff --git a/search/Dockerfile b/search/Dockerfile index 47f8cc3..cbf5bdd 100644 --- a/search/Dockerfile +++ b/search/Dockerfile @@ -1,4 +1,4 @@ -# Build context must be the repo root (sentry/), since this needs both +# Build context must be the repo root (cairnobs/), since this needs both # search/ and proto/: # docker build -f search/Dockerfile -t cairnobs-search . #