-
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.
Signed-off-by: Sumit Jaiswal <[email protected]>
- Loading branch information
Showing
2 changed files
with
23 additions
and
11 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 |
---|---|---|
@@ -1,23 +1,15 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Python Debugger: Remote Attach", | ||
"type": "debugpy", | ||
"request": "attach", | ||
"connect": { | ||
"host": "localhost:5678", | ||
"host": "localhost", | ||
"port": 5678 | ||
}, | ||
"pathMappings": [ | ||
{ | ||
"localRoot": "${workspaceFolder}", | ||
"remoteRoot": "." | ||
} | ||
] | ||
} | ||
"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,23 @@ 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 fine 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. | ||
``` | ||
Step 3: From VSCode, click `Run->Start Debugging`, debugger should stop at the breakpoints placed inside the ARI code. |