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

Add debugging support #1006

Closed
wants to merge 7 commits into from
Closed

Add debugging support #1006

wants to merge 7 commits into from

Conversation

jborean93
Copy link

@jborean93 jborean93 commented Nov 4, 2023

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

python -m pip install ansibug

Fixes: #760
Related: AAP-19811

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.
@jborean93 jborean93 marked this pull request as ready for review November 13, 2023 20:30
@jborean93 jborean93 requested a review from a team as a code owner November 13, 2023 20:30
@jborean93
Copy link
Author

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.

Copy link
Contributor

@priyamsahoo priyamsahoo left a 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?

Copy link
Member

@ssbarnea ssbarnea left a 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.

@ssbarnea
Copy link
Member

@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.

@torsina
Copy link

torsina commented Apr 7, 2024

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

@ssbarnea
Copy link
Member

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

@ssbarnea ssbarnea closed this May 23, 2024
@nitzmahone
Copy link
Member

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.

@clay584
Copy link

clay584 commented Oct 30, 2024

Any update on adding debugging to ansible-core @nitzmahone ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

(M/S) Add debugging functionality within IDE for ansible-playbook/runs (jordan/research)
6 participants