Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

YujohnNattrass
Copy link
Contributor

@YujohnNattrass YujohnNattrass commented Nov 25, 2024

🎉 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:

  • Open a bug/issue before writing your code 🧑‍💻. This ensures
    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.
  • Read the contribution guidelines 📖. This ensures
    your code follows our style guide and passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

A picture of a cute animal (not mandatory, but encouraged)

Copy link
Contributor

This pull request adds or modifies JavaScript (.js, .cjs, .mjs) files.
Consider converting them to TypeScript.

@YujohnNattrass YujohnNattrass self-assigned this Nov 26, 2024
@YujohnNattrass YujohnNattrass marked this pull request as ready for review November 26, 2024 20:03
@YujohnNattrass YujohnNattrass marked this pull request as draft November 26, 2024 20:08
@YujohnNattrass YujohnNattrass marked this pull request as ready for review November 26, 2024 20:29
// 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}`)
Copy link
Contributor

@mrstork mrstork Nov 26, 2024

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?

Copy link
Contributor Author

@YujohnNattrass YujohnNattrass Nov 26, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants