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

feat: abortOnError / abortIgnoreStatusCodes #6556

Merged
merged 11 commits into from Jun 23, 2020
Merged

Conversation

rarkins
Copy link
Collaborator

@rarkins rarkins commented Jun 20, 2020

This PR adds the ability for users to customize which hosts throw DatasourceErrors and for which HTTP status codes. abortOnError can be used to opt-in certain host types or specific hosts such that they throw DatasourceError and abort the run, while abortStatusCodes allows for the list of status codes to be customized.

Sets groundwork for #5557

@rarkins
Copy link
Collaborator Author

rarkins commented Jun 20, 2020

TODO:

  • throw for http errors too (ETIMEOUT, etc)
  • Convert hardcoded datasource error throwing into hostRules
  • Ensure default abortStatusCodes are added to hostRules
  • Determine how this should work with DatasourceError and PlatformError. Support throwing either type, or combine them into one such as ExternalHostError, etc?

@rarkins
Copy link
Collaborator Author

rarkins commented Jun 20, 2020

@JamieMagee @viceice what do you think about this approach? I think it achieves the flexibility necessary without being too confusing. Even the basic examples given in documentation can be turned into in-built presets to make it simpler still.

viceice
viceice previously approved these changes Jun 20, 2020
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with this approach. 👍

@JamieMagee
Copy link
Contributor

Yeah, also sounds good to me. I like the composability we gain with hostRules

@rarkins
Copy link
Collaborator Author

rarkins commented Jun 22, 2020

Waiting on #6563

@lgtm-com
Copy link

lgtm-com bot commented Jun 22, 2020

This pull request introduces 1 alert when merging 074b693 into 02e6817 - view on LGTM.com

new alerts:

  • 1 for Invocation of non-function

@rarkins rarkins changed the title feat: abortOnError / abortStatusCodes feat: abortOnError / abortIgnoreStatusCodes Jun 23, 2020
@rarkins rarkins marked this pull request as ready for review June 23, 2020 06:17
@rarkins rarkins merged commit daf2a48 into master Jun 23, 2020
@rarkins rarkins deleted the feat/host-rules-abort branch June 23, 2020 07:25
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 21.16.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants