diff --git a/apps/backend/src/app/api/latest/internal/analytics/query/route.ts b/apps/backend/src/app/api/latest/internal/analytics/query/route.ts index 33ed92261..ca1daff07 100644 --- a/apps/backend/src/app/api/latest/internal/analytics/query/route.ts +++ b/apps/backend/src/app/api/latest/internal/analytics/query/route.ts @@ -35,12 +35,14 @@ export const POST = createSmartRouteHandler({ }).defined(), }), async handler({ body, auth }) { - // TODO: implement include_all_branches. When true, this should query across - // all branches in the project instead of just auth.tenancy.branchId. For now - // it is a no-op: regardless of the flag, queries remain scoped to the current - // branch via the ClickHouse row policy that filters on SQL_branch_id (set - // below). Callers passing include_all_branches=true will still only receive - // data for the current branch until cross-branch filtering is implemented. + // include_all_branches is currently a no-op. Multiple branches per project + // are not implemented yet: every project has a single branch hardcoded to + // DEFAULT_BRANCH_ID ("main"), with no way to create or switch branches (see + // lib/tenancies.tsx). So there are no other branches to include, and queries + // stay scoped to the current branch via the ClickHouse row policy that + // filters on SQL_branch_id (set below). + // TODO: when multi-branch support lands, make include_all_branches=true query + // across all branches in the project instead of just auth.tenancy.branchId. let effectiveTimeoutMs = body.timeout_ms; const billingTeamId = getBillingTeamId(auth.tenancy.project);