You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fce671b
Browse filesBrowse the repository at this point in the historyBrowse files
chore(ci): escalate substantial query-engine changes to review tier 4 (#2871)
## Why
The PR triage classifier has no critical-path coverage for `packages/common-utils` — the SQL rendering + execution engine that every chart, search, and alert query flows through. A substantial change there can silently alter query semantics product-wide, yet #2859 (664 prod lines moving multi-series metric merge computation into ClickHouse) tiered on generic size/cross-layer rules as **Tier 3**.
## What
Adds a fourth critical band, `QUERY_ENGINE_CRITICAL_PATTERNS`:
- `packages/common-utils/src/core/renderChartConfig.*`
- `packages/common-utils/src/core/builderToRawSql.*`
- `packages/common-utils/src/clickhouse/`
using the same total-churn escalation mechanism as the infra band, but with a **150-line bar** (`QUERY_ENGINE_CRITICAL_MIN_LINES`).
### Why 150 and not infra's 30
Calibrated against 20 recent merged PRs touching these files (prod-only churn):
| Bar | PRs that would flip to Tier 4 |
|---|---|
| ≥30 (infra bar) | 10/20 — including routine Tier 2 chart fixes (#2759, #2613, #2422, #2487) |
| ≥150 | Only engine-level rewrites: #2246 (Increase aggFn), #2634 (builder→raw SQL), #2859 |
These files are among the hottest in the repo — routine chart fixes graze them weekly — so the bar is set high enough that only changes warranting a domain expert escalate.
### Also
- Fixed a stale test fixture path (`src/renderChartConfig.ts` → `src/core/renderChartConfig.ts`; the file moved after the test was written)
- Updated Tier 4 description text and comment triggers/context lines
## Verification
- `node --test .github/scripts/__tests__/pr-triage-classify.test.js` — 112 tests pass (10 new)
- End-to-end replay of #2859's actual file list now yields Tier 4:
> **Query rendering engine substantially modified** — 664 lines (bar: 150). Every chart, search, and alert query flows through this code
No changeset: CI/internal tooling only.
// exactly the changes that warrant a domain expert.
124
+
constQUERY_ENGINE_CRITICAL_MIN_LINES=150;
125
+
103
126
// A PR only "grazes" a core-critical path when the touch AND the PR as a whole
104
127
// are tiny. Both bounds matter: across 600 merged PRs, a <=10-line core-critical
105
128
// touch inside a larger PR still drew substantive review comments 50% of the
@@ -165,7 +188,7 @@ const TIER_INFO = {
165
188
4: {
166
189
emoji: '🔴',
167
190
headline: 'Tier 4 — Critical',
168
-
detail: 'Touches authentication, tenancy data models, the public API or shipped database config — or substantially changes background tasks, the OTel pipeline, image build, or release CI.',
191
+
detail: 'Touches authentication, tenancy data models, the public API or shipped database config — or substantially changes the query rendering engine, background tasks, the OTel pipeline, image build, or release CI.',
169
192
process: 'Deep review from a domain expert. Synchronous walkthrough may be required.',
170
193
sla: 'Schedule synchronous review within 2 business days.',
171
194
},
@@ -179,10 +202,12 @@ const isDocFile = f => DOC_PATTERN.test(f);
triggers.push(`**Query rendering engine substantially modified** — ${queryEngineCriticalLines} lines (bar: ${QUERY_ENGINE_CRITICAL_MIN_LINES}). Every chart, search, and alert query flows through this code:\n${fileList(queryEngineCriticalFiles)}`);
contextSignals.push(`touches background tasks or the delivery pipeline lightly (${infraCriticalLines} lines, under the ${INFRA_CRITICAL_MIN_LINES}-line bar for Tier 4)`);
contextSignals.push(`touches the query rendering engine lightly (${queryEngineCriticalLines} lines, under the ${QUERY_ENGINE_CRITICAL_MIN_LINES}-line bar for Tier 4)`);
476
+
}
432
477
if(spansLayers&&!isCrossLayer){
433
478
contextSignals.push(`spans packages but only ${prodLines} prod lines — under the ${CROSS_LAYER_MIN_LINES}-line cross-layer bar`);
434
479
}
@@ -445,9 +490,11 @@ module.exports = {
445
490
// Thresholds (exported for tests and documentation)
0 commit comments