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(datasource/npm): respect abortOnError
hostRule for registries
#26196
Conversation
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.
@zharinov is this change complementary to the refactoring you plan to do?
Looks so |
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.
otherwise LGTM
🎉 This PR is included in version 37.267.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Changes
This PR adjusts the npm datasource to respect hostRules with
abortOnError
.This is archived through checking if the http request throws an
ExternalHostError
and if yes will throw them up.To keep the existing logic of aborting on
registry.npmjs.com
it checks if a hostRule with an explicitabortOnError
setting exists and only if not we will add a custom hostRule settingabortOnError: true
forregistry.npmjs.com
. This allows as well to explicitly opt-out ofabortOnError
forregistry.npmjs.com
withabortOnError: false
.Context
Fixes #13482
Additionally it allows to set abortOnError for custom registries, which is a use-case I currently have.
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via:
abortOnError: true
=> aborts runabortOnError
=> doesn't abort runregistry.npmjs.org
withoutabortOnError
=> aborts runregistry.npmjs.org
withabortOnError: false
=> doesn't abort run