fix: end a build whose output report has nowhere to go - #362
Merged
Merged
Conversation
`writeOutputFile` guards against a compiler with no output file system by returning from inside the promise it answers with — which settles nothing. What awaits it is `processAssets`'s own callback, so the guard did not skip the write, it hung the build: no error, no report, no end. It answers now, which is what the guard meant to do.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #362 +/- ##
==========================================
+ Coverage 98.69% 99.52% +0.83%
==========================================
Files 6 17 +11
Lines 230 4252 +4022
Branches 65 0 -65
==========================================
+ Hits 227 4232 +4005
- Misses 3 20 +17 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Summary
writeOutputFileguards against a compiler with nooutputFileSystem:The
returnleaves the promise unsettled. What awaits it isprocessAssets's owncallback, throughawait Promise.all(...)over theoutputReportwrites — so the guard did not skip the write, it hung the build. No error, no report, no end. Confirmed by calling it with a compiler that has no file system: the promise is still pending after 1.5s.It answers now, which is what the guard meant to do.
What kind of change does this PR introduce?
fix.
Did you add tests for your changes?
Yes —
test/utils.test.jsraces the call against a timer and asserts it answered. Against unmodifiedsrc/it fails with'never answered'; a first version of it let the process exit instead, so the timer is no longer unref'd and the regression fails rather than cancelling the suite.Does this PR introduce a breaking change?
No.
If relevant, what needs to be documented once your changes are merged or what have you already documented?
n/a.
Use of AI
AI was used. It was asked for a small bug to exercise the release workflow with, picked this one out of an earlier audit, reproduced the unsettled promise before changing anything, and wrote the fix and the test.
🤖 Generated with Claude Code
https://claude.ai/code/session_01GzZci4NQeiqwdrVfd7dGXy
Generated by Claude Code