chocolatey / choco

Chocolatey - the package manager for Windows
https://chocolatey.org
Other
10.26k stars 900 forks source link

(maint) Add ability for Agent debugging #3412

Closed corbob closed 6 months ago

corbob commented 6 months ago

Description Of Changes

Add the ability to debug Self Service Mode from Chocolatey Agent.

Motivation and Context

Chocolatey Agent adds --run-actual on every Chocolatey CLI command run. When we're in debug mode and --run-actual is passed to Chocolatey CLI, we should not pause execution at the end as we're likely in agent and cannot acknowledge the pause.

This also adds a change to the cake recipe to add --run-actual on the unpackself step as when we're building a debug version we don't want to pause for the user to press a key.

Testing

  1. Ran ./build.debug.bat and confirmed it didn't wait for me to press any key.
  2. Ran debug build with --run-actual and configmred it didn't wait for me to press any key.
  3. Debugged Chocolatey GUI through agent in https://github.com/chocolatey/ChocolateyGUI/issues/967

Operating Systems Testing

Windows 10

Change Types Made

Change Checklist

Related Issue

gep13 commented 6 months ago

I took this for a spin as part of testing this PR:

https://github.com/chocolatey/ChocolateyGUI/pull/1042

These changes make sense to me, and happy for them to go in.

This will greatly improve our ability to debug the background service, especially when using Chocolatey GUI!