-
Notifications
You must be signed in to change notification settings - Fork 57
Fix a regression in recursive dependency enumeration #693
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
Conversation
There were two bugs in a previous change to recursive dependency enumeration. The first relates specifically to defaultdict behaviors, and the other to lambda capture. Fixes 520052d
christophebedard
left a comment
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.
Looks good to me, but tests would definitely be good!
| non_map_categories = recursive_categories | ||
| recursive_categories = defaultdict(lambda: non_map_categories) |
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.
Reading up on lambda captures, you might be able to do this (pardon the line length):
| non_map_categories = recursive_categories | |
| recursive_categories = defaultdict(lambda: non_map_categories) | |
| recursive_categories = defaultdict(lambda recursive_categories=recursive_categories: recursive_categories) |
but it's not really better than the current solution.
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.
Yeah, kind of a horse a piece. It's a tricky behavior - I wish the syntax was cleaner.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #693 +/- ##
==========================================
+ Coverage 87.04% 87.08% +0.03%
==========================================
Files 69 69
Lines 4077 4081 +4
Branches 703 704 +1
==========================================
+ Hits 3549 3554 +5
Misses 417 417
+ Partials 111 110 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Alright, the latest change adds a test that exercises this and hides the critical part of the fix that caused the regression behind a feature flag. The intention is to release this in a disabled state and make an announcement about it so folks can try it out and fix any regressed dependencies before we fix the bug unconditionally down the road. For reference, the feature flag is: |
There were two bugs in a previous change to recursive dependency enumeration. The first relates specifically to
defaultdictbehaviors, and the other to lambda capture.Fixes #646
Keeping in draft until I can add tests.
CI is blocked on colcon/ci#40