nodejs / nodejs/node-core-utils

checkGitHubCI blocks indefinitely on orphaned check suites stuck in QUEUED

Đang mở
#1,160 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
JavaScript
Star
313
Fork
137
Merge trung bình
2 ngày 8 giờ
Pull request đã merge (30 ngày)
24

Mô tả

Problem

checkGitHubCI() in pr_checker.js blocks landing with ✘ GitHub CI is still running when any GitHub Actions check suite has status !== 'COMPLETED'. However, GitHub occasionally creates check suites that remain stuck in QUEUED status with 0 check runs indefinitely — they are never dispatched and will never complete.

This has blocked at least two recent PRs on nodejs/node:

  • #64991Test macOS suite stuck 3+ days, landed manually
  • #64830 — same Test macOS suite stuck, landed manually

In both cases, the orphaned suite:

  • Has status: QUEUED, conclusion: null
  • Has 0 check runs (never started executing)
  • Has a valid workflowRun (Test macOS, workflow ID 858952)
  • Was created at the same time as sibling suites that completed fine
  • Never gets re-triggered by request-ci because GitHub sees it as already "queued"
  • The only workaround is a collaborator manually running git node land --yes

The commit-queue.sh pre-check (gh pr checks | grep pending) passes fine because it evaluates individual check runs (all completed), not suite containers.

Data

PR #64991, SHA 94a47d6f15b2:

  • 25 GitHub Actions suites total
  • 24 completed (success/skipped)
  • 1 orphaned: suite 84102428609, Test macOS, QUEUED, 0 check runs, created 2026-08-05T13:19:48Z

No newer run of Test macOS exists for this SHA — request-ci does not re-trigger a workflow GitHub considers already "queued."

Proposed fix

Consider a suite as orphaned and skip it if:

  • status !== 'COMPLETED'
  • checkRuns.nodes.length === 0 (nothing has ever executed inside it)
  • Suite age exceeds a configurable threshold (suggesting 3 hours since createdAt — legitimate suites dispatch runs within seconds)
if (status !== 'COMPLETED') {
  const runCount = checkRuns?.nodes?.length ?? 0;
  const ageMs = Date.now() - new Date(createdAt).getTime();
  if (runCount === 0 && ageMs > ORPHANED_SUITE_TIMEOUT) {
    cli.warn(`Ignoring orphaned check suite with no runs (status: ${status}, age: ${Math.round(ageMs / 3600000)}h)`);
    continue;
  }
  pendingJobs.push({ app: app.slug, status, conclusion });
  continue;
}

GraphQL change: add createdAt to the checkSuites query in PRCommits.gql.

Trade-offs

What this fixes: Orphaned suites no longer block the commit queue forever.

Risk: If someone adds commit-queue before request-ci has finished triggering all workflows, a suite that should have run but hasn't started yet (0 runs, within the threshold) could age past the timeout and get skipped — landing the PR without that test suite's results.

However, the current workaround (git node land --yes) already bypasses ALL checks — including real failures. A targeted skip of empty aged-out suites is strictly safer than the current manual workaround.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với checkGitHubCI() trong pr_checker.js và kiểm tra truy vấn checkSuites trong PRCommits.gql, sau đó so sánh dữ liệu suite của nó với hành vi kiểm tra trước của commit-queue.sh. Xác định và xác thực ngưỡng tuổi có thể cấu hình để các suite QUEUED trống, đã quá cũ không còn chặn việc landing, trong khi các suite đang hoạt động vẫn ở trạng thái đang chờ; xác nhận rằng cảnh báo nhận diện các suite mồ côi bị bỏ qua.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
github-actions, graphql, javascript
Lĩnh vực
ci-cd, cli
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
68/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.