← Back to Pull requests

Add reusable Windows PowerShell and CIM helpers #6631

Open
unknown opened this pull request with 276 lines diff across 3 files
View on GitHub
unknown unknown commented on Oct 19, 2026 15:42 UTC
Author

##### What this PR does / why we need it:
Adds reusable Windows guest helpers needed to automate environment preparation for Windows Server Failover Cluster (WSFC) scenarios.

Moves Windows helpers out of SSP and QEMU guest-agent version parsing into utilities/guest_agent.py, updating callers and the corresponding unit tests.

Windows OS queries now use encoded PowerShell commands and return only the five required CIM properties. Windows readiness checks match Caption only, retry transient query failures and stop promptly on unexpected errors.
Unsupported version and registry formats raise ValueError.

The PowerShell runner sends scripts and sensitive input through SSH stdin, redacts exact input occurrences from failure details, and logs guest context.
Follow-up PRs will use it for Active Directory, DNS and domain joins.

##### Which issue(s) this PR fixes:
Part of CNV-70031.
First extraction from #6587.

##### Special notes for reviewer:

##### jira-ticket:
<!-- full-ticket-url needs to be provided. This would add a link to the pull request to the jira and close it when the pull request is merged
If the task is not tracked by a Jira ticket, just write "NONE".
-->
https://redhat.atlassian.net/browse/CNV-70031

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->

Summary by CodeRabbit

Bug Fixes
Windows VM readiness checks now match the requested operating system version against reported system information. Temporary connection, command, and response errors are retried, and readiness timeouts include clearer failure details.
Refactor
Windows operating system details, timezone information, and guest-agent versions remain available across validation and VM workflows. Guest-agent version parsing supports common version and build-number formats, while unsupported operating system information is rejected.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

[CNV-70031]: https://redhat.atlassian.net/browse/CNV-70031?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

Diff: 276 lines (+207 / -69) across 3 files Reviewer: RoniKishner Review duration: 61297m
All Vouch review confidence checks passed
Residual risk 0.26 = Change Risk (0.47) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 276 lines diff across 3 files
0.47
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
44%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth shallow_review_depth
0.344
Diff Size diff_size
0.336
Real PR Conversation Timeline
1 comments
"Review active on #6631"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 44.7% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 46.6% (MEDIUM) · Higher = larger blast radius
46.6%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 44.7% · Lower = rushed or shallow review
44.7%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 25.8% · Safe to merge
25.8%