-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR to push implementation Inline replace functionality from ARI (#238)
* add fix functionality Signed-off-by: Sumit Jaiswal <[email protected]> * fix ci Signed-off-by: Sumit Jaiswal <[email protected]> * fix ci Signed-off-by: Sumit Jaiswal <[email protected]> * update fix code Signed-off-by: Sumit Jaiswal <[email protected]> * add error handling * add debug steps Signed-off-by: Sumit Jaiswal <[email protected]> * fix spelling Signed-off-by: Sumit Jaiswal <[email protected]> * update logger to ari logger Signed-off-by: Sumit Jaiswal <[email protected]> * add EOL Signed-off-by: Sumit Jaiswal <[email protected]> --------- Signed-off-by: Sumit Jaiswal <[email protected]>
- Loading branch information
Showing
5 changed files
with
586 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Python Debugger: Remote Attach", | ||
"type": "debugpy", | ||
"request": "attach", | ||
"connect": { | ||
"host": "localhost", | ||
"port": 5678 | ||
}, | ||
"justMyCode": false | ||
}, | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,3 +99,25 @@ git clone [email protected]:ansible/ansible-risk-insight.git | |
cd ansible-risk-insight | ||
pip install -e . | ||
``` | ||
|
||
## Debugging ARI over VSCode (for development) | ||
|
||
ARI can be debugged using VSCode. Steps to start debugging: | ||
|
||
Step 1: Please add below line to file that needs to be debugged: | ||
``` | ||
import debugpy | ||
debugpy.listen(5678) | ||
debugpy.wait_for_client() | ||
``` | ||
Step 2: Fire the ARI command via cli command to run the ARI, ref as: | ||
``` | ||
(.env) ➜ ari project <GH repository> --out-dir /tmp/CS --save-only-rule-result --scan-per-target --task-num-threshold 100 --fix | ||
0.00s - Debugger warning: It seems that frozen modules are being used, which may | ||
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off | ||
0.00s - to python to disable frozen modules. | ||
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation. | ||
``` | ||
Note: If you want to disable the validation warning, please set `PYDEVD_DISABLE_FILE_VALIDATION=1` under your enviornment. | ||
|
||
Step 3: From VSCode, click `Run->Start Debugging`, debugger should stop at the breakpoints placed inside the ARI code. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.