Skip to content

Commit a910c51

Browse files
committed
fix(ci): switch fetch-test-timing.mjs to Codecov's test-analytics endpoint
test-results/ is deprecated -- confirmed live, running test-timing-refresh.yml via workflow_dispatch returned a 301 pointing at test-analytics/ instead ("This endpoint has been deprecated. Please use /test-analytics/ instead."). Verified via Codecov's own live OpenAPI schema that the replacement returns the identical PaginatedTestrunList wrapper and Testrun field shape, so this is a pure URL fix -- nothing else in the aggregation logic needed to change.
1 parent 09b028c commit a910c51

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

scripts/fetch-test-timing.mjs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
// existing CODECOV_TOKEN secret -- that one is an upload-only token and doesn't authenticate this read
1515
// API. Codecov's docs don't publish a numeric rate limit for this endpoint, so this is deliberately run
1616
// on a schedule (test-timing-refresh.yml), not per-PR.
17+
//
18+
// Uses /test-analytics/, not /test-results/: the latter is now deprecated (confirmed by actually
19+
// running this script -- Codecov returns a 301 with "This endpoint has been deprecated. Please use
20+
// /test-analytics/ instead."). Verified via Codecov's live OpenAPI schema (api.codecov.io/api/v2/schema/)
21+
// that /test-analytics/ returns the identical PaginatedTestrunList wrapper and Testrun field shape
22+
// (filename, duration_seconds, commit_sha, etc.) -- a URL rename, not a schema change, so nothing else
23+
// in this file needed to change.
1724

1825
import { writeFileSync } from "node:fs";
1926

@@ -47,7 +54,7 @@ async function fetchWithRetry(url, maxAttempts = 4) {
4754

4855
async function fetchAllTestRuns() {
4956
const rows = [];
50-
let url = `https://api.codecov.io/api/v2/gh/${owner}/repos/${repoName}/test-results/?branch=main&page_size=100`;
57+
let url = `https://api.codecov.io/api/v2/gh/${owner}/repos/${repoName}/test-analytics/?branch=main&page_size=100`;
5158
let pages = 0;
5259
while (url && pages < MAX_PAGES) {
5360
const body = await fetchWithRetry(url);

0 commit comments

Comments
 (0)