← Back to Pull requests

CNV-97765: Normalize ARM machine platform #6727

Open
unknown opened this pull request with 500 lines diff across 6 files
View on GitHub
unknown unknown commented on Oct 28, 2026 14:35 UTC
Author

##### What this PR does / why we need it:
platform.machine() on ARM hosts returns aarch64, while ConsoleCLIDownload / virtctl artifact URLs use arm64 (same pattern as x86_64 → amd64). Without normalizing that spelling, get_and_extract_file_from_cluster() cannot match the Linux ARM download URL, and the execute path in test_disconnected_virtctl never runs virtctl version on ARM.

In short we need this fix to generate proper link to download virtctl.
platform.machine() returns aarch64, where on arm machine we generate the download endpoints like:

  • https://hyperconverged-cluster-cli-download-openshift-cnv.apps.<cluster>.<domain>/amd64/linux/virtctl.tar.gz

  • https://hyperconverged-cluster-cli-download-openshift-cnv.apps.<cluster>.<domain>/arm64/linux/virtctl.tar.gz

  • https://hyperconverged-cluster-cli-download-openshift-cnv.apps.<cluster>.<domain>/amd64/mac/virtctl.tar.gz

  • https://hyperconverged-cluster-cli-download-openshift-cnv.apps.<cluster>.<domain>/arm64/mac/virtctl.tar.gz

  • https://hyperconverged-cluster-cli-download-openshift-cnv.apps.<cluster>.<domain>/amd64/windows/virtctl.zip

  • https://hyperconverged-cluster-cli-download-openshift-cnv.apps.<cluster>.<domain>/arm64/windows/virtctl.zip
  • This PR:

  • Adds AARCH_64 = "aarch64" and maps aarch64 → arm64 (and keeps x86_64 → amd64) in get_machine_platform()

  • Keeps the helper in utilities/infra.py (per review on #6452 — avoid a new tiny module just for unit-testability)

  • Adds unit coverage in utilities/unittests/test_infra.py (including unknown-arch pass-through)
  • ##### Which issue(s) this PR fixes:
    Supersedes / continues https://github.com/RedHatQE/openshift-virtualization-tests/pull/6452

    ##### Special notes for reviewer:
    Context carried over from review discussion on #6452:

  • Why AARCH_64 exists (vs only ARM_64): these are different string spellings, not two CPU architectures. Hosts report aarch64; download links use arm64. Matching requires normalizing host aarch64 → URL arm64, analogous to x86_64 → amd64.

  • Module placement: initial chai-bot iteration moved the helper to utilities/machine_platform.py to avoid sys.modules surgery in unit tests. @geetikakay asked to keep it in infra.py instead of proliferating tiny modules — addressed here; tests use the existing importlib dance for the real infra module.

  • Affected product path: get_and_extract_file_from_cluster / download_file_from_cluster filter ConsoleCLIDownload hrefs by system_os + machine_type substrings; test_download_and_execute_virtcli_binary_linux[linux_arm64] only executes when get_machine_platform() == "arm64".

  • Unit test placement: AARCH_64 constant coverage lives in utilities/unittests/test_constants.py (value assertion). utilities/unittests/test_architecture.py covers get_cluster_architecture() behavior and is unrelated to this constant spelling addition, so it was not modified.

  • Validation: focused utilities unit tests for the helper/constants passed locally after the move back to infra.py. Full ARM cluster/checkup-image E2E remains the strongest pre-merge proof for the download+execute path; local ARM VM snippet validation was attached in PR comments as a lighter alternative to reserving AWS ARM64 capacity.

  • DCO: commits signed off as Michal Jankowski <mijankow@redhat.com>.
  • Signed-off-by: Michal Jankowski <mijankow@redhat.com>

    ##### jira-ticket:
    https://issues.redhat.com/browse/CNV-97765

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

    Summary by CodeRabbit

  • Bug Fixes

  • - Platform architecture names are now normalized to lowercase. The common x86_64 and aarch64 names are reported as amd64 and arm64, respectively; other architecture names are returned in lowercase.
  • New Features

  • - Added the aarch64 architecture identifier.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 500 lines (+375 / -125) across 6 files Reviewer: RoniKishner Review duration: 48404m
    All Vouch review confidence checks passed
    Residual risk 0.30 = Change Risk (0.55) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.55 · 500 lines diff across 6 files
    0.55
    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
    Diff Size diff_size
    0.372
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #6727"
    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: 54.5% (MEDIUM) · Higher = larger blast radius
    54.5%
    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: 30.1% · Safe to merge
    30.1%