Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ jobs:
src/services/warehouse/alert-window-alignment.clickhouse.e2e.test.ts
src/services/warehouse/web-analytics-parity.clickhouse.e2e.test.ts
src/services/warehouse/trace-facets-hourly-materialization.clickhouse.e2e.test.ts
src/services/warehouse/ci-runs-materialization.clickhouse.e2e.test.ts

# Every SQL shape the product emits, against the real analyzer: unit tests
# only compare SQL text, which is how a NO_COMMON_TYPE reached production.
Expand Down
13 changes: 13 additions & 0 deletions apps/cli/src/server/local-schema-history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,19 @@ export const LOCAL_SCHEMA_HISTORY: ReadonlyArray<LocalSchemaHistoryEntry> = Obje
manifestDigest: "9f47ab6ca94633c667375133a2a2bc8fab1065a0494fb89973ba2230d8f9d516",
projectRevision: "ed74788ef292834069e0ea6ee3b22d68fc604fb66cb54d2d551db67ce8d20b3a",
}),
Object.freeze({
// v38 adds ci_runs, ci_jobs and their views; nothing is rewritten, and nothing is
// backfilled because CI traces never reach a local store.
//
// projectRevision is carried forward deliberately: it is a hardcoded
// constant that no longer tracks the generator's header, and the identity
// this gate compares is the fingerprint/digest pair.
version: 38,
fingerprint: "b5b7d31165206b3b",
digest: "b5b7d31165206b3bb5b9d7067625afb518b78767d066db56903641628900a5a8",
manifestDigest: "ff3610deae33950cec09239468ee3752c2869a8232f3d1e1c252a61ca29992db",
projectRevision: "ed74788ef292834069e0ea6ee3b22d68fc604fb66cb54d2d551db67ce8d20b3a",
}),
] as const)

/** Immutable SQLite control DDL identities, checked by clickhouse:schema:check. */
Expand Down
2 changes: 1 addition & 1 deletion apps/cli/src/server/local-schema-version.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Increment this value for every structural change to the generated local
// schema. The compatibility manifest and migration registry must be updated in
// the same change before a new value can ship.
export const LOCAL_SCHEMA_VERSION = 37 as const
export const LOCAL_SCHEMA_VERSION = 38 as const

/** SQLite eventing state has its own independent version sequence. */
export const LOCAL_CONTROL_SCHEMA_VERSION = 1 as const
36 changes: 36 additions & 0 deletions apps/cli/src/server/local-store-migrations/steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1452,5 +1452,41 @@ export const LOCAL_STORE_STEPS: ReadonlyArray<StepSpec> = [
},
],
},
{
// Purely additive and filled forward only: CI traces come from the GitHub App's
// webhooks, which never reach a local store, so there is nothing to backfill.
id: "local-0037-to-0038-ci-runs-jobs",
from: 37,
to: 38,
description: "ci_runs + ci_jobs and their views: CI runs and jobs off github-actions traces",
clonedBefore: "additive DDL runs",
plan: [
[
"install-ci-runs-jobs",
"Install the ci_runs and ci_jobs projections and their materialized views via the v38 bootstrap",
],
],
verifies: "Verify the v38 physical schema and the retained raw telemetry counts",
dispositions: [
{
name: "ci_runs",
classification: "derived",
disposition: "rebuild-within-retention-horizon",
guarantee: "Filled forward from github-actions root spans written after the migration.",
preservationInterval: "from the migration forward",
sourceRetentionDays: 30,
targetRetentionDays: 365,
},
{
name: "ci_jobs",
classification: "derived",
disposition: "rebuild-within-retention-horizon",
guarantee: "Filled forward from github-actions job spans written after the migration.",
preservationInterval: "from the migration forward",
sourceRetentionDays: 30,
targetRetentionDays: 365,
},
],
},
// local-schema:bump appends the next step above this line.
]
3 changes: 3 additions & 0 deletions apps/cli/src/server/schema-identity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import schemaV34Sql from "./schema/local-schema-v34.sql" with { type: "text" }
import schemaV35Sql from "./schema/local-schema-v35.sql" with { type: "text" }
import schemaV36Sql from "./schema/local-schema-v36.sql" with { type: "text" }
import schemaV37Sql from "./schema/local-schema-v37.sql" with { type: "text" }
import schemaV38Sql from "./schema/local-schema-v38.sql" with { type: "text" }
import { schemaDigest as digestSchema, schemaFingerprint as fingerprintSchema } from "./store-version"
import { buildLocalSchemaManifest, type LocalSchemaManifest } from "./schema-manifest"
import { LOCAL_SCHEMA_VERSION } from "./local-schema-version"
Expand Down Expand Up @@ -117,6 +118,7 @@ const SNAPSHOT_SQL: ReadonlyArray<string> = [
schemaV35Sql,
schemaV36Sql,
schemaV37Sql,
schemaV38Sql,
]

export interface LocalSchemaSnapshot {
Expand Down Expand Up @@ -210,6 +212,7 @@ export const LOCAL_SCHEMA_V33 = localSchemaIdentity(33)
export const LOCAL_SCHEMA_V34 = localSchemaIdentity(34)
export const LOCAL_SCHEMA_V36 = localSchemaIdentity(36)
export const LOCAL_SCHEMA_V37 = localSchemaIdentity(37)
export const LOCAL_SCHEMA_V38 = localSchemaIdentity(38)

export const CURRENT_LOCAL_SCHEMA: LocalSchemaIdentity = Object.freeze({
version: LOCAL_SCHEMA_VERSION,
Expand Down
2 changes: 1 addition & 1 deletion apps/cli/src/server/schema/local-inserts.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"projectRevision": "7fed5d73a33c0c907e0634ed216631b41ecd24f213e58dcc5b9df4b9c1f314c5",
"projectRevision": "254be0396778febcafa4a5b5f6dfff07c0af73b2078c528fcf2bfa98cfa7a884",
"orgPlaceholder": "__ORG__",
"datasources": {
"traces": {
Expand Down
Loading
Loading