-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache bundle graph on failure #9366
Conversation
|
||
let bundleGraphPath = path.join( | ||
resolvedOptions.cacheDir, | ||
bundleGraphCacheKey + '-0', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is the best way to determine the bundleGraphPath. Currently being determined here . Which means if that changes, this code will break, but I have no way of accessing this function directly, so this is currently hardcoded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe getFilePath()
should be added to the Cache interface? /cc @JakeLane
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think that would be reasonable.
Though I think it would be more maintainable for the integration test if we used the cache interface to load the blob instead, as we're duplicating business logic here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the goal of the this change to be able to access the graphs via parcel-query? You could use that in the test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
↪️ Pull Request
This PR adds logic to write Parcel's bundle graph to the cache if an error occurs during bundling.
Currently Parcel’s
requestGraph
is written to the cache at the end of a build or when interrupted with ctrl-c. Parcel’sbundleGraph
is stored innode.value.results
in therequestGraph
and is written to the cache as part of therequestGraph
's write to cache. If an error occurs during bundling however, thebundleGraph
is never stored in arequestGraph
node and as a result isn't written to the cache. This PR adds code to also store thebundleGraph
in arequestGraph
node if an error occurs during bundling.Ideally, we'd eventually like to be able to replicate failed builds from the Parcel cache and this PR is a step towards that.
💻 Examples
NA
🚨 Test instructions
NA
✔️ PR Todo