Experimental support for workflow job debugging#578
Draft
jasongin wants to merge 1 commit intogithub:mainfrom
Draft
Experimental support for workflow job debugging#578jasongin wants to merge 1 commit intogithub:mainfrom
jasongin wants to merge 1 commit intogithub:mainfrom
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-runnerbranch of theactions/runnerrepo.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.
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.