-
Notifications
You must be signed in to change notification settings - Fork 77
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
Support remote debugging in dev environments #1780
Conversation
31bcdd8
to
352854f
Compare
not sure whether we'd want to update any developer documentation with this change. any thoughts @ethyca/docs-authors ? |
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.
Everything seems to work for me and I was able to get the debugger running. I will say I don't use VS Code so someone that does may try things I didn't.
On a quick search it looks like I can also get it working with neovim, but I haven't had time to test that yet. This also makes me think there will be a way for our IntelliJ/Pycharm users to get it working.
We do have some documentation on how to debug in intellij/pycharm, I think having a section for this couldn't hurt? |
@adamsachs might as well add this to our dev docs, this is a great feature! |
@conceptualshark i've added a quick guide on VSCode debugging in dd72026. Would you mind giving it a once-over? Thanks! |
Closes #1779
Code Changes
fides
service with some slight tweaks to enable adebugpy
remote debugger to attach to itdocker-compose
yml to provide some overrides to the basefides
service definition - to me, this felt like the cleanest way to provide these overrides/alternativeslaunch.json
to give devs an easy way to start up the remote debugger from vscode.Steps to Confirm
run
nox -s dev -- remote_debug
to start your dev app with remote debugging enabledattach a remote debugger to your server from VSCode
fides
repo in a VSCode workspaceRun and Debug
viewPython debugger: Remote Attach Fides
launch/debug config from dropdown and click the "start" arrowadd a breakpoint to codepath that will be hit by interacting with the server, and watch it get hit
curl http://localhost:8080/health
) and watch the breakpoint get hit!more info on remote debugging in VSCode: https://code.visualstudio.com/docs/python/debugging#_debugging-by-attaching-over-a-network-connection
Pre-Merge Checklist
CHANGELOG.md
Description Of Changes
remote_debug
can now be passed as anox
flag to thedev
session, and it will start up thefides
service with a container that has port5678
open to the host.nox -s dev -- remote_debug ui
will spin upfides
alongside the admin UI, while also allowing a remote debugger to attach to that runningfides
container/serverpytest
unit testing. the issue description context gives some detail about how/why i couldn't get that to work. i may be missing something dumb and would appreciate any pointers!Run and Debug
view, they should now have a launch/debug configPython debugger: Remote Attach Fides
. If they launch that debug config after their server/app boots up with e.g.nox -s dev -- remote_debug
, then they should now be ready to debug that server live!