OOT HUD: Add API endpoint, PR page integration, and replicator mapping (Part 3/3)#8112
Conversation
|
@subinz1 is attempting to deploy a commit to the Meta Open Source Team on Vercel. A member of the Team first needs to authorize it. |
|
This is Part 3 of 3 of the OOT HUD pipeline, split from #8069 per the suggestion from @malfet and @atalman. This PR contains the API endpoint, PR page integration, replicator mapping, and API handler tests — the final integration layer that ties everything together. PR Stack
Depends on: #8110 (Part 1) and #8111 (Part 2). All review feedback from #8069 has been incorporated. |
…t 1/3) (#8110) ## Summary This is **Part 1 of 3** of the OOT HUD pipeline, split from #8069 per reviewer request. This PR adds the foundational data layer for the Out-of-Tree (OOT) HUD: - **ClickHouse queries** for three views: OOT summary dashboard, per-backend dashboard, and PR-level results - **Shared utility library** (`torchci/lib/oot/ootUtils.ts`) with: - Relay payload types (`RelayTrusted`, `RelayWorkflow`, `RelayCallbackPayload`, etc.) - DynamoDB record extraction and validation (`extractDynamoRecord`) - UpdateItem write logic (`writeToDynamo`) - Payload size validation (`validatePayloadSize`) - UI helpers (`conclusionColor`, `conclusionLabel`) - `ApiError` class for structured HTTP error responses - **Unit tests** (`torchci/test/ootUtils.test.ts`) covering: - Field mapping and DynamoDB key construction - Required field validation (job_name, check_run_id) - Test result computation (total from passed+failed+skipped) - Timing metric handling - Payload size validation - UI helper functions ### PR Stack 1. **This PR** — OOT HUD: Add ClickHouse queries, utility library, and unit tests (Part 1/3) 2. #8111 — OOT HUD: Add frontend components — summary, dashboard, PR section (Part 2/3) 3. #8112 — OOT HUD: Add API endpoint, PR page integration, and replicator mapping (Part 3/3) ## Test Plan - `ootUtils.test.ts` covers all utility functions - ClickHouse queries can be tested once the `oot_workflow_job` table is created (see #8105)
8842fd1 to
d25f5e9
Compare
…rt 2/3) (#8111) ## Summary This is **Part 2 of 3** of the OOT HUD pipeline, split from #8069 per reviewer request. **Depends on:** #8110 (Part 1 — queries + utils + tests) This PR adds the frontend pages and components for the OOT HUD: - **OOT Summary page** (`torchci/pages/oot/index.tsx`) — aggregated view of all registered OOT backends with latest status, PR count, and success rates - **Per-backend dashboard** (`torchci/pages/oot/[org]/[repo].tsx`) — detailed job history per downstream repo with filtering - **OotPrSection component** (`torchci/components/oot/OotPrSection.tsx`) — shows OOT CI results inline on pytorch/pytorch PR pages All components consume the ClickHouse queries and utility library added in Part 1. ### PR Stack 1. #8110 — OOT HUD: Add ClickHouse queries, utility library, and unit tests (Part 1/3) 2. **This PR** — OOT HUD: Add frontend components — summary, dashboard, PR section (Part 2/3) 3. #8112 — OOT HUD: Add API endpoint, PR page integration, and replicator mapping (Part 3/3) ## Test Plan - Frontend pages can be verified via Vercel preview once dummy data is populated in the `oot_workflow_job` ClickHouse table (see #8105) - Components import from `ootUtils.ts` (Part 1) — no runtime dependencies on the API endpoint (Part 3)
|
@pytorchmergebot rebase -b main |
Add the final integration layer for the OOT HUD: - API endpoint (pages/api/oot/results.ts) that receives relay callbacks with timing-safe token auth, payload validation, and DynamoDB writes via UpdateItem - PR page integration: render OotPrSection on pytorch/pytorch PRs inside an ErrorBoundary - ClickHouse replicator mapping for the torchci-oot-workflow-job DynamoDB table - API handler tests (ootResults.test.ts) covering auth, validation, DynamoDB write success/failure, and string body parsing This is Part 3 of the OOT HUD pipeline split from pytorch#8069.
d25f5e9 to
c927602
Compare
|
Is there any non-synthetic data in DB one can use to actually see how it will render? (Because the hook exists, isn't it?) |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| )} | ||
| </ErrorBoundary> | ||
| <ErrorBoundary> | ||
| {prNumber && repoOwner === "pytorch" && repoName === "pytorch" && ( |
There was a problem hiding this comment.
Why are we building it exclusive to pytorch/pytorch? It should apply to any repo, shouldn't it?
There was a problem hiding this comment.
Yes, but for now we are focusing on pytorch/pytorch repo as confirmed by Alban in the "Sync on Cross-Repository CI Relay for PyTorch Out-of-Tree Backends" call on Tuesday,
Hello @malfet, The ClickHouse table has seed data from @atalman — you can see it at: https://hud.pytorch.org/api/clickhouse/oot_summary?parameters={"days":"14"} It returns 3 backends (intel/intel-extension-for-pytorch, pytorch-labs/ascend-pytorch, pytorch-labs/cambricon-pytorch) with ~150 total jobs. Real production data will flow once downstream repos onboard to L2. |
|
A rebase fixes the build now, I'm going to merge this |
Summary
This is Part 3 of 3 of the OOT HUD pipeline, split from #8069 per reviewer request.
Depends on: #8110 (Part 1) and #8111 (Part 2)
This PR adds the final integration layer for the OOT HUD:
torchci/pages/api/oot/results.ts) — receives relay callbacks with:crypto.timingSafeEqual)OotPrSectiononpytorch/pytorchPRs inside an ErrorBoundarytorchci-oot-workflow-jobDynamoDB table to the replicator Lambdatorchci/test/ootResults.test.ts) covering:PR Stack
Test Plan
ootResults.test.tscovers the API handler end-to-end (mocked DynamoDB)