CherryPicked: [4.18] eus upgrade alignment#5171
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Report bugs in Issues Welcome! 🎉This pull request will be automatically processed with the following features: 🔄 Automatic Actions
📋 Available CommandsPR Status Management
Review & Approval
Testing & Validation
Container Operations
Cherry-pick Operations
Label Management
✅ Merge RequirementsThis PR will be automatically approved when the following conditions are met:
📊 Review ProcessApprovers and ReviewersApprovers:
Reviewers:
Available Labels
AI Features
💡 Tips
For more information, please refer to the project documentation or contact the maintainers. |
|
SiboWang1997 can not be added as reviewer. Reviews may only be requested from collaborators. One or more of the users or teams you specified is not a collaborator of the RedHatQE/openshift-virtualization-tests repository.: 422 {"message": "Reviews may only be requested from collaborators. One or more of the users or teams you specified is not a collaborator of the RedHatQE/openshift-virtualization-tests repository.", "documentation_url": "https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request", "status": "422"} |
2483391 to
bd1e39a
Compare
|
Clean rebase detected — no code changes compared to previous head ( |
|
SiboWang1997 can not be added as reviewer. Reviews may only be requested from collaborators. One or more of the users or teams you specified is not a collaborator of the RedHatQE/openshift-virtualization-tests repository.: 422 {"message": "Reviews may only be requested from collaborators. One or more of the users or teams you specified is not a collaborator of the RedHatQE/openshift-virtualization-tests repository.", "documentation_url": "https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request", "status": "422"} |
|
SiboWang1997 can not be added as reviewer. Reviews may only be requested from collaborators. One or more of the users or teams you specified is not a collaborator of the RedHatQE/openshift-virtualization-tests repository.: 422 {"message": "Reviews may only be requested from collaborators. One or more of the users or teams you specified is not a collaborator of the RedHatQE/openshift-virtualization-tests repository.", "documentation_url": "https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request", "status": "422"} |
1c1090f to
5e60016
Compare
Signed-off-by: Harel Meir <hmeir@redhat.com>
5e60016 to
8bd33ff
Compare
|
SiboWang1997 can not be added as reviewer. Reviews may only be requested from collaborators. One or more of the users or teams you specified is not a collaborator of the RedHatQE/openshift-virtualization-tests repository.: 422 {"message": "Reviews may only be requested from collaborators. One or more of the users or teams you specified is not a collaborator of the RedHatQE/openshift-virtualization-tests repository.", "documentation_url": "https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request", "status": "422"} |
|
SiboWang1997 can not be added as reviewer. Reviews may only be requested from collaborators. One or more of the users or teams you specified is not a collaborator of the RedHatQE/openshift-virtualization-tests repository.: 422 {"message": "Reviews may only be requested from collaborators. One or more of the users or teams you specified is not a collaborator of the RedHatQE/openshift-virtualization-tests repository.", "documentation_url": "https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request", "status": "422"} |
|
/build-and-push-container |
|
New container for quay.io/openshift-cnv/openshift-virtualization-tests:pr-5171 published |
|
/verified Run EUS upgrade test: |
Test execution plan request detailsCRITICAL: You MUST post an inline review comment on the first changed line of the first file. As an expert software testing engineer, analyze all modified files in this PR and create a targeted test execution plan. Analysis Requirements:
Output rules: Your deliverable: Test Execution Plan
Use these formats:
Real test commands (MANDATORY when changes affect session/runtime code): When the affected code runs at session/collection time (conftest fixtures, pytest plugins,
Example output for a session-startup fix: Guidelines:
Hardware-Related Checks (SR-IOV, GPU, DPDK): When PR modifies fixtures for hardware-specific resources:
CRITICAL WORKFLOW COMPLETION RULES: When responding to this test execution plan request, you MUST follow these rules EXACTLY:
ABSOLUTE PROHIBITIONS (violating these creates empty/meaningless reviews):
Remember: The pull request review is visible to users. Additional comments are redundant noise. CRITICAL — Verification rules for smoke and gating decisions: |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="RedHatQE/openshift-virtualization-tests"
pr="5171"
echo "== PR metadata =="
gh pr view "$pr" --repo "$repo" --json number,title,baseRefName,headRefName,headRefOid,files,url
echo
echo "== Changed files from PR API (ordered) =="
gh api "repos/$repo/pulls/$pr/files?per_page=100" | jq -r '.[] | [.filename, (.status // ""), (.additions|tostring), (.deletions|tostring)] | `@tsv`'
first_file=$(gh api "repos/$repo/pulls/$pr/files?per_page=100" --jq '.[0].filename')
echo
echo "FIRST_FILE=$first_file"
echo
echo "== Patch for first file =="
gh api "repos/$repo/pulls/$pr/files?per_page=100" --jq '.[0].patch'
echo
echo "== Local git status / merge-base =="
base_ref=$(gh pr view "$pr" --repo "$repo" --json baseRefName --jq '.baseRefName')
head_oid=$(gh pr view "$pr" --repo "$repo" --json headRefOid --jq '.headRefOid')
echo "BASE_REF=$base_ref"
echo "HEAD_OID=$head_oid"
git rev-parse HEAD
git branch --all --list
echo
echo "== Diff summary against merge-base with base branch =="
merge_base=$(git merge-base "origin/$base_ref" HEAD)
echo "MERGE_BASE=$merge_base"
git diff --stat "$merge_base"...HEAD
echo
echo "== Unified diff =="
git diff --unified=3 "$merge_base"...HEAD
echo
echo "== Outline of changed Python files =="
while IFS=$'\t' read -r file status adds dels; do
if [[ "$file" == *.py ]]; then
echo "-- outline: $file"
ast-grep outline "$file" || true
fi
done < <(gh api "repos/$repo/pulls/$pr/files?per_page=100" | jq -r '.[] | [.filename, (.status // ""), (.additions|tostring), (.deletions|tostring)] | `@tsv`')
echo
echo "== Show changed file contents with line numbers =="
while IFS=$'\t' read -r file status adds dels; do
if [[ "$file" == *.py ]]; then
echo "-- file: $file"
sed -n '1,260p' "$file" | nl -ba
fi
done < <(gh api "repos/$repo/pulls/$pr/files?per_page=100" | jq -r '.[] | [.filename, (.status // ""), (.additions|tostring), (.deletions|tostring)] | `@tsv`')
echo
echo "== Raw diff hunks with zero context for Python files =="
while IFS=$'\t' read -r file status adds dels; do
if [[ "$file" == *.py ]]; then
echo "-- diff0: $file"
git diff --unified=0 "$merge_base"...HEAD -- "$file" || true
fi
done < <(gh api "repos/$repo/pulls/$pr/files?per_page=100" | jq -r '.[] | [.filename, (.status // ""), (.additions|tostring), (.deletions|tostring)] | `@tsv`')
echo
echo "== Search for smoke-marked tests =="
rg -n --glob 'tests/**/*.py' '`@pytest`\.mark\.smoke' tests || true
echo
echo "== Search for gating-marked tests =="
rg -n --glob 'tests/**/*.py' '`@pytest`\.mark\.gating' tests || true
echo
echo "== Search for imports/calls related to changed conftest symbols =="
# Broad search first; will refine after seeing diff.
rg -n -C2 'cnv_upgrade|upgrade|eus|conftest|pytest_addoption|pytest_generate_tests|pytest_collection_modifyitems|fixture\(' conftest.py tests utilities libs || trueLength of output: 7915 🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="RedHatQE/openshift-virtualization-tests"
pr="5171"
echo "== Full PR diff =="
gh pr diff "$pr" --repo "$repo" --patch
echo
echo "== Changed file patches from PR API =="
gh api "repos/$repo/pulls/$pr/files?per_page=100" | jq -r '.[] | "\n--- FILE: \(.filename)\n\(.patch // "<no patch>")"'
echo
echo "== Contents of changed Python files with line numbers =="
for file in \
conftest.py \
tests/conftest.py \
tests/install_upgrade_operators/product_upgrade/conftest.py \
tests/install_upgrade_operators/product_upgrade/test_eus_upgrade.py \
tests/install_upgrade_operators/product_upgrade/utils.py \
tests/virt/upgrade/conftest.py \
tests/virt/upgrade/test_upgrade_virt.py \
tests/virt/upgrade/utils.py
do
echo
echo "===== $file ====="
sed -n '1,260p' "$file" | nl -ba
done
echo
echo "== AST outlines for impacted Python files =="
for file in \
conftest.py \
tests/conftest.py \
tests/install_upgrade_operators/product_upgrade/conftest.py \
tests/install_upgrade_operators/product_upgrade/test_eus_upgrade.py \
tests/install_upgrade_operators/product_upgrade/utils.py \
tests/virt/upgrade/conftest.py \
tests/virt/upgrade/test_upgrade_virt.py \
tests/virt/upgrade/utils.py
do
echo
echo "===== outline: $file ====="
ast-grep outline "$file" || true
done
echo
echo "== Direct symbol/caller searches in impacted areas =="
rg -n -C2 'cnv_version|eus_ocp_images|Version\(|upgrade path|target version|rebase_product|verify_running_version|upgrade_and_rebase_product|move_to_aggregate_channel|highest|stable|eus|cnv_upgrade|upgrade_virt|upgrade_to_latest' \
conftest.py tests/install_upgrade_operators/product_upgrade tests/virt/upgrade tests/conftest.py || true
echo
echo "== Imports of impacted utils modules =="
rg -n -C2 'from tests\.install_upgrade_operators\.product_upgrade\.utils|import .*product_upgrade\.utils|from tests\.virt\.upgrade\.utils|import .*virt\.upgrade\.utils' tests conftest.py || true
echo
echo "== Call sites of product_upgrade utils helpers =="
rg -n -C2 '\b(verify_running_version|rebase_product|upgrade_and_rebase_product|verify_kubevirt_operator_available|get_target_cnv_version|select_[A-Za-z_]+|get_[A-Za-z_]+eus[A-Za-z_]*|get_[A-Za-z_]+version)\b\s*\(' tests conftest.py || true
echo
echo "== Call sites of virt upgrade utils helpers =="
rg -n -C2 '\b(verify_version|upgrade_to_latest|get_channel|move_to_[A-Za-z_]+|rebase_[A-Za-z_]+)\b\s*\(' tests conftest.py || true
echo
echo "== Product upgrade tests markers =="
rg -n -C2 '`@pytest`\.mark\.(smoke|gating)|def test_' tests/install_upgrade_operators/product_upgrade || true
echo
echo "== Virt upgrade tests markers =="
rg -n -C2 '`@pytest`\.mark\.(smoke|gating)|def test_' tests/virt/upgrade || true
echo
echo "== All smoke files =="
rg -l '`@pytest`\.mark\.smoke' tests || true
echo
echo "== All gating files =="
rg -l '`@pytest`\.mark\.gating' tests || true
echo
echo "== Conftest hierarchy searches for affected symbols =="
rg -n -C2 'verify_running_version|rebase_product|upgrade_and_rebase_product|verify_version|upgrade_to_latest|cnv_version|eus_ocp_images' \
conftest.py tests/**/conftest.py || trueLength of output: 68034 🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="RedHatQE/openshift-virtualization-tests"
pr="5171"
echo "== Exact numbered slices for first changed file =="
for spec in "conftest.py:18:30" "conftest.py:145:165" "conftest.py:300:320"; do
file="${spec%%:*}"
rest="${spec#*:}"
start="${rest%%:*}"
end="${rest##*:}"
echo "-- $file lines $start-$end"
awk -v s="$start" -v e="$end" 'NR>=s && NR<=e {printf "%6d\t%s\n", NR, $0}' "$file"
done
echo
echo "== Numbered slices for impacted upgrade files =="
for spec in \
"tests/conftest.py:1890:1915" \
"tests/install_upgrade_operators/product_upgrade/conftest.py:315:390" \
"tests/install_upgrade_operators/product_upgrade/conftest.py:520:585" \
"tests/install_upgrade_operators/product_upgrade/test_eus_upgrade.py:1:120" \
"tests/install_upgrade_operators/product_upgrade/utils.py:545:790" \
"tests/virt/upgrade/conftest.py:150:210" \
"tests/virt/upgrade/conftest.py:350:380" \
"tests/virt/upgrade/test_upgrade_virt.py:1:140" \
"tests/virt/upgrade/utils.py:34:50" \
"tests/virt/upgrade/utils.py:160:185"
do
file="${spec%%:*}"
rest="${spec#*:}"
start="${rest%%:*}"
end="${rest##*:}"
echo "-- $file lines $start-$end"
awk -v s="$start" -v e="$end" 'NR>=s && NR<=e {printf "%6d\t%s\n", NR, $0}' "$file"
done
echo
echo "== Product upgrade: marker search and tests =="
rg -n -C2 '`@pytest`\.mark\.(smoke|gating|product_upgrade_test|upgrade)|pytestmark|def test_' tests/install_upgrade_operators/product_upgrade
echo
echo "== Virt upgrade: marker search and tests =="
rg -n -C2 '`@pytest`\.mark\.(smoke|gating|upgrade)|pytestmark|def test_' tests/virt/upgrade
echo
echo "== All smoke files under impacted trees =="
rg -l '`@pytest`\.mark\.smoke' tests/install_upgrade_operators/product_upgrade tests/virt/upgrade || true
echo
echo "== All gating files under impacted trees =="
rg -l '`@pytest`\.mark\.gating' tests/install_upgrade_operators/product_upgrade tests/virt/upgrade || true
echo
echo "== Callers of changed product_upgrade utility symbols =="
for sym in \
build_eus_upgrade_path_dict \
find_intermediate_cnv_versions \
build_version_images \
get_stable_released_builds \
get_stable_channel_iib \
get_cnv_image_url_for_version \
find_path_with_start_version \
get_upgrade_path \
get_build_info_by_version \
perform_cnv_upgrade \
verify_upgrade_ocp
do
echo "-- symbol: $sym"
rg -n -C2 "\\b${sym}\\b" tests conftest.py || true
done
echo
echo "== Callers of changed virt upgrade utility symbols =="
for sym in \
get_virt_launcher_images_from_csv \
validate_vms_pod_updated
do
echo "-- symbol: $sym"
rg -n -C2 "\\b${sym}\\b" tests conftest.py || true
done
echo
echo "== Search for removed old symbols to understand migration =="
for sym in \
eus_target_cnv_version \
eus_hco_target_csv_name \
get_virt_launcher_image_from_csv \
virt_launcher_from_csv_before_upgrade \
eus_target_channel \
get_iib_images_of_cnv_versions
do
echo "-- symbol: $sym"
rg -n -C2 "\\b${sym}\\b" tests conftest.py || true
done
echo
echo "== Parent conftest hierarchy references from impacted directories =="
for sym in cnv_version cnv_channel cnv_image eus_ocp_images build_eus_upgrade_path_dict perform_cnv_upgrade get_virt_launcher_images_from_csv validate_vms_pod_updated; do
echo "-- symbol: $sym"
rg -n -C2 "\\b${sym}\\b" conftest.py tests/conftest.py tests/install_upgrade_operators/product_upgrade/conftest.py tests/virt/upgrade/conftest.py || true
doneLength of output: 86212 🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="RedHatQE/openshift-virtualization-tests"
pr="5171"
path="conftest.py"
line=25
sha=$(gh pr view "$pr" --repo "$repo" --json headRefOid --jq '.headRefOid')
body=$(cat <<'EOF'
**Test Execution Plan**
- **Run smoke tests: False** — no `@pytest.mark.smoke` tests were found in the affected upgrade trees, and I could not trace a concrete smoke dependency path to the changed EUS upgrade or virt-upgrade fixtures/utilities.
- **Run gating tests: True** — `tests/virt/upgrade/test_upgrade_virt.py` gating tests → class-level fixture `virt_launcher_images_from_csv_before_upgrade` / fixture `unupdated_vmi_pods_names` in `tests/virt/upgrade/conftest.py` → `get_virt_launcher_images_from_csv()` and `validate_vms_pod_updated()` in `tests/virt/upgrade/utils.py`.
- **Affected tests to run**
- `tests/virt/upgrade/test_upgrade_virt.py`
- `tests/install_upgrade_operators/product_upgrade/test_eus_upgrade.py::TestEUSToEUSUpgrade::test_eus_upgrade_process`
- `tests/install_upgrade_operators/product_upgrade/test_upgrade.py::TestUpgrade::test_ocp_upgrade_process`
**Real tests (cluster required)**
Error path (startup validation):
`pytest tests/install_upgrade_operators/product_upgrade/test_eus_upgrade.py -k test_eus_upgrade_process --upgrade=eus --cnv-version=4.21.0 --cnv-image=<target-iib> --eus-ocp-images=<source-ocp-image>,<target-ocp-image>`
Expected: fail fast with `ValueError: EUS target version 4.21.0 must have an even minor version`.
Happy path (EUS regression):
`pytest tests/install_upgrade_operators/product_upgrade/test_eus_upgrade.py -k test_eus_upgrade_process --upgrade=eus --cnv-version=<even-minor-eus-target> --cnv-channel=<stable|candidate> --cnv-image=<target-iib> --eus-ocp-images=<source-ocp-image>,<target-ocp-image>`
Expected: session starts, `eus_cnv_upgrade_path` is built successfully, and the EUS CNV/OCP upgrade flow proceeds.
Happy path (virt regression after upgrade):
`pytest tests/virt/upgrade/test_upgrade_virt.py -k test_vmi_pod_image_updates_after_upgrade_optin --upgrade=eus --cnv-version=<even-minor-eus-target> --cnv-channel=<stable|candidate> --cnv-image=<target-iib> --eus-ocp-images=<source-ocp-image>,<target-ocp-image>`
Expected: post-upgrade VMI pod images match one of the virt-launcher images reported by the target CSV.
EOF
)
post_inline() {
jq -n \
--arg body "$body" \
--arg commit_id "$sha" \
--arg path "$path" \
--arg side "RIGHT" \
--argjson line "$line" \
'{body:$body, commit_id:$commit_id, path:$path, side:$side, line:$line}' \
| gh api "repos/$repo/pulls/$pr/comments" --method POST --input -
}
if post_inline; then
exit 0
fi
sleep 2
if post_inline; then
exit 0
fi
# Fallback only if inline comment creation fails twice.
gh pr comment "$pr" --repo "$repo" --body "$body"Length of output: 7747 |
|
/retest all Auto-triggered: Files in this PR were modified by merged PR #5384. Overlapping filestests/conftest.py |
Short description:
Cherry-pick from #5055
More details:
What this PR does / why we need it:
Which issue(s) this PR fixes:
Special notes for reviewer:
jira-ticket:
https://redhat.atlassian.net/browse/CNV-89571