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

NAS-121797 / 24.04 / CLI for ixdiagnose #61

Merged
merged 3 commits into from
Sep 22, 2023
Merged

NAS-121797 / 24.04 / CLI for ixdiagnose #61

merged 3 commits into from
Sep 22, 2023

Conversation

Qubad786
Copy link
Contributor

Context

This PR addresses the request to enhance the ixdiagnose command-line interface (CLI). We've added subcommands and multiple options to provide users with increased flexibility when generating system debug from command line.

Features

Streamlined debugging with Python Click framework.
Added CLI commands: run, artifact, plugin.
Options for serialization, compression, exclude, timeout etc.

Example use:

ixdiagnose run --compress --serialized --> generates complete structured debug and compresses it.

ixdiagnose plugin --debug-path /tmp/debug -X vm,network --> generates only plugins' debug excluding vm,network and saves it at /tmp/debug

Appropriate help text for each command and subcommand is added.

Docs and Testing

Edited docs accordingly
Added unit tests of the feature using click.testing CliRunner

@bugclerk bugclerk changed the title CLI for ixdiagnose NAS-121797 / 24.04 / CLI for ixdiagnose Sep 14, 2023
@bugclerk
Copy link

@codecov
Copy link

codecov bot commented Sep 14, 2023

Codecov Report

Merging #61 (1660751) into master (3e7d192) will increase coverage by 1.96%.
Report is 2 commits behind head on master.
The diff coverage is 99.46%.

@@            Coverage Diff             @@
##           master      #61      +/-   ##
==========================================
+ Coverage   93.13%   95.09%   +1.96%     
==========================================
  Files          89       90       +1     
  Lines        1675     1836     +161     
==========================================
+ Hits         1560     1746     +186     
+ Misses        115       90      -25     
Files Changed Coverage Δ
ixdiagnose/cli.py 98.91% <98.91%> (ø)
ixdiagnose/artifact.py 91.30% <100.00%> (+1.30%) ⬆️
ixdiagnose/config.py 100.00% <100.00%> (ø)
ixdiagnose/plugin.py 91.30% <100.00%> (+0.39%) ⬆️
...diagnose/test/pytest/integration/test_artifacts.py 100.00% <100.00%> (ø)
ixdiagnose/test/pytest/integration/test_plugins.py 100.00% <100.00%> (ø)
ixdiagnose/test/pytest/unit/run/test_cli.py 100.00% <100.00%> (ø)

... and 3 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Qubad786 Qubad786 requested a review from a team September 14, 2023 16:09
@Qubad786 Qubad786 requested review from a team and removed request for a team September 20, 2023 16:10
@@ -28,6 +27,7 @@ def generate_plugins_debug(percentage: int = 0, total_percentage: int = 100) ->

plugins_report[plugin_name] = report
percentage += plugin_percentage
send_event(int(percentage + 0.5), f'Gathered debug information for {plugin_name!r} plugin')
Copy link
Contributor

Choose a reason for hiding this comment

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

We changed this to log what plug-in is being captured so it's easier to troubleshoot as well as be more intuitive for the end-user to know what's going on.

@@ -25,6 +29,7 @@ def gather_artifacts(percentage: int = 0, total_percentage: int = 100) -> None:

artifacts_report[artifact_name] = report
percentage += artifact_percentage
send_event(int(percentage + 0.5), f'Gathered artifact {artifact_name!r}')
Copy link
Contributor

Choose a reason for hiding this comment

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

Same issue here. Please revert these changes.

@Qubad786 Qubad786 merged commit 2c8e7a3 into master Sep 22, 2023
6 checks passed
@Qubad786 Qubad786 deleted the NAS-121797 branch September 22, 2023 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants