-
Notifications
You must be signed in to change notification settings - Fork 758
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
feat: getAllDependents & getAllDependencies #41561
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.
This code looks perfect.
Can you please add some unit test cases to validate your implementation to this test class?
Line 632 in 727eb0f
public void testTopologicalSortOfModuleDescriptor() { |
Since the DependencyGraph<T>
accepts any T, you can use a custom object as the node.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #41561 +/- ##
============================================
+ Coverage 76.70% 76.71% +0.01%
+ Complexity 52693 52689 -4
============================================
Files 2879 2879
Lines 198656 198680 +24
Branches 25809 25813 +4
============================================
+ Hits 152372 152427 +55
+ Misses 37868 37824 -44
- Partials 8416 8429 +13 ☔ View full report in Codecov by Sentry. |
@sameerajayasoma I created the tests as requested. Please re-run the checks. |
@sameerajayasoma could you also label the PR as hacktoberfest-accepted before 31 october? Thank you |
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.
Changes look great!!! Thanks for your contribution.
This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the |
@github-actions still active |
Purpose
Fixes #36113
Approach
In the modified code, I've added two new methods: getAllDependents and getAllDependencies. These methods use recursion to traverse the graph and collect all direct and indirect dependents/dependencies of a given node. The helper methods getAllDependentsRecursive and getAllDependenciesRecursive are used for the recursive traversal.
Check List