Skip to content
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

(maint) Add ability for Agent debugging #3412

Merged
merged 1 commit into from
Apr 5, 2024

Conversation

corbob
Copy link
Member

@corbob corbob commented Apr 3, 2024

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 Chocolatey GUI not displaying error output when running as non-admin through Background Service ChocolateyGUI#967

Operating Systems Testing

Windows 10

Change Types Made

  • Bug fix (non-breaking change).
  • Feature / Enhancement (non-breaking change).
  • Breaking change (fix or feature that could cause existing functionality to change).
  • Documentation changes.
  • PowerShell code changes.

Change Checklist

  • Requires a change to the documentation.
  • Documentation has been updated.
  • Tests to cover my changes, have been added.
  • All new and existing tests passed?
  • PowerShell code changes: PowerShell v2 compatibility checked?

Related Issue

Copy link
Member

@gep13 gep13 left a comment

Choose a reason for hiding this comment

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

LGTM!

@gep13
Copy link
Member

gep13 commented Apr 5, 2024

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

chocolatey/ChocolateyGUI#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!

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 as 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.
@gep13 gep13 merged commit c439ad3 into chocolatey:develop Apr 5, 2024
5 checks passed
@corbob corbob deleted the Debugging-Changes branch April 5, 2024 13:17
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.

2 participants