-
Notifications
You must be signed in to change notification settings - Fork 142
refactor: moving parse_ip_route to misc #4039
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
|
Thanks for opening a Pull Request. If you want to perform a review write a comment saying: @ansys-reviewer-bot review |
Reviewer's GuideThis PR refactors the IP route parsing helper by relocating the function from the launcher module into misc, updating its usage in host IP resolution, and adjusting tests to reference the new implementation. Class diagram for refactored parse_ip_route function locationclassDiagram
class launcher {
+_get_windows_host_ip() str | None
+_run_ip_route() str | None
}
class misc {
+parse_ip_route(output: str) str | None
}
launcher ..> misc : uses parse_ip_route
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
@pyansys-ci-bot LGTM. |
pyansys-ci-bot
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.
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.
Hey @germa89 - I've reviewed your changes - here's some feedback:
- Ensure
launcher.pyincludes the appropriate import forparse_ip_routefrommisc.pyso the reference resolves correctly. - Add the missing
import reinmisc.py(if not already present) soparse_ip_routecan use regex functions without errors. - Include a unit test for
parse_ip_routewhen the output contains no IP match to confirm it returns None as expected.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Ensure `launcher.py` includes the appropriate import for `parse_ip_route` from `misc.py` so the reference resolves correctly.
- Add the missing `import re` in `misc.py` (if not already present) so `parse_ip_route` can use regex functions without errors.
- Include a unit test for `parse_ip_route` when the output contains no IP match to confirm it returns None as expected.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4039 +/- ##
==========================================
+ Coverage 89.05% 89.12% +0.07%
==========================================
Files 187 187
Lines 14970 14970
==========================================
+ Hits 13331 13342 +11
+ Misses 1639 1628 -11 🚀 New features to boost your workflow:
|

Description
As the title.
Issue linked
Extracted from #1300
Checklist
draftif it is not ready to be reviewed yet.feat: adding new MAPDL command)Summary by Sourcery
Extract the IP parsing utility from the launcher module into the misc module, streamline the launcher to use the shared function, and update tests accordingly
Enhancements:
Tests: