Skip to content

Commit f9051bd

Browse files
authored
[CRCR] Rename OOT → CRCR in HUD frontend (lib, API, components, queries, tests) (#8219)
## Summary Part 3 of the OOT → CRCR rename series. Renames all `oot`/`Oot`/`OOT` references to `crcr`/`Crcr`/`CRCR` across the torchci frontend. **File/directory renames (14 files):** | Old | New | |-----|-----| | `lib/oot/ootUtils.ts` | `lib/crcr/crcrUtils.ts` | | `components/oot/OotPrSection.tsx` | `components/crcr/CrcrPrSection.tsx` | | `pages/api/oot/results.ts` | `pages/api/crcr/results.ts` | | `test/ootUtils.test.ts` | `test/crcrUtils.test.ts` | | `test/ootResults.test.ts` | `test/crcrResults.test.ts` | | `clickhouse_queries/oot_summary/` | `clickhouse_queries/crcr_summary/` | | `clickhouse_queries/oot_backend_dashboard/` | `clickhouse_queries/crcr_backend_dashboard/` | | `clickhouse_queries/oot_pr_results/` | `clickhouse_queries/crcr_pr_results/` | **Content changes:** - Types: `OotWorkflowJobRecord` → `CrcrWorkflowJobRecord`, `OotJobRow` → `CrcrJobRow`, `OotSummaryRow` → `CrcrSummaryRow`, `OotPrResult` → `CrcrPrResult` - Components: `OotPrSection` → `CrcrPrSection`, `OotMatrix` → `CrcrMatrix`, `OotSummaryTable` → `CrcrSummaryTable`, `OotSummaryPage` → `CrcrSummaryPage`, `OotBackendPage` → `CrcrBackendPage` - ClickHouse queries: `default.oot_workflow_job` → `default.crcr_workflow_job` - UI label: "Out-of-Tree Backends" → "Cross-Repo CI Backends" - All import paths updated **Note:** The DynamoDB table name (`torchci-oot-workflow-job`) is kept as-is — that's an AWS resource renamed separately (infra change). **Depends on:** PR 2 (ClickHouse `RENAME TABLE`) must be deployed first since queries reference the table name. ## Rename series | PR | Scope | Status | |----|-------|--------| | PR 1 | Lambda — Redis keys, config, tests | [#8217](#8217) | | PR 2 | ClickHouse — schema + replicator | [#8218](#8218) | | **PR 3 (this)** | Frontend — lib, API, components, queries, tests | This PR | ## Test plan - [ ] Verify all renamed imports resolve correctly (TypeScript compilation) - [ ] Verify ClickHouse queries reference `crcr_workflow_job` table - [ ] Verify `/api/crcr/results` endpoint works - [ ] Verify `/crcr` and `/crcr/[org]/[repo]` pages render - [ ] Verify PR page `CrcrPrSection` component loads - [ ] Verify all test files pass with updated imports/mocks
1 parent 89a778d commit f9051bd

14 files changed

Lines changed: 46 additions & 46 deletions

File tree

torchci/clickhouse_queries/oot_backend_dashboard/params.json renamed to torchci/clickhouse_queries/crcr_backend_dashboard/params.json

File renamed without changes.

torchci/clickhouse_queries/oot_backend_dashboard/query.sql renamed to torchci/clickhouse_queries/crcr_backend_dashboard/query.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ SELECT
2121
queue_time,
2222
execution_time
2323
FROM
24-
default.oot_workflow_job FINAL
24+
default.crcr_workflow_job FINAL
2525
WHERE
2626
downstream_repo = {repo: String}
2727
AND started_at > now() - INTERVAL {days: UInt64} DAY

torchci/clickhouse_queries/oot_pr_results/params.json renamed to torchci/clickhouse_queries/crcr_pr_results/params.json

File renamed without changes.

torchci/clickhouse_queries/oot_pr_results/query.sql renamed to torchci/clickhouse_queries/crcr_pr_results/query.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ SELECT
1414
queue_time,
1515
execution_time
1616
FROM
17-
default.oot_workflow_job FINAL
17+
default.crcr_workflow_job FINAL
1818
WHERE
1919
pr_number = {pr: UInt64}
2020
ORDER BY
File renamed without changes.

torchci/clickhouse_queries/oot_summary/query.sql renamed to torchci/clickhouse_queries/crcr_summary/query.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ SELECT
88
avg(duration_seconds) AS avg_duration_s,
99
max(started_at) AS last_run
1010
FROM
11-
default.oot_workflow_job FINAL
11+
default.crcr_workflow_job FINAL
1212
WHERE
1313
started_at > now() - INTERVAL {days: UInt64} DAY
1414
AND status = 'completed'
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ import {
1616
} from "@mui/material";
1717
import { durationDisplay } from "components/common/TimeUtils";
1818
import { fetcher } from "lib/GeneralUtils";
19-
import { conclusionColor, conclusionLabel } from "lib/oot/ootUtils";
19+
import { conclusionColor, conclusionLabel } from "lib/crcr/crcrUtils";
2020
import useSWR from "swr";
2121

22-
interface OotPrResult {
22+
interface CrcrPrResult {
2323
downstream_repo: string;
2424
workflow_name: string;
2525
job_name: string;
@@ -36,11 +36,11 @@ interface OotPrResult {
3636
execution_time: number | null;
3737
}
3838

39-
export default function OotPrSection({ prNumber }: { prNumber: number }) {
40-
const url = `/api/clickhouse/oot_pr_results?parameters=${encodeURIComponent(
39+
export default function CrcrPrSection({ prNumber }: { prNumber: number }) {
40+
const url = `/api/clickhouse/crcr_pr_results?parameters=${encodeURIComponent(
4141
JSON.stringify({ pr: String(prNumber) })
4242
)}`;
43-
const { data, error } = useSWR<OotPrResult[]>(url, fetcher, {
43+
const { data, error } = useSWR<CrcrPrResult[]>(url, fetcher, {
4444
refreshInterval: 60_000,
4545
});
4646

@@ -64,7 +64,7 @@ export default function OotPrSection({ prNumber }: { prNumber: number }) {
6464
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
6565
<Stack direction="row" spacing={1} alignItems="center">
6666
<Typography variant="subtitle1">
67-
<strong>Out-of-Tree Backends</strong>
67+
<strong>Cross-Repo CI Backends</strong>
6868
</Typography>
6969
<Typography variant="body2" color="text.secondary">
7070
({summaryText})
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { getDynamoClient } from "lib/dynamo";
22

3-
const OOT_TABLE = "torchci-oot-workflow-job";
3+
const CRCR_TABLE = "torchci-oot-workflow-job";
44
const MAX_PAYLOAD_BYTES = 2 * 1024 * 1024; // 2MB
55

66
// ---- Types ----
@@ -55,7 +55,7 @@ export interface RelayPayload {
5555
untrusted: RelayUntrusted;
5656
}
5757

58-
export interface OotWorkflowJobRecord {
58+
export interface CrcrWorkflowJobRecord {
5959
dynamoKey: string;
6060
status: string;
6161
downstream_repo: string;
@@ -95,7 +95,7 @@ export function validatePayloadSize(bodyString: string): void {
9595

9696
export function extractDynamoRecord(
9797
payload: RelayPayload
98-
): OotWorkflowJobRecord {
98+
): CrcrWorkflowJobRecord {
9999
const { trusted, untrusted } = payload;
100100
const cb = untrusted.callback_payload;
101101
const wf = cb.workflow;
@@ -113,7 +113,7 @@ export function extractDynamoRecord(
113113
const runAttempt = Number(wf.run_attempt ?? 1) || 1;
114114
const dynamoKey = `${trusted.verified_repo}/${cb.delivery_id}/${wf.name}/${jobName}/${checkRunId}`;
115115

116-
const record: OotWorkflowJobRecord = {
116+
const record: CrcrWorkflowJobRecord = {
117117
dynamoKey,
118118
status: wf.status,
119119
downstream_repo: trusted.verified_repo,
@@ -177,7 +177,7 @@ export function extractDynamoRecord(
177177
// ---- DynamoDB Write (UpdateItem) ----
178178

179179
export async function writeToDynamo(
180-
record: OotWorkflowJobRecord
180+
record: CrcrWorkflowJobRecord
181181
): Promise<void> {
182182
const client = getDynamoClient();
183183

@@ -198,7 +198,7 @@ export async function writeToDynamo(
198198
}
199199

200200
await client.update({
201-
TableName: OOT_TABLE,
201+
TableName: CRCR_TABLE,
202202
Key: { dynamoKey: record.dynamoKey },
203203
UpdateExpression: `SET ${expressionParts.join(", ")}`,
204204
ExpressionAttributeValues: expressionValues,

torchci/pages/[repoOwner]/[repoName]/pull/[prNumber].tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { Stack } from "@mui/material";
22
import { CommitInfo } from "components/commit/CommitInfo";
33
import DrCIButton from "components/common/DrCIButton";
44
import ErrorBoundary from "components/common/ErrorBoundary";
5+
import CrcrPrSection from "components/crcr/CrcrPrSection";
56
import { useSetTitle } from "components/layout/DynamicTitle";
6-
import OotPrSection from "components/oot/OotPrSection";
77
import { fetcher } from "lib/GeneralUtils";
88
import { PRData } from "lib/types";
99
import { useRouter } from "next/router";
@@ -125,7 +125,7 @@ function Page() {
125125
</ErrorBoundary>
126126
<ErrorBoundary>
127127
{prNumber && repoOwner === "pytorch" && repoName === "pytorch" && (
128-
<OotPrSection prNumber={parseInt(prNumber as string)} />
128+
<CrcrPrSection prNumber={parseInt(prNumber as string)} />
129129
)}
130130
</ErrorBoundary>
131131
</div>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
extractDynamoRecord,
55
validatePayloadSize,
66
writeToDynamo,
7-
} from "lib/oot/ootUtils";
7+
} from "lib/crcr/crcrUtils";
88
import type { NextApiRequest, NextApiResponse } from "next";
99

1010
export const config = {
@@ -49,7 +49,7 @@ export default async function handler(
4949
if (err instanceof ApiError) {
5050
return res.status(err.statusCode).json({ error: err.message });
5151
}
52-
console.error("OOT results handler error:", err);
52+
console.error("CRCR results handler error:", err);
5353
return res
5454
.status(500)
5555
.json({ error: "Internal error writing to DynamoDB" });

0 commit comments

Comments
 (0)