Skip to content

fix(ci): cancel unfinished validation when a PR closes - #1966

Merged
ldm0 merged 1 commit into
mainfrom
codex/fix-closed-pr-ci-cancellation
Oct 24, 2026
Merged

ldm0 merged 1 commit into
mainfrom
codex/fix-closed-pr-ci-cancellation

Conversation

@ldm0

@ldm0 ldm0 commented Oct 24, 2026

Copy link
Copy Markdown
Member

Closing or merging a PR stopped cancelling its CI after commit 1d92366 removed the main workflow's concurrency group. The old close handler still depended on that group and only printed a cancellation message.

Replace it with a trusted pull_request_target: closed handler that cancels every unfinished ci.yml run for the PR, including queued runs for older revisions. Recheck that the PR is still closed before acting. When GitHub returns empty PR associations after closure, match the source repository, branch, and PR lifetime; this also covers force-pushed revisions. Cancellation conflicts are ignored only after confirming that the run completed, and API errors remain failures.

Validation:

  • 29 Node helper tests passed, including pagination, closed PRs with empty run associations, fork and branch reuse boundaries, reopened PRs, completion races, and API failures.
  • 155 CDP harness Python tests passed.
  • actionlint v1.7.12 passed for the changed workflow.
  • Read-only simulation using PR fix(html2md): preserve media resources and readable controls #1334's actual closed-PR and CI metadata confirmed the empty-association fallback. No live runs were cancelled.

@github-actions

Copy link
Copy Markdown

Spider Bench A/B

✅ All benchmark browser service runs completed; results are informational.

Public HEAD: 184 / 240 rows; 38 / 48 sites produced rows; 10 unexpected empty sites.

✅ Deterministic fixture contract is clean.

Common ancestor 4487138ce795 → HEAD 918aaf11c7b6; benchmark order: head-first; workflow: success.

Public 48-site run · informational

Metric Base HEAD Δ
Run status success success —
Extracted rows / contract 189 / 240 184 / 240 -5 (-2.65%)
Contract fill 78.75% 76.67% -2.08 pp (-2.64%)
Sites with rows 39 / 48 38 / 48 -1 (-2.56%)
Sites meeting row contract 37 / 48 36 / 48 -1 (-2.70%)
Unexpected empty sites 9 10 +1 (+11.11%)
Partial-row sites 2 2 0 (0.00%)
Site outcomes extracted: 38; HTTP error + rows: 1; empty: 7; HTTP error + empty: 1; snapshot error + empty: 1 extracted: 36; HTTP error + rows: 2; empty: 7; HTTP error + empty: 1; snapshot error + empty: 2 —
Observed duration 46.04 s 57.52 s +11.49 s (+24.95%)
Estimated CPU 40.14 s 42.19 s +2.05 s (+5.10%)
Peak PSS 281.16 MiB 207.34 MiB -73.81 MiB (-26.25%)
Peak RSS 284.08 MiB 210.57 MiB -73.51 MiB (-25.88%)
Peak threads 26 26 0 (0.00%)
Mismatched sites 0 0 0
Timeout with items 0 0 0
Category rows Base HEAD Δ
news 35 / 40 35 / 40 0
stocks 20 / 40 20 / 40 0
tech 35 / 40 35 / 40 0
sports 27 / 40 27 / 40 0
games 37 / 40 37 / 40 0
life 35 / 40 30 / 40 -5

Public-site content, timing, and memory are noisy. This single A/B run reports evidence only; site outcome counts explain missing rows without treating them as a deterministic regression.

CPU and memory timelines

These are bounded 40-point views of the same complete process-tree samples used by the HTML report. CPU uses 100% per occupied logical core; memory lines are RSS first and PSS second when complete PSS samples are available.

Base

xychart-beta
    title "Base CPU"
    x-axis "Elapsed seconds" [1.036, 1.536, 2.537, 4.038, 5.039, 6.542, 7.543, 9.046, 10.047, 11.55, 13.053, 14.053, 15.554, 16.557, 18.058, 18.559, 19.06, 20.562, 21.563, 22.565, 23.066, 24.567, 25.567, 27.069, 28.071, 29.572, 30.574, 32.076, 33.078, 34.579, 36.081, 37.082, 38.585, 39.587, 41.087, 42.088, 43.589, 44.59]
    y-axis "CPU percent" 0 --> 200
    line [27.93, 123.9, 125.87, 144.06, 127.7, 91.81, 131.95, 133.73, 131.77, 3.99, 2, 0, 133.94, 79.82, 31.96, 153.74, 89.85, 103.81, 125.95, 107.87, 107.83, 123.96, 67.99, 99.79, 101.95, 79.8, 33.98, 115.7, 3.99, 37.9, 6, 53.87, 99.91, 99.73, 99.89, 123.87, 109.91, 107.76]
Loading
xychart-beta
    title "Base memory: RSS then PSS"
    x-axis "Elapsed seconds" [0.034, 1.036, 1.536, 2.537, 4.038, 5.039, 6.542, 7.543, 9.046, 10.047, 11.55, 13.053, 14.053, 15.554, 16.557, 18.058, 18.559, 19.06, 20.562, 21.563, 22.565, 23.066, 24.567, 25.567, 27.069, 28.071, 29.572, 30.574, 32.076, 33.078, 34.579, 36.081, 37.082, 38.585, 39.587, 41.087, 42.088, 43.589, 44.59, 46.038]
    y-axis "Memory MiB" 0 --> 500
    line [12.91, 83.19, 101.06, 107.06, 135.77, 146.96, 121.05, 134.92, 149.39, 144.54, 118.09, 121.79, 120.43, 157.43, 116.59, 130.79, 141.91, 160.91, 123.55, 180.39, 284.08, 197.5, 211.74, 144.32, 137.43, 132.81, 139.52, 139.31, 187.98, 138.35, 141.93, 139.41, 138.75, 168.16, 168.38, 168.39, 163, 139.81, 138.18, 0]
    line [10.03, 80.24, 98.03, 104.62, 131.91, 143.93, 118, 131.96, 146.38, 141.58, 115.19, 118.89, 117.54, 154.54, 113.67, 127.97, 139.06, 158.12, 120.63, 177.5, 281.16, 190.28, 208.68, 141.46, 134.53, 129.88, 136.44, 136.12, 184.8, 135.42, 138.84, 136.31, 135.7, 165.07, 165.28, 165.3, 159.9, 136.72, 135.31, 0]
Loading

HEAD

xychart-beta
    title "HEAD CPU"
    x-axis "Elapsed seconds" [1.537, 3.04, 5.042, 5.543, 6.544, 8.047, 9.549, 11.05, 13.053, 14.555, 16.056, 17.057, 17.558, 19.059, 21.062, 22.565, 24.064, 25.565, 27.068, 29.071, 30.573, 32.076, 33.577, 35.08, 36.582, 37.583, 38.585, 40.087, 41.588, 43.09, 44.591, 46.595, 48.097, 49.599, 51.102, 52.604, 54.607, 56.11]
    y-axis "CPU percent" 0 --> 200
    line [107.83, 109.79, 145.94, 167.91, 149.85, 119.88, 65.85, 111.92, 69.89, 113.83, 19.97, 0, 3.99, 0, 0, 5.99, 28, 59.95, 13.97, 2, 133.8, 73.86, 127.87, 113.67, 115.89, 137.82, 67.82, 81.96, 61.85, 27.97, 107.95, 57.87, 51.92, 2, 3.99, 13.97, 155.92, 97.78]
Loading
xychart-beta
    title "HEAD memory: RSS then PSS"
    x-axis "Elapsed seconds" [0.034, 1.537, 3.04, 5.042, 5.543, 6.544, 8.047, 9.549, 11.05, 13.053, 14.555, 16.056, 17.057, 17.558, 19.059, 21.062, 22.565, 24.064, 25.565, 27.068, 29.071, 30.573, 32.076, 33.577, 35.08, 36.582, 37.583, 38.585, 40.087, 41.588, 43.09, 44.591, 46.595, 48.097, 49.599, 51.102, 52.604, 54.607, 56.11, 57.524]
    y-axis "Memory MiB" 0 --> 500
    line [13.05, 95.46, 130.04, 162.02, 169.63, 189.2, 201.84, 119.11, 158.83, 140.12, 147.41, 122, 118.95, 117.02, 117.09, 118.61, 118.32, 125.86, 139.94, 140.31, 117.95, 133.45, 135.51, 155, 196.88, 184.68, 210.57, 135.48, 162.11, 131.53, 136.11, 130.91, 169.38, 139.8, 138.98, 126.13, 131.79, 162.85, 142.81, 0]
    line [10.13, 92.43, 127.8, 159.09, 166.56, 186.14, 198.76, 116.02, 155.75, 137.03, 144.33, 118.91, 115.87, 113.94, 114, 115.53, 115.24, 122.74, 136.86, 137.23, 114.87, 130.42, 132.57, 152.25, 193.32, 181.63, 207.34, 132.51, 159.15, 128.49, 133.07, 128.63, 167.38, 135.99, 135.84, 122.98, 128.87, 159.7, 139.73, 0]
Loading

Deterministic fixture · required contract

The fixture exercises 15 routes: 8 are expected to emit rows and 7 intentionally exercise empty, loading, or timeout behavior.

Metric Base HEAD Δ
Run status success success —
Extracted rows / contract 40 / 40 40 / 40 0 (0.00%)
Contract fill 100.00% 100.00% 0.00 pp (0.00%)
Sites with rows 8 / 15 8 / 15 0 (0.00%)
Sites meeting row contract 15 / 15 15 / 15 0 (0.00%)
Unexpected empty sites 0 0 0
Partial-row sites 0 0 0
Site outcomes extracted: 7; HTTP error + rows: 1; empty: 3; timeout + empty: 4 extracted: 7; HTTP error + rows: 1; empty: 3; timeout + empty: 4 —
Observed duration 19.85 s 19.85 s +0.00 s (+0.02%)
Estimated CPU 0.41 s 0.40 s -0.01 s (-2.43%)
Peak PSS 66.30 MiB 66.40 MiB +0.10 MiB (+0.15%)
Peak RSS 69.33 MiB 69.39 MiB +0.06 MiB (+0.09%)
Peak threads 18 18 0 (0.00%)
Mismatched sites 0 0 0
Timeout with items 0 0 0

Full HTML, JSON, CSV, logs, and page snapshots: workflow run and full spider-bench-results artifact.

The public-web A/B is informational. The exact HEAD fixture contract runs as a separate required CI check; timing and public-site content deltas remain non-blocking.

@ldm0
ldm0 merged commit 5021daf into main Oct 24, 2026
17 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant