fix(ci): stamp live-ClickHouse seed events relative to now (30-day raw-event TTL expired the fixed 2026-09 timestamps)
CI (SIAX Cloud) / integration (push) Skipped
CI (SIAX Cloud) / sonar (push) Skipped
CI (SIAX Cloud) / sonar (pull_request) Skipped
masterplan-lock / check (pull_request) Successful in 6s
masterplan-lock / check (push) Successful in 6s
CI (SIAX Cloud) / security (push) Successful in 16s
Security Scan (SIAX Cloud) / security (push) Successful in 22s
CI (SIAX Cloud) / quality (pull_request) Successful in 43s
CI (SIAX Cloud) / security (pull_request) Successful in 46s
CI (SIAX Cloud) / quality (push) Successful in 1m5s
CI (SIAX Cloud) / integration (pull_request) Successful in 1m12s
Security Scan (SIAX Cloud) / security (pull_request) Successful in 1m3s

Root cause of red integration job on main/#173/#174: opt_analytics_event has TTL event_time + 30 DAY; seeds dated 2026-09-01 expired on 2026-10-01 so tenant-isolation reads returned 0 rows. Same time bomb latent in 3 sibling suites.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Claude Code
2026-10-02 18:38:23 +02:00
co-authored by Claude Sonnet 5.5
parent 7f107c4c9d
commit d5539ac638
4 changed files with 43 additions and 7 deletions
@@ -17,6 +17,15 @@ import { ClickHouseAnalyticsEngine } from "@/src/analytics/engine/clickhouse-eng
import { ANALYTICS_MATERIALIZED_VIEWS, ANALYTICS_TABLES } from "@/src/analytics/engine/schema";
import type { AnalyticsIdentity } from "@/src/analytics/engine/siax-analytics-engine";
/**
* Raw events carry a 30-day TTL (src/analytics/engine/schema.ts). Fixed
* historical timestamps silently expire and make live-ClickHouse suites read
* 0 rows, so seed rows are stamped relative to now (UTC, ClickHouse
* DateTime64(3) text form).
*/
const SEED_EVENT_TIME = new Date(Date.now() - 2 * 3600_000).toISOString().replace("T", " ").replace("Z", "");
const CLICKHOUSE_URL = process.env.CLICKHOUSE_URL;
const CLICKHOUSE_AUTH = process.env.CLICKHOUSE_AUTH;
const run = CLICKHOUSE_URL ? describe : describe.skip;
@@ -113,7 +122,7 @@ run("BI-P009/BI-P010 ClickHouse provider against a LIVE server", () => {
dataset_id: "ds_mv",
metric: "mv_metric",
event_id: `mv${i}`,
event_time: "2026-09-03 12:00:00.000",
event_time: SEED_EVENT_TIME,
value: 2,
dim_names: [],
dim_values: [],
@@ -140,7 +149,7 @@ run("BI-P009/BI-P010 ClickHouse provider against a LIVE server", () => {
dataset_id: "ds_g",
metric: "grouped",
event_id: `g${i}`,
event_time: "2026-09-04 09:00:00.000",
event_time: SEED_EVENT_TIME,
value: 5,
dim_names: ["severity"],
dim_values: [sev],
@@ -19,6 +19,15 @@ import { ClickHouseAnalyticsEngine } from "@/src/analytics/engine/clickhouse-eng
import { DEFAULT_BUDGETS } from "@/src/analytics/engine/resource-governance";
import type { AnalyticsIdentity } from "@/src/analytics/engine/siax-analytics-engine";
/**
* Raw events carry a 30-day TTL (src/analytics/engine/schema.ts). Fixed
* historical timestamps silently expire and make live-ClickHouse suites read
* 0 rows, so seed rows are stamped relative to now (UTC, ClickHouse
* DateTime64(3) text form).
*/
const SEED_EVENT_TIME = new Date(Date.now() - 2 * 3600_000).toISOString().replace("T", " ").replace("Z", "");
const CLICKHOUSE_URL = process.env.CLICKHOUSE_URL;
const CLICKHOUSE_AUTH = process.env.CLICKHOUSE_AUTH;
const run = CLICKHOUSE_URL ? describe : describe.skip;
@@ -75,7 +84,7 @@ run("BI-P012 resource governance against a LIVE ClickHouse", () => {
dataset_id: "ds_v",
metric: "victim_metric",
event_id: `v${i}`,
event_time: "2026-09-05 08:00:00.000",
event_time: SEED_EVENT_TIME,
value: 1,
dim_names: ["severity"],
dim_values: ["warning"],
@@ -37,6 +37,15 @@ import { ANALYTICS_TABLES, sortingKeySql } from "@/src/analytics/engine/schema";
import { DEFAULT_BUDGETS } from "@/src/analytics/engine/resource-governance";
import type { AnalyticsIdentity } from "@/src/analytics/engine/siax-analytics-engine";
/**
* Raw events carry a 30-day TTL (src/analytics/engine/schema.ts). Fixed
* historical timestamps silently expire and make live-ClickHouse suites read
* 0 rows, so seed rows are stamped relative to now (UTC, ClickHouse
* DateTime64(3) text form).
*/
const SEED_EVENT_TIME = new Date(Date.now() - 2 * 3600_000).toISOString().replace("T", " ").replace("Z", "");
const CLICKHOUSE_URL = process.env.CLICKHOUSE_URL;
const CLICKHOUSE_AUTH = process.env.CLICKHOUSE_AUTH;
const run = CLICKHOUSE_URL ? describe : describe.skip;
@@ -100,7 +109,7 @@ run("BI-P011 tenant isolation against a LIVE ClickHouse", () => {
dataset_id: "ds_shared",
metric: "rows_ingested",
event_id: `a${i}`,
event_time: "2026-09-01 10:00:00.000",
event_time: SEED_EVENT_TIME,
value: 1,
dim_names: ["severity"],
dim_values: [i % 2 === 0 ? "warning" : "critical"],
@@ -113,7 +122,7 @@ run("BI-P011 tenant isolation against a LIVE ClickHouse", () => {
dataset_id: "ds_shared",
metric: "rows_ingested",
event_id: `b${i}`,
event_time: "2026-09-01 10:00:00.000",
event_time: SEED_EVENT_TIME,
value: 1000,
dim_names: ["severity"],
dim_values: ["critical"],
@@ -275,7 +284,7 @@ run("BI-P011 tenant isolation against a LIVE ClickHouse", () => {
restrictedAuth,
{},
{},
JSON.stringify({ tenant_id: "t_beta", project_id: "p", dataset_id: "d", metric: "m", event_id: "x", event_time: "2026-09-01 00:00:00.000", value: 1, dim_names: [], dim_values: [] }),
JSON.stringify({ tenant_id: "t_beta", project_id: "p", dataset_id: "d", metric: "m", event_id: "x", event_time: SEED_EVENT_TIME, value: 1, dim_names: [], dim_values: [] }),
);
expect(write.ok).toBe(false);
@@ -60,6 +60,15 @@ import {
} from '@/src/analytics/metrics/semantic-registry';
import type { MetricSpec } from '@/src/analytics/metrics/metric-model';
/**
* Raw events carry a 30-day TTL (src/analytics/engine/schema.ts). Fixed
* historical timestamps silently expire and make live-ClickHouse suites read
* 0 rows, so seed rows are stamped relative to now (UTC, ClickHouse
* DateTime64(3) text form).
*/
const SEED_EVENT_TIME = new Date(Date.now() - 2 * 3600_000).toISOString().replace("T", " ").replace("Z", "");
const CLICKHOUSE_URL = process.env.CLICKHOUSE_URL;
const CLICKHOUSE_AUTH = process.env.CLICKHOUSE_AUTH;
// Collection-time, never inside a hook: `describe.skipIf(flagSetInBeforeAll)`
@@ -280,7 +289,7 @@ run('BI-P029 — one golden metric, two independent compilers, one live ClickHou
dataset_id: 'ds_sales',
metric: 'amount_sek',
event_id: `e${i}`,
event_time: '2026-09-03 12:00:00.000',
event_time: SEED_EVENT_TIME,
value: r.amount,
dim_names: ['country_code', 'sales_channel'],
dim_values: [r.country, r.channel],