#1150

fix(ci): wait for the lagging job list before judging full-queue evidence

Openiamgpwants to merge intofrom

Problem

Merge-queue run 41120003339 (PR #1214, queue SHA 6a8383f7) had every lane green, yet pr / required failed with Required job did not complete successfully at the exact SHA from scripts/ci_evidence.py.

emit() reads the run-attempt job list a few seconds after the last lane finishes. That list lags a job's own completion: 38 s after ci / ci / status had completed (the single-job endpoint reported completed / success), the job list still reported it as in_progress, so successful_jobs() rejected the run and the queue dropped the PR.

Change

  • settled_jobs() re-reads the job list, bounded to twelve reads ten seconds apart, until every expected job reports completed, and logs which jobs it is waiting on.
  • emit() judges the last read exactly as before: successful_jobs() still rejects incomplete, skipped, cancelled or failed required jobs, so the bound only turns a transient lag into the existing failure instead of hiding it.
  • reuse() is unchanged; it already requires the producer run itself to be completed.

The wait stays well inside the aggregate's 10-minute timeout (at most 110 s). Because policy_digest() covers scripts/, this change invalidates reuse of queue evidence produced before it, which is the intended behaviour for any validation-policy change.

Tests

Two regression tests in tests/scripts/test_ci_evidence.py: one reproduces the lag (two in_progress reads, then settled) and asserts the evidence is accepted after two sleeps; one asserts the read count is bounded and that a job that never settles is still rejected.

  • uv run --locked pytest tests/scripts/test_ci_evidence.py -q → 76 passed
  • uv run --locked pytest tests/tooling/test_pr_validation.py -q → 182 passed
  • uv run --locked ruff check / ruff format --check clean on both files

    

Activity

309
coldtea-pr-lens[bot]6h ago
  • Redraw · drawn at add8d00, the branch has moved on

Architecture


Data flow


Review

✨ Nothing flagged · reviewed add8d00


TIP

Set github.draw: on-demand in .github/pr-lens.yml and PR Lens stops drawing pull requests on its own. Comment @pr-lens draw on a pull request when you want that one drawn

🪧 More tips
  • Run npx skills add coldteadotai/pr-lens, then tell your coding agent: "Diagram the change you just made with PR Lens and attach it to the pull request."
  • Run npx @coldtea/pr-lens-cli analyze --base origin/main on a branch, then npx @coldtea/pr-lens-cli render .pr-lens/graph.json. Same lenses, your own model key, before the pull request exists
  • Click the link under each diagram to open it on a canvas you can zoom, pan and step through
  • The diagrams are links. Click one to open it on the canvas, then press W or click play to walk through the change
  • Open a diagram on the canvas, then press W or click play to walk through the change one step at a time
  • The CLI's render reads .github/pr-lens.yml and applies your renames, exclusions and lane pins at draw time
  • Set github.comment.collapsed: true in .github/pr-lens.yml to fold the comment behind one View architecture… row. Drawing still runs as before
  • Add .github/workflows/pr-lens.yml with coldteadotai/pr-lens/packages/action@v0 and your model provider's key as its api-key to run PR Lens from your own CI. Any /chat/completions endpoint works
  • After a push, tick Redraw to draw the latest commit
  • Switch GitHub to dark mode and the diagrams follow. The moving dots are this pull request's data in motion
  • Set github.description: false in .github/pr-lens.yml to stop PR Lens adding buttons to your PR descriptions

Thanks for using PR Lens! It's free for OSS. If it helped, a star helps other teams find it.