Skip to content
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

Update report feature with new argument, add temp fix for ifcfg module #324

Merged
merged 40 commits into from
Sep 13, 2019

Conversation

claireyywang
Copy link
Contributor

@claireyywang claireyywang commented Aug 28, 2019

Import error added in network.py as a temporary fix for ifcfg module. Will remove and update with build dependency once a deb package is ready.

This is an enhancement to report feature based on previous discussion #319 (comment)

This PR adds --report_failed argument, which allows user to only print report of failed checks. Major changes happen in format.py and doctor.py files.

Report content is output from each check module and indexed by their module names in generate_report(). They are printed out by calling format_print(modules, report). The function takes module names and print out their indexed report, with dynamically allocated space padding computed by compute_padding.

claireyywang added 17 commits August 19, 2019 17:31
Signed-off-by: claireyywang <clairewang@openrobotics.org>
Signed-off-by: claireyywang <clairewang@openrobotics.org>
Signed-off-by: claireyywang <clairewang@openrobotics.org>
Signed-off-by: claireyywang <clairewang@openrobotics.org>
Signed-off-by: claireyywang <clairewang@openrobotics.org>
Signed-off-by: claireyywang <clairewang@openrobotics.org>
Signed-off-by: claireyywang <clairewang@openrobotics.org>
Signed-off-by: claireyywang <clairewang@openrobotics.org>
Signed-off-by: claireyywang <clairewang@openrobotics.org>
Signed-off-by: claireyywang <clairewang@openrobotics.org>
Signed-off-by: claireyywang <clairewang@openrobotics.org>
Signed-off-by: claireyywang <clairewang@openrobotics.org>
Signed-off-by: claireyywang <clairewang@openrobotics.org>
Signed-off-by: claireyywang <clairewang@openrobotics.org>
Signed-off-by: claireyywang <clairewang@openrobotics.org>
Signed-off-by: claireyywang <clairewang@openrobotics.org>
Signed-off-by: claireyywang <clairewang@openrobotics.org>
@claireyywang claireyywang added the in progress Actively being worked on (Kanban column) label Aug 28, 2019
@claireyywang claireyywang self-assigned this Aug 28, 2019
@claireyywang claireyywang changed the title Claire/ros2doctor report Update report feature with new argument, add temp fix for ifcfg module Aug 28, 2019
Signed-off-by: claireyywang <clairewang@openrobotics.org>
@claireyywang
Copy link
Contributor Author

claireyywang commented Aug 28, 2019

Linux Build Status
Linux-aarch64 Build Status
OSX Build Status
Windows Build Status

claireyywang added 3 commits August 28, 2019 17:32
Signed-off-by: claireyywang <clairewang@openrobotics.org>
Signed-off-by: claireyywang <clairewang@openrobotics.org>
@claireyywang claireyywang added the in review Waiting for review (Kanban column) label Aug 29, 2019
@claireyywang claireyywang removed the in progress Actively being worked on (Kanban column) label Aug 29, 2019
Copy link
Contributor

@sloretz sloretz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great! A few comments/nitpicks below

ros2doctor/ros2doctor/api/network.py Outdated Show resolved Hide resolved
ros2doctor/ros2doctor/api/__init__.py Outdated Show resolved Hide resolved
ros2doctor/ros2doctor/api/__init__.py Outdated Show resolved Hide resolved
ros2doctor/ros2doctor/api/__init__.py Outdated Show resolved Hide resolved
ros2doctor/ros2doctor/api/__init__.py Outdated Show resolved Hide resolved
ros2doctor/ros2doctor/api/format.py Outdated Show resolved Hide resolved
ros2doctor/ros2doctor/api/format.py Outdated Show resolved Hide resolved
ros2doctor/ros2doctor/api/platform.py Outdated Show resolved Hide resolved
ros2doctor/ros2doctor/command/doctor.py Outdated Show resolved Hide resolved
ros2doctor/ros2doctor/command/doctor.py Outdated Show resolved Hide resolved
claireyywang added 3 commits September 5, 2019 11:50
Signed-off-by: claireyywang <clairewang@openrobotics.org>
Signed-off-by: claireyywang <clairewang@openrobotics.org>
Signed-off-by: claireyywang <clairewang@openrobotics.org>
@claireyywang
Copy link
Contributor Author

Linux Build Status
Linux-aarch64 Build Status
OSX Build Status
Windows Build Status

Signed-off-by: claireyywang <clairewang@openrobotics.org>
@claireyywang
Copy link
Contributor Author

claireyywang commented Sep 9, 2019

Linux Build Status

Signed-off-by: claireyywang <clairewang@openrobotics.org>
@claireyywang
Copy link
Contributor Author

Linux Build Status

Signed-off-by: claireyywang <clairewang@openrobotics.org>
Copy link
Contributor

@sloretz sloretz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quick review

"""
reports = []
for report_entry_pt in iter_entry_points('ros2doctor.report'):
report_class = report_entry_pt.load()()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current try/except ValueError block doesn't guard against buggy reports and checks. Also, the second () is calling __init__(self) on the user's class, so it could raise too.

try:
    report_class = report_entry_pt.load()()
    report_category = report_class.category()
    report = report_class.report()
except Exception:
    # Checking `Exception` because buggy code could raise anything
    # Maybe traceback.format_exc() would be something to output here too?
    doctor_warn('Report class from %s failed to run.' % report_entry_pt.name)

ros2doctor/ros2doctor/api/__init__.py Outdated Show resolved Hide resolved
claireyywang added 2 commits September 12, 2019 13:05
Signed-off-by: claireyywang <clairewang@openrobotics.org>
Signed-off-by: claireyywang <clairewang@openrobotics.org>
@claireyywang
Copy link
Contributor Author

linux Build Status
linux-aarch64 Build Status
osx Build Status
windows Build Status

@claireyywang claireyywang requested review from sloretz and removed request for dirk-thomas September 12, 2019 21:29
Signed-off-by: claireyywang <clairewang@openrobotics.org>
@claireyywang
Copy link
Contributor Author

Linux Build Status
Linux-aarch64 Build Status
OSX Build Status
Windows Build Status

@claireyywang claireyywang merged commit d7d96c5 into master Sep 13, 2019
@delete-merged-branch delete-merged-branch bot deleted the claire/ros2doctor-report branch September 13, 2019 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in review Waiting for review (Kanban column)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants