Skip to content

Add triage-ci-failures skill for red PR checks - #15336

Merged
cderv merged 5 commits into
mainfrom
feature/ci-failure-triage-skill
Nov 10, 2026
Merged

cderv merged 5 commits into
mainfrom
feature/ci-failure-triage-skill

Conversation

@cderv

@cderv cderv commented Nov 10, 2026

Copy link
Copy Markdown
Member

Description

A dependency bump such as Pandoc 3.13 (#15320) turns a PR red across dozens of test bucket and OS jobs, each log several hundred KB. Check-run annotations only name the bucket, and gh run view --log silently truncates near 750 KB, so finding which tests failed meant pulling raw logs into the agent's context.

This adds a project skill, triage-ci-failures, with a script that does the digging:

  • It takes a PR number (every failing run on the head commit) or a run id, and downloads the failed-job logs through the jobs/ID/logs endpoint, cached per job id.
  • It prints one row per unique failing test with the OSes it failed on and the assertion message. When the failure is a missing output file, the row shows the render error from the end of the test output instead.
  • Step errors are reported only for jobs with no failing test, since smoke jobs echo each failed bucket there. Jobs whose log shape is not parsed (Playwright and feature-format-matrix are unverified) are listed with their log path.

The skill then has the agent group rows by cause and classify each cause as dependency output drift or a regression before changing any assertion or snapshot. Updating a snapshot to match new output is the easy move on a bump PR, so the skill makes the verdict explicit first.

On #15320 the digest reports the 18 unique failing tests and the runtime-boundary error in about 8.5 KB.

Checklist

I have (if applicable):

  • referenced the GitHub issue this PR closes
  • updated the appropriate changelog in the PR
  • ensured the present test suite passes
  • added new tests
  • created a separate documentation PR in Quarto's website repo and linked it to this PR
AI-assisted PR
  • AI tool used: Claude Code
  • Codebase grounding: local clone
  • Human review: I have reviewed, tested, and verified the AI-generated content before submitting.

Note: autonomous AI agents submitting PRs without human oversight are not permitted — see the Code of Conduct.

A dependency bump like Pandoc 3.13 turns a PR red across dozens of
bucket x OS jobs, each log several hundred KB. Check-run annotations
only name the bucket, and `gh run view --log` silently truncates near
750 KB, so finding which tests failed meant pulling raw logs into
context.

The script takes a PR number (every failing run on the head commit)
or a run id, caches failed-job logs per job id via the jobs/ID/logs
endpoint, and prints one row per unique failing test with the OSes it
failed on and the verify message. When verify hits a missing output
file, the row shows the render error from the OUTPUT tail instead.
`##[error]` lines are reported only for jobs with no failing test,
since smoke jobs echo each failed bucket there. Jobs whose log shape
is not parsed (Playwright, ff-matrix are unverified) are listed with
their log path.

The skill then has the agent group rows by cause and classify each as
dependency output drift or a regression before touching assertions
or snapshots.

On PR #15320 it reports the 18 failing tests plus the runtime-boundary
error in about 6 KB.
- Capture the assertion message up to the stack trace (max 6 lines).
  noErrors and noErrorsOrWarnings put the actual errors after a
  generic first line, which the digest dropped.
- Treat "No output created message" and "Path ... doesn't exist" as a
  failed render, like an OS NotFound, and show the OUTPUT tail.
- A FAILED test with no TEST FAILURE block (prereq or teardown-only
  failure, which test.ts rethrows undecorated) now names the log to
  grep instead of printing an empty row.
- Download logs to a .part file and rename on success, so a failed
  fetch is retried next run instead of being cached truncated.

The PR #15320 digest is unchanged. The new shapes were checked on a
log written in the test.ts failure format.
A Sass failure reaches noErrorsOrWarnings as "Theme file compilation
failed:\n\n<diagnostics>" (src/core/dart-sass.ts), and the diagnostics
start with "Error:". Stopping the message at a blank line, or at any
"Error:" line, dropped the compiler error.

The message now ends at the stack trace, recognised as "at" frames or
as "<ErrorName>: <first message line>", the line JS stacks begin with.
Blank lines are skipped. XPath and layout verifiers append the whole
document after "... follows:", so capture ends at that line; the blank
line had been doing that job before.

The PR #15320 digest only gains the "Path:" line of the NotFound
message.
test-smokes.yml names jobs "Run smoke (<os>)" plus an optional
" with timed file" or " - with some extra R packages". Requiring the
parenthesis at the end of the name made those rows show the full job
name instead of the OS.
A merged test row can contain failures with different causes. Identify the representative excerpt's OS and job and list all contributing logs so those differences can be checked before grouping failures by cause.

Clarify that missing output and failures limited to one OS require investigation before assigning a cause.

Verified on PR #15320: 18 unique failing tests and the runtime-boundary error, with the render diagnostics preserved in an 8.5 KB digest. Shell syntax and diff checks pass.
@posit-snyk-bot

posit-snyk-bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@cderv
cderv merged commit ac310a4 into main Nov 10, 2026
2 checks passed
@cderv
cderv deleted the feature/ci-failure-triage-skill branch November 10, 2026 16:55
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.

2 participants