fix(release-verify): bound guest campaign watching and never fall back to a credential prompt - #425
Merged
Merged
Conversation
…k to a credential prompt
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.
Why
Following an operator-gated guest campaign from the host had no supported path. An ad hoc poll loop ran
powershell.exeagainsttools/vm/ReleaseVm.psm1. The execution policy stops Windows PowerShell from loading the module, soNew-ReleaseVmCredentialnever existed and the credential was$null.Invoke-Command -Credential $nullthen opened an interactive "Sign in to PowerShell" dialog on the host desktop every poll, the loop never ended, and the terminal had to be force-closed.What changes
tools/vm/Watch-ReleaseVmRun.ps1follows a running guest campaign. It is read-only, never prompts (no mandatory parameters, so a missing argument is an error instead of a question), and every way out is bounded:-TimeoutMinutesends it regardless of the guest (exit 2);[Environment]::Exit, because disposing an abandoned PowerShell Direct runspace blocks as long as the guest does not answer.Read-ReleaseVmGuestProgressreturns only complete UTF-8 log lines from a byte offset, plus the exit-file state. Its guest side stays Windows PowerShell 5.1 compatible.Watch-ReleaseVmGuestRunholds the loop with injectable read, clock and sleep, so the deadline and failure bounds are unit-tested.docs/dev/release-verify-vm.mddocuments the watch and thepowershell.execredential trap.Evidence
scripts/tests/vm-recipe.tests.ps1: 142 passed, 0 failed. The new cases cover ordered log output and offsets, the deadline when an operator gate is never answered, the unreachable bound and its reset, refusal of a$nullcredential instead of a prompt, and the script refusing a missing argument without asking.update.msi-decline-realcampaign:verify.ps1 -Fastpassed.