Refactor: Use Classes for platforms #21675
Replies: 7 comments
-
@rarkins I'm looking at this now, but for datasources instead of platforms. I think datasources (in general) are simpler than platforms, and I want to do this for datasources to reduce the duplicated error handling code that I noticed when implementing #6284 |
Beta Was this translation helpful? Give feedback.
-
@JamieMagee sounds good. I'd also hoped that we can reduce the amount of duplicated code in datasources soon, especially in error handling. I had been thinking to do most of the heavy lifting in Something important to keep in mind: I think users will need the ability to override defaults for things like:
Today we only throw datasource errors for known public resources that should never go down like npmjs and pypi, and also a lot of users seem happy to ignore errors from private registries they haven't provided us authentication details for. However there's also a middle ground of people using private registries where if it goes down temporarily then we don't throw a datasource error and instead usually end up autoclosing any PRs from it. |
Beta Was this translation helpful? Give feedback.
-
Having a config options for error would be great. I would prefer to always throw datasource errors on our private registries, as they are unreachable more often. This happens when renovate automerge a patch or digest update and our jenkins deploays the update, which can cause a registry down time of a few seconds. so if renovate tries to fetch updates from that it will silently fail and close all pr's. |
Beta Was this translation helpful? Give feedback.
-
Yeah, I think a config option would be possible. All the public repos are well known (docker.com, npmjs.com, etc.) so we can do a simple check like if (isPublicDatasource(url) || config.throwOnPrivateDatasources) {
throw new ...
} |
Beta Was this translation helpful? Give feedback.
-
Maybe we should split this feature for platfroms / datasources / versionings / mangers to have separate issues? |
Beta Was this translation helpful? Give feedback.
-
@viceice Can we just keep this 1 for now? I can experiment and see how it works out before we start committing to all the work. |
Beta Was this translation helpful? Give feedback.
-
@JamieMagee Ok, as you like 🙃 |
Beta Was this translation helpful? Give feedback.
-
We should add a Class for Platforms to ensure that all implementations have the correct/required functions, and to reduce duplicated code.
Beta Was this translation helpful? Give feedback.
All reactions