-
Notifications
You must be signed in to change notification settings - Fork 92
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
Add debugging support #1006
Add debugging support #1006
Conversation
Adds support for debugging playbooks using the ansibug library. This allows users to launch a debuggable playbook through this extension or attach to an existing playbook process launched by ansibug.
I think this PR is ready for a proper review. Please let me know what might be missing or needs to be fixed up so I can get it ready to be merged. |
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.
@jborean93, that's a significant and long-awaited feature to be added to the extension. Everything looks great to me. Could you also add some documentation that includes how to use this feature?
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
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.
Blocking this until the ansibug project status is clarified.
@nitzmahone Considering the upcoming changes in core, please advise if we want to get this in as experimental and rewrite it once core changes get implemented. I do think that there is a lot of interest in playing with this feature. |
not a lot of interest ???? use so many jinja template scripts that a debugger would be a lifesaver for me as we all know syntax errors for jinja are the opposite of useful, and ib general I want to know what the output of those script into playbook variables look like, so a ansible playbook debugger is an absolute necessity and I'm not talking of a python debugger used to debug ansible somehow |
Closing as we decided to delay implementing this in extension until ansible-core receives native support for debugging, anyone can try using https://marketplace.visualstudio.com/items?itemName=jborean.ansibug |
Big changes coming in 2.18 to the guts of our Jinja integration that make diagnosing template issues easier- we can now track the provenance of all vars, and we've majorly overhauled the bookkeeping we do during templating, so a lot of problems that used to just silently fail are now loudly in your face, with error messages that can show you the entire template stack that was running when the problem occurred. A number of those things are already accessible through Jordan's ansibug VSCode Ansible debugger prototype in currently-released Ansible, and a lot more capabilities will be accessible once the debugger hook support is properly integrated in core. |
Any update on adding debugging to ansible-core @nitzmahone ? |
Adds support for debugging playbooks using the ansibug library. This allows users to launch a debuggable playbook through this extension or attach to an existing playbook process launched by ansibug.
This requires https://github.com/jborean93/ansibug to be installed in the Python environment used by the extension. We need to have a conversation around whether this should be bundled with this extension or whether the user supplies it themselves. We could support both with the bundled version being a fallback. For now it just needs to be manually installed with
Fixes: #760
Related: AAP-19811