ci-failures: fetch job logs gh 2.100 refuses to print - #2
Open
ChristoRibeiro wants to merge 1 commit into
Open
ChristoRibeiro wants to merge 1 commit into
ChristoRibeiro wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
ci-failures.tsfetches job logs withgh 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:jobLogtreats 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/reactrun 35477870663 with gh 2.100.0, node 24.19: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:
Checked
facebook/react35477870663: snippets anchored on the jest failure, 2995-line log on disk, no escape sequence left in the file.--json:runs[].jobs[].logstill carriesfileandsnippet.cli/cli35512564425): "nothing to report", exit 0.--list -R cli/cli: unchanged.