-
Notifications
You must be signed in to change notification settings - Fork 255
[QE] manage absence of xml filter to process xml result #4935
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughAdds runtime detection and attempted installation of xsltproc via yum with a retry using --nogpgcheck. Introduces conditional JUnit generation: use xsltproc when available; otherwise, write a raw tail of results/e2e.results. Removes the prior unconditional xsltproc pipeline. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Runner as run.sh
participant System as System Env
participant Yum as yum
participant xslt as xsltproc
participant Files as results/e2e.results & junit.xml
Runner->>System: Check xsltproc presence
alt xsltproc missing
Runner->>Yum: yum install xsltproc
alt install fails
Runner->>Yum: yum --nogpgcheck install xsltproc
Note right of Runner: Warn if retry fails
end
Runner->>System: Re-check xsltproc
end
alt xsltproc available
Runner->>xslt: Transform e2e.results -> JUnit via XSL
xslt-->>Files: Write junit file
else xsltproc unavailable
Runner->>Files: Write raw tail of e2e.results to junit file
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. 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 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (2)
images/build-e2e/lib/linux/run.sh (2)
64-65: Make init_line robust and quote paths.If grep finds no header or multiple matches, init_line may be empty/invalid; tail will error. Also, quote file paths.
-init_line=$(grep -n '<?xml version="1.0" encoding="UTF-8"?>' results/e2e.results | awk '{split($0,n,":"); print n[1]}') +init_line=$(grep -n -m1 $'^[[:space:]]*<\\?xml version="1\\.0" encoding="UTF-8"\\?>' "results/e2e.results" | cut -d: -f1) +[ -n "$init_line" ] || init_line=1Also applies to: 72-74
66-75: Optional: surface failures clearly and avoid silent pipe errors.Consider set -euo pipefail near the top and redirect warnings to stderr to fail fast and aid debugging. If you prefer not to change global shell options, at least check xsltproc’s exit code and return non‑zero while still writing a valid JUnit.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
images/build-e2e/lib/linux/run.sh(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (18)
- GitHub Check: build (ubuntu-22.04, 1.24)
- GitHub Check: build (ubuntu-latest, 1.24)
- GitHub Check: build (macOS-13, 1.24)
- GitHub Check: build-qe (linux, amd64)
- GitHub Check: build-qe (darwin, amd64)
- GitHub Check: build (macOS-14, 1.24)
- GitHub Check: build-qe (linux, arm64)
- GitHub Check: build-qe (darwin, arm64)
- GitHub Check: build-qe (windows, amd64)
- GitHub Check: build (ubuntu-latest, 1.24)
- GitHub Check: build-installer (windows-2022, 1.24)
- GitHub Check: build (macOS-14, 1.24)
- GitHub Check: build (macOS-13, 1.24)
- GitHub Check: verify-devcontainer
- GitHub Check: build (windows-2022, 1.24)
- GitHub Check: build (windows-2022, 1.24)
- GitHub Check: Run OKD bundle with crc (1.24)
- GitHub Check: Konflux kflux-prd-rh02 / crc-binary-on-pull-request
| then | ||
| sudo yum install -y xsltproc || sudo yum install -y --nogpgcheck xsltproc || echo "Warning: Failed to install xsltproc" | ||
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Install the correct package; avoid sudo hangs; gate --nogpgcheck behind an opt‑in.
On RHEL, the xsltproc binary is provided by the libxslt package. yum install xsltproc commonly fails with “No match”. Also, sudo may not exist or can hang awaiting a TTY. Finally, installing with --nogpgcheck should be opt‑in to reduce supply‑chain risk.
Apply this diff to harden installation:
-then
- sudo yum install -y xsltproc || sudo yum install -y --nogpgcheck xsltproc || echo "Warning: Failed to install xsltproc"
-fi
+then
+ # Choose package manager
+ PM=""
+ if command -v dnf &>/dev/null; then PM="dnf"; elif command -v yum &>/dev/null; then PM="yum"; fi
+ # Prefer running without sudo if already root; use non‑interactive sudo if available
+ SUDO=""
+ if [ "$EUID" -ne 0 ] && command -v sudo &>/dev/null; then SUDO="sudo -n"; fi
+ if [ -n "$PM" ]; then
+ # xsltproc is provided by libxslt on RHEL/Fedora
+ if ! $SUDO $PM -y install libxslt; then
+ if [ "${CRC_ALLOW_UNSIGNED:=}" = "1" ]; then
+ $SUDO $PM -y --nogpgcheck install libxslt || echo "Warning: Failed to install libxslt/xsltproc." >&2
+ else
+ echo "Warning: xsltproc missing and unsigned packages not allowed (set CRC_ALLOW_UNSIGNED=1 to allow pre-release unsigned install)." >&2
+ fi
+ fi
+ else
+ echo "Warning: No supported package manager found to install xsltproc." >&2
+ fi
+fi📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| then | |
| sudo yum install -y xsltproc || sudo yum install -y --nogpgcheck xsltproc || echo "Warning: Failed to install xsltproc" | |
| fi | |
| then | |
| # Choose package manager | |
| PM="" | |
| if command -v dnf &>/dev/null; then PM="dnf"; elif command -v yum &>/dev/null; then PM="yum"; fi | |
| # Prefer running without sudo if already root; use non‑interactive sudo if available | |
| SUDO="" | |
| if [ "$EUID" -ne 0 ] && command -v sudo &>/dev/null; then SUDO="sudo -n"; fi | |
| if [ -n "$PM" ]; then | |
| # xsltproc is provided by libxslt on RHEL/Fedora | |
| if ! $SUDO $PM -y install libxslt; then | |
| if [ "${CRC_ALLOW_UNSIGNED:=}" = "1" ]; then | |
| $SUDO $PM -y --nogpgcheck install libxslt || echo "Warning: Failed to install libxslt/xsltproc." >&2 | |
| else | |
| echo "Warning: xsltproc missing and unsigned packages not allowed (set CRC_ALLOW_UNSIGNED=1 to allow pre-release unsigned install)." >&2 | |
| fi | |
| fi | |
| else | |
| echo "Warning: No supported package manager found to install xsltproc." >&2 | |
| fi | |
| fi |
| if command -v xsltproc &>/dev/null | ||
| then | ||
| tail -n +$init_line results/e2e.results | xsltproc filter.xsl - > results/$junitFilename | ||
| else | ||
| tail -n +$init_line results/e2e.results > results/$junitFilename | ||
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Emit valid JUnit XML when xsltproc is unavailable.
Writing a raw tail into an .xml file produces invalid JUnit and can break report consumers. Generate a minimal, valid JUnit report embedding raw output in a failure message.
-if command -v xsltproc &>/dev/null
-then
- tail -n +$init_line results/e2e.results | xsltproc filter.xsl - > results/$junitFilename
-else
- tail -n +$init_line results/e2e.results > results/$junitFilename
-fi
+if command -v xsltproc &>/dev/null
+then
+ tail -n +${init_line:-1} "results/e2e.results" | xsltproc "filter.xsl" - > "results/$junitFilename"
+else
+ {
+ echo '<?xml version="1.0" encoding="UTF-8"?>'
+ echo '<testsuite name="crc-e2e" tests="1" failures="1">'
+ echo ' <testcase classname="crc.e2e" name="xsltproc-missing">'
+ echo ' <failure message="xsltproc not available; emitting raw results">'
+ echo '<![CDATA['
+ tail -n +${init_line:-1} "results/e2e.results"
+ echo ']]>'
+ echo ' </failure>'
+ echo ' </testcase>'
+ echo '</testsuite>'
+ } > "results/$junitFilename"
+fi🤖 Prompt for AI Agents
In images/build-e2e/lib/linux/run.sh around lines 70 to 75, when xsltproc is
missing the script currently writes raw tail output to results/$junitFilename
which is not valid JUnit XML; instead capture the tail output into a variable or
temp file, ensure results/ exists, and write a minimal valid JUnit XML file that
wraps the raw output (escaped or inside a CDATA) as the failure message—e.g.,
create a testsuite with tests="1" failures="1" and a single testcase whose
<failure> element contains the raw log, then write that XML to
results/$junitFilename so report consumers receive valid JUnit even without
xsltproc.
|
@albfan: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
| then | ||
| sudo yum install -y xsltproc || echo "Warning: Failed to install xsltproc" | ||
| then | ||
| sudo yum install -y xsltproc || sudo yum install -y --nogpgcheck xsltproc || echo "Warning: Failed to install xsltproc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we want to have a non signed package installed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are waiting for pre release RHEL to confirm if recent non signed packages is a mistake.
This is just a workaround, but probably we will refuse this change
Description
On RHEL pre releases xlstproc is failing to install due to unsigned package libxslt
This provide a fallback to install unsigned package, and control if finally command is available
Summary by CodeRabbit
Bug Fixes
Chores