Skip to content

Move dap setup to setup job step#4403

Open
rentziass wants to merge 4 commits intomainfrom
dapsetup
Open

Move dap setup to setup job step#4403
rentziass wants to merge 4 commits intomainfrom
dapsetup

Conversation

@rentziass
Copy link
Copy Markdown
Member

This adds the DAP server setup to the Setup job step, to both help with messaging for users and keep the step as in progress to communicate we're waiting on a debugger to connect.

We also add a final pause during the Complete job step to allow one final inspection after all steps have completed.
CleanShot 2026-05-05 at 16 21 37@2x
CleanShot 2026-05-05 at 16 22 27@2x

https://github.com/github/c2c-actions/issues/9828

@rentziass rentziass marked this pull request as ready for review May 5, 2026 16:49
@rentziass rentziass requested a review from a team as a code owner May 5, 2026 16:49
Copilot AI review requested due to automatic review settings May 5, 2026 16:49
Comment thread src/Runner.Worker/Dap/DapDebugger.cs Outdated
Comment thread src/Runner.Worker/JobExtension.cs
Comment thread src/Runner.Worker/JobExtension.cs Outdated
Copy link
Copy Markdown
Contributor

@salmanmkc salmanmkc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple tests that'd be nice to have:

  • cancellation during WaitForCommandAsync (not just pre-cancelled)
  • exception in OnJobCompletedAsync during FinalizeJob

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot's findings

  • Files reviewed: 5/5 changed files
  • Comments generated: 1

Comment thread src/Runner.Worker/Dap/DapDebugger.cs Outdated
salmanmkc
salmanmkc previously approved these changes May 6, 2026
Copy link
Copy Markdown
Contributor

@salmanmkc salmanmkc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, OnJobCompletedAsync exception test as a nice follow-up if you want, but non-blocking
edit: ignore this actually, i'm wrong about the test not being there, lgtm!

try
{
_dapDebugger = HostContext.GetService<IDapDebugger>();
await _dapDebugger.StartAsync(jobContext);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we pass in the step level context instead of the jobContext?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The debugger needs jobs cancellation, Global.Debugger and variable provider from the job context, plus I think it needs a context that outlives the setup step? This isn't new btw, it just moved into the step.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the Global object is shared across all context (step + job).
you were using jobcontext since the code in jobrunner.cs doesn't have a step context.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But also we hook up to jobcontext cancelation in the debugger, if we used the step context wouldn't that be completed when Setup job completes?

Comment thread src/Runner.Worker/JobExtension.cs Outdated
Comment thread src/Runner.Worker/JobExtension.cs Outdated
Comment thread src/Runner.Worker/Dap/DapDebugger.cs Outdated
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.

4 participants