Skip to content

ci-failures: fetch job logs gh 2.100 refuses to print - #2

Open
ChristoRibeiro wants to merge 1 commit into
AVGVSTVS96:mainfrom
ChristoRibeiro:ci-failures-escape-sequences
Open

ChristoRibeiro wants to merge 1 commit into
AVGVSTVS96:mainfrom
ChristoRibeiro:ci-failures-escape-sequences

Conversation

@ChristoRibeiro

Copy link
Copy Markdown

The bug

ci-failures.ts fetches job logs with gh api repos/{owner}/{repo}/actions/jobs/{id}/logs. gh 2.100 (2026-09-03) sanitizes API responses, and a response holding terminal escape sequences comes back as a single line:

the response contains terminal escape sequences; pass --allow-escape-sequences to output it anyway

jobLog treats that as the log body, so every colored job reports it as its log error and the snippet never appears — the script's main feature. Runner output is colored by default, so this hits most real failures.

Reproduced on facebook/react run 35477870663 with gh 2.100.0, node 24.19:

✗ (DevTools) Regression Tests · run 35477870663 · failure
  job: Run DevTools tests for versions (17.0) (failure), failed step: Run node ./scripts/jest/jest-cli.js …
    log: the response contains terminal escape sequences; pass --allow-escape-sequences to output it anyway

The fix

Pass --allow-escape-sequences, and retry without it when gh rejects it as an unknown flag, so gh < 2.100 keeps working. The retry is free: an unknown flag fails locally, before any request.

Then strip the sequences from the text the script keeps. Without that they land in the saved log file and in the ~45 lines that enter context, which is exactly the noise the script exists to avoid.

Same run after the patch:

    log: /var/folders/…/gh-ci-DgGAEU/105990461833-run-devtools-tests-for-versions-17-0.log (2996 lines)
    ┄ snippet ┄
    2026-09-20T00:09:18.7543763Z   ● Store › continues to consider Suspense boundary as blocking …
    2026-09-20T00:09:18.7544341Z     expect(received).toMatchInlineSnapshot(snapshot)
    …

Checked

  • 3 failing jobs on facebook/react 35477870663: snippets anchored on the jest failure, 2995-line log on disk, no escape sequence left in the file.
  • --json: runs[].jobs[].log still carries file and snippet.
  • Green run (cli/cli 35512564425): "nothing to report", exit 0.
  • --list -R cli/cli: unchanged.
  • The older-gh path is by inspection only — I have no gh < 2.100 here to run it against.

gh 2.100 sanitizes API responses: one holding terminal escape sequences is
replaced by "the response contains terminal escape sequences; pass
--allow-escape-sequences to output it anyway". Runner logs are full of them,
so every colored job lost its snippet and reported that line as its log error.

Pass the flag, and retry without it when gh rejects it as unknown, so older gh
keeps working. Strip the sequences from the text we keep: they would otherwise
land in the saved log file and in the ~45 lines that enter context.
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