Skip to content

Experimental support for workflow job debugging#578

Draft
jasongin wants to merge 1 commit intogithub:mainfrom
jasongin:debug
Draft

Experimental support for workflow job debugging#578
jasongin wants to merge 1 commit intogithub:mainfrom
jasongin:debug

Conversation

@jasongin
Copy link
Copy Markdown

DRAFT PR - DO NOT MERGE!

This PR adds experimental support for debugging a GitHub Actions job using the VS Code debugger. With this you can set breakpoints and step through the workflow YAML and inspect context variables.

It depends on a connection to the job runner which implements the Debug Adapter Protocol (along with a protocol extension for filesystem access). The runner DAP work is in progress in the feature/devtunnel-dap-runner branch of the actions/runner repo.

Currently the code in this PR assumes it can make a local TCP connection to the runner DAP server, which was sufficient to prototype this feature using a self-hosted runner on the same machine. The connection code here will need to be updated to make an authenticated websocket connection to a URL provided by the actions service, when that is available soon.

VS Code Contributions

The PR adds a "Re-run and debug job" command to the job item in the GitHub Actions view, if the job is in the failed state. Currently there is also an "Attach debugger to job" command for a running job, however this might be removed since it will not be possible to attach to an arbitrary job that was not specifically started in debug mode.

To complement the remote-debugging experience, there is also an "Actions Remote File System" view added to the Debug sidebar. This lets you view and edit files on the remote system being debugged. It is backed by a custom extension to the Debug Adapter Protocol, which must also be implemented by the runner DAP server.

image

Limitations

At this time, the remote access is limited to debugging and files, and furthermore the DAP server may limit what debugger or filesystem commands are available depending on security policies and user permissions (e.g. filesystem access might be read-only). We are intentionally NOT providing a full remote terminal or VS Code remote server on the runner host.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant