Skip to content

Fix baseline generation hiding its own error behind progress-bar output - #1060

Merged
staabm merged 1 commit into
FriendsOfREDAXO:mainfrom
skerbis:fix/analyze-summary-baseline-no-progress
Sep 4, 2026
Merged

Fix baseline generation hiding its own error behind progress-bar output#1060
staabm merged 1 commit into
FriendsOfREDAXO:mainfrom
skerbis:fix/analyze-summary-baseline-no-progress

Conversation

@skerbis

@skerbis skerbis commented Sep 4, 2026

Copy link
Copy Markdown
Member

Summary

RexStan::generateAnalysisBaseline() (the "ignore all" button on the analysis page) and analyzeSummaryBaseline() (the summary page) invoke PHPStan without --no-progress, unlike every other PHPStan invocation in this file.

Depending on environment, PHPStan's progress-bar control characters end up interleaved into the captured stderr output. On failure that raw output lands directly in the thrown exception's message ("Unable to generate baseline: <progress-bar escape codes>"), making the actual underlying error unreadable. I hit this myself: a stale Nette container-cache directory was the real cause ("Unable to create file ..."), but it was completely buried under garbled control characters until I added --no-progress locally to see through it.

Both call sites now pass --no-progress, matching every other PHPStan invocation already in this file.

This is a standalone bugfix, split out from a larger PR per review feedback (one PR per bug) — see #1059. Two follow-up PRs build on top of this one for the actual feature.

Test plan

  • Reproduced the garbled-error symptom, confirmed root cause (stale cache), fixed, then verified --no-progress prevents the garbling regardless of the underlying cause.
  • php -l + PHPStan on the changed file: 0 findings.

🤖 Generated with Claude Code

…output

RexStan::generateAnalysisBaseline() and analyzeSummaryBaseline() (used
by the "ignore all" button on the analysis page and by the summary
page respectively) invoke PHPStan without --no-progress, unlike every
other PHPStan invocation in this file.

Depending on environment, PHPStan's progress-bar control characters
end up interleaved into the captured stderr output. On failure that
raw output is placed directly into the thrown exception's message
("Unable to generate baseline: <progress bar escape codes>"), making
the actual underlying error unreadable - encountered this while a
Nette container-cache directory had gone stale, where the real cause
("Unable to create file ...") was buried under garbled control
characters.

Both call sites now pass --no-progress, matching every other PHPStan
invocation already in this file.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@staabm
staabm merged commit 15a256e into FriendsOfREDAXO:main Sep 4, 2026
4 checks passed
@staabm

staabm commented Sep 4, 2026

Copy link
Copy Markdown
Member

Danke

@skerbis
skerbis deleted the fix/analyze-summary-baseline-no-progress branch September 4, 2026 11:31
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