From fecf20d45a3b4c437e73a2abb664000718f0fd81 Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Wed, 28 Oct 2026 12:37:37 +0000 Subject: [PATCH 1/2] ci: Upload the weekly flaky test report as an artifact The report only lived in the job summary, which the GitHub API doesn't return, so tooling had to rebuild it from scratch. Also write it as Markdown and JSON and upload both as the flaky-tests-report artifact, kept for 15 days. Co-Authored-By: Francesco Gringl-Novy --- .github/workflows/weekly-flaky-tests.yml | 6 ++++++ scripts/weekly-flaky-tests.mjs | 19 ++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/weekly-flaky-tests.yml b/.github/workflows/weekly-flaky-tests.yml index bb0e5b3866c9..23d0f340b174 100644 --- a/.github/workflows/weekly-flaky-tests.yml +++ b/.github/workflows/weekly-flaky-tests.yml @@ -33,3 +33,9 @@ jobs: `${process.env.GITHUB_WORKSPACE}/scripts/weekly-flaky-tests.mjs` ); await run({ github, context, core }); + - name: Upload the report + uses: actions/upload-artifact@v7 + with: + name: flaky-tests-report + path: flaky-tests-report/ + retention-days: 15 diff --git a/scripts/weekly-flaky-tests.mjs b/scripts/weekly-flaky-tests.mjs index f3ab63d8016a..fa921ac95827 100644 --- a/scripts/weekly-flaky-tests.mjs +++ b/scripts/weekly-flaky-tests.mjs @@ -1,5 +1,8 @@ +import { mkdir, writeFile } from 'node:fs/promises'; + const LOOKBACK_DAYS = 7; const CONCURRENT_RUNS = 4; +const REPORT_DIR = 'flaky-tests-report'; function normalizeJobName(name) { return name @@ -178,11 +181,25 @@ export function renderReport(report, context) { return `${lines.join('\n')}\n`; } +function serializeReport(report) { + return { + ...report, + tests: report.tests.map(test => ({ + ...test, + runs: [...test.runs].sort(([a], [b]) => b - a).map(([runId, jobUrl]) => ({ runId, jobUrl })), + })), + }; +} + export default async function run({ github, context, core }) { const report = await collectReport({ github, context, core }); for (const warning of report.warnings) { core.warning(warning); } - await core.summary.addRaw(renderReport(report, context)).write(); + const markdown = renderReport(report, context); + await core.summary.addRaw(markdown).write(); + await mkdir(REPORT_DIR, { recursive: true }); + await writeFile(`${REPORT_DIR}/report.md`, markdown); + await writeFile(`${REPORT_DIR}/report.json`, `${JSON.stringify(serializeReport(report), null, 2)}\n`); return report; } From 76f2703386c2b3c01525b7247f9ef09b040a022d Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Wed, 28 Oct 2026 12:44:51 +0000 Subject: [PATCH 2/2] ci: Only upload the Markdown flaky test report The Markdown report has everything tooling needs, so drop the JSON copy. Co-Authored-By: Francesco Gringl-Novy --- scripts/weekly-flaky-tests.mjs | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/scripts/weekly-flaky-tests.mjs b/scripts/weekly-flaky-tests.mjs index fa921ac95827..db00689db3ca 100644 --- a/scripts/weekly-flaky-tests.mjs +++ b/scripts/weekly-flaky-tests.mjs @@ -181,16 +181,6 @@ export function renderReport(report, context) { return `${lines.join('\n')}\n`; } -function serializeReport(report) { - return { - ...report, - tests: report.tests.map(test => ({ - ...test, - runs: [...test.runs].sort(([a], [b]) => b - a).map(([runId, jobUrl]) => ({ runId, jobUrl })), - })), - }; -} - export default async function run({ github, context, core }) { const report = await collectReport({ github, context, core }); for (const warning of report.warnings) { @@ -200,6 +190,5 @@ export default async function run({ github, context, core }) { await core.summary.addRaw(markdown).write(); await mkdir(REPORT_DIR, { recursive: true }); await writeFile(`${REPORT_DIR}/report.md`, markdown); - await writeFile(`${REPORT_DIR}/report.json`, `${JSON.stringify(serializeReport(report), null, 2)}\n`); return report; }