Catch errors thrown by manifest providers#196
Catch errors thrown by manifest providers#196harrysarson wants to merge 2 commits intoros-infrastructure:masterfrom
Conversation
Distribution objects have a list of manifest providers (both release and source) and will try each in turn until one returns non-null. However, the providers all raise exceptions rather than returning null which means the Distribution object fails to try more than one. Typically code uses `CachedManifestProvider` (and `CachedSourceManifestProvider`) which has this try/except logic so the looping over manifest providers works as intended. This commit copies the try/except logic from these manifest providers directly into the methods on the Distribution class.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #196 +/- ##
=========================================
Coverage ? 39.63%
=========================================
Files ? 51
Lines ? 3272
Branches ? 661
=========================================
Hits ? 1297
Misses ? 1799
Partials ? 176 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
tfoote
left a comment
There was a problem hiding this comment.
Thanks for digging into this. It looks reasonable. It seems like we might have had a behavior evolution that changed but wasn't resolved for all the use cases.
If we're considering that this was supposed to degrade gracefully and skip providers that aren't present. Why did you add the exception rethrow versus returning none. The CachedManifestProvider doesn't use that.
rosdistro/src/rosdistro/manifest_provider/cache.py
Lines 84 to 91 in fad8d9f
I was trying to minimise the change in behaviour introduced by my patch. I thought some code might be relying on Very happy to switch this to return None though. Looks like the CI failure is a network error: Is the codecov comment something I need to fix? Looking at |
Distribution objects have a list of manifest providers (both release and source) and will try each in turn until one returns non-null. However, the providers all raise exceptions rather than returning null which means the Distribution object fails to try more than one.
Typically code uses
CachedManifestProvider(andCachedSourceManifestProvider) which has this try/except logic so the looping over manifest providers works as intended.This commit copies the try/except logic from these manifest providers directly into the methods on the Distribution class.