-
Notifications
You must be signed in to change notification settings - Fork 57
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
fix: fail build when extension failed to be retrieved #5915
base: main
Are you sure you want to change the base?
Conversation
This pull request adds or modifies JavaScript ( |
// TODO: We should consider blocking the build as integrations are a critical part of the build process | ||
// https://linear.app/netlify/issue/CT-1214/implement-strategy-in-builds-to-deal-with-integrations-that-we-fail-to | ||
return [] | ||
throwUserError(`Failed to parse extensions for site ${siteId}: ${error.message}. ${ERROR_CALL_TO_ACTION}`) |
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.
Learning - What is the failure scenario here? Response is a 200, but the integration returns an object that is not parsable to json? How can this occur?
Since it's expected behaviour, could we add a test case for this scenario?
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.
This is what we return from the Jigsaw API, and it seems that if we return a 200 status, it should always return an object that is parseable as JSON.
I was a bit wary of how it was written before, where we caught all errors and returned an empty array. This made me wonder if there were some edge cases I wasn't aware of when I added this.
I'll add some tests to cover this scenario.
🎉 Thanks for submitting a pull request! 🎉
Summary
Fail builds if we failed to fetch extensions to prevent building broken sites.
Fixes CPLA-1214
For us to review and ship your PR efficiently, please perform the following steps:
we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or
something that`s on fire 🔥 (e.g. incident related), you can skip this step.
your code follows our style guide and passes our tests.
A picture of a cute animal (not mandatory, but encouraged)