From 73b747bbdb4f06c31ee437198f578f72bf27891e Mon Sep 17 00:00:00 2001 From: Charan Jagwani Date: Thu, 11 Jun 2026 10:00:56 -0700 Subject: [PATCH] fix(ci): bucket cancelled jobs in Selective E2E Results comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Selective E2E Results comment script at .github/workflows/nightly-e2e.yaml bucketed job results into passed / failed / skipped but never accounted for `cancelled`. A job ending in `cancelled` (e.g. when cancel-in-progress kills a stale run) slipped past all three tallies and fell through to the default "✅ All requested jobs passed" status, with the summary line reading "0 passed, 0 failed, 0 skipped" — masking the fact that the run produced no signal. Observed on #5085 (the cancel-in-progress run against `026802ba8` listed two cancelled jobs but still posted the green check) and earlier on #4610. Fix: - Add a `cancelled` bucket derived the same way as the other tallies. - Insert a status branch between the failure case and the no-ran case: when cancelled jobs are present and nothing passed, surface "⚠️ Run cancelled — no signal" instead of falsely claiming success. - Include cancelled count in the summary line so the bucket is visible even when other states are zero. No other behavior changes — successful, failed, and skipped runs continue to render exactly as before. Signed-off-by: Charan Jagwani --- .github/workflows/nightly-e2e.yaml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/nightly-e2e.yaml b/.github/workflows/nightly-e2e.yaml index 9aab20e6dad..b86d9aa58bd 100644 --- a/.github/workflows/nightly-e2e.yaml +++ b/.github/workflows/nightly-e2e.yaml @@ -2486,13 +2486,21 @@ jobs: const passed = ran.filter(([, v]) => v.result === 'success'); const failed = ran.filter(([, v]) => v.result === 'failure'); const skipped = reportedEntries.filter(([, v]) => v.result === 'skipped'); + // Cancelled jobs (e.g. cancel-in-progress superseding an older run) + // are neither success, failure, nor skipped. Without a bucket for + // them they slipped through the status tally and the comment fell + // through to the default "✅ All requested jobs passed" — masking + // the fact that the run produced no signal at all. + const cancelled = ran.filter(([, v]) => v.result === 'cancelled'); const status = failed.length > 0 || missingRequested.length > 0 ? '❌ Some jobs failed' - : skipped.length > 0 && passed.length === 0 - ? '⚠️ No requested jobs ran' - : '✅ All requested jobs passed'; + : cancelled.length > 0 && passed.length === 0 + ? '⚠️ Run cancelled — no signal' + : skipped.length > 0 && passed.length === 0 + ? '⚠️ No requested jobs ran' + : '✅ All requested jobs passed'; const body = [ `### Selective E2E Results — ${status}`, @@ -2501,7 +2509,7 @@ jobs: `**Target ref:** \`${displayRef}\``, targetRef ? `**Workflow ref:** \`${workflowBranch}\`` : undefined, requestedJobs ? `**Requested jobs:** \`${requestedJobs}\`` : '**Requested jobs:** all (no filter)', - `**Summary:** ${passed.length} passed, ${failed.length} failed, ${skipped.length} skipped`, + `**Summary:** ${passed.length} passed, ${failed.length} failed, ${cancelled.length} cancelled, ${skipped.length} skipped`, '', '| Job | Result |', '|-----|--------|',