Fix: surface the failing grunt task/error instead of the whole build transcript#262
Open
taylortom wants to merge 1 commit into
Open
Fix: surface the failing grunt task/error instead of the whole build transcript#262taylortom wants to merge 1 commit into
taylortom wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Improves adaptBuild’s grunt failure reporting by extracting a concise, root-cause-oriented error string instead of rejecting with the entire grunt stdout transcript, while preserving the full stdout log on the error object for debugging.
Changes:
- Update stdout parsing to prefer
>> Error:task messages, then bareError:lines, thenWarning: Task "…" failedlines. - Attach the full
stdouttranscript to the thrown error (error.stdout) while keeping the concise message onerror.raw.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+35
to
+41
| const matches = stdout.match(/>> Error:\s(.+)/) || | ||
| stdout.match(/^Error:\s(.+)/m) || | ||
| stdout.match(/(Warning: Task .+ failed)/); | ||
| const e = new Error('grunt tasks failed') | ||
| e.cmd = cmd; | ||
| e.raw = matches?.[1] ?? stdout; | ||
| e.stdout = stdout; |
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.
Fix
adaptBuildrejected with the entire grunt transcript as the error message (the>> Error:regex only matched grunt's own task warnings, so anything else — e.g. a rollup "Could not load …" failure from thejavascripttask, which prints a bareError:line — fell through to dumping all of stdout). It now extracts just the salient failure: a>> Error:task message, else a bareError:line, else the failing-taskWarning: Task "…" failedline, falling back to full stdout only when none is present. The full transcript is preserved onerror.stdoutfor debugging.Testing
javascript/rollup task fails (e.g. a module import that can't be resolved)..rawis now the concise root-cause line instead of the whole grunt transcript;.stdoutstill contains the full log.