-
Notifications
You must be signed in to change notification settings - Fork 338
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 get_plugins() bug #1723
base: main
Are you sure you want to change the base?
Fix get_plugins() bug #1723
Conversation
Signed-off-by: Bryce Gattis <[email protected]>
Signed-off-by: Bryce Gattis <[email protected]>
Signed-off-by: Bryce Gattis <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1723 +/- ##
==========================================
+ Coverage 58.29% 58.43% +0.14%
==========================================
Files 126 126
Lines 17159 17160 +1
Branches 3505 3505
==========================================
+ Hits 10002 10028 +26
+ Misses 6493 6465 -28
- Partials 664 667 +3 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Bryce Gattis <[email protected]>
Signed-off-by: Bryce Gattis <[email protected]>
@@ -152,7 +153,7 @@ def get_plugins(package_name, paths=None): | |||
continue # not a plugin of itself | |||
|
|||
plugin_pkg = get_latest_package(package_name_, paths=paths) | |||
if not plugin_pkg.plugin_for: | |||
if not plugin_pkg or not plugin_pkg.plugin_for: |
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.
I'm wondering if we should instead make sure that get_latest_package
returns valid packages. The docstring of get_latest_package
says that it should either return a Package
object or None is a package is not found. There is also this TODO
Lines 925 to 926 in 71d990b
# FIXME this isn't correct, since the pkg fam may exist but a pkg | |
# in the range does not. |
It my books, that's what I call smell.
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.
In the case of #1618 I would say that get_latest_package is correctly returning None, as there is no valid package in an empty folder. Perhaps then iter_package_families should be more thorough and not return package names if there is no valid package in the folders?
Hey folks! Just wanted to check in and see if there might be movement on this soon? We've encountered this issue a couple of times in the wild in the last six months or so, and would be grateful for a fix! |
Add suggested fix from @mmdanggg2 and add tests.
Closes #1618.