ci: add medik8s-polarion-reporter Prow step for Polarion XUnit import#80497
ci: add medik8s-polarion-reporter Prow step for Polarion XUnit import#80497maximunited wants to merge 2 commits into
Conversation
Adds a new medik8s-polarion-reporter step ref that POSTs JUnit XML from $SHARED_DIR to Polarion's XUnit importer API using ubi credentials mounted from the medik8s-polarion-creds secret. Wires the step as a post phase into e2e-sbr-aws-odf and e2e-sbr-weekly-aws-odf. The weekly job sets POLARION_TESTRUN_ID=RHWA-SBR-4.22-weekly. Prerequisite: medik8s-polarion-creds secret must be provisioned in the test-credentials namespace via vault.ci.openshift.org (RHWA-844).
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: maximunited The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (3)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughIntroduces a new ChangesPolarion Reporter Step and Integration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (14 passed)
✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@ci-operator/step-registry/medik8s/polarion-reporter/medik8s-polarion-reporter-commands.sh`:
- Around line 34-38: Add explicit timeout and retry parameters to the curl
command in the http_code variable assignment to prevent indefinite blocking when
Polarion is slow or unreachable. Include connection timeout (--connect-timeout),
maximum operation timeout (--max-time), and retry settings (--retry and
--retry-delay) to the curl invocation. Additionally, consider disabling debug
tracing around the credential passing section where POLARION_USER and
POLARION_PASS are used to prevent credential exposure in logs if tracing is
enabled.
In
`@ci-operator/step-registry/medik8s/polarion-reporter/medik8s-polarion-reporter-ref.yaml`:
- Around line 29-32: The documentation in the yaml file states the glob pattern
as junit_*.xml, but the actual command script implementation uses *_junit.xml.
Update the documentation string in the medik8s-polarion-reporter-ref.yaml file
to match the actual glob pattern used in the command script by changing
junit_*.xml to *_junit.xml to ensure consistency and prevent user confusion
about the expected file naming convention.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 7066dc73-7f14-4e38-8d37-56b1d205b955
📒 Files selected for processing (3)
ci-operator/config/medik8s/system-tests/medik8s-system-tests-main__4.22-konflux.yamlci-operator/step-registry/medik8s/polarion-reporter/medik8s-polarion-reporter-commands.shci-operator/step-registry/medik8s/polarion-reporter/medik8s-polarion-reporter-ref.yaml
| http_code=$(curl --silent --output /tmp/polarion-response.txt --write-out "%{http_code}" \ | ||
| -u "${POLARION_USER}:${POLARION_PASS}" \ | ||
| -F "file=@${xml_file}" \ | ||
| -F "properties=@${properties_file}" \ | ||
| "${IMPORT_URL}") |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify current curl invocation in the reporter step lacks explicit timeout flags.
rg -n -C2 'http_code=\$\(curl|--connect-timeout|--max-time|--retry' ci-operator/step-registry/medik8s/polarion-reporter/medik8s-polarion-reporter-commands.shRepository: openshift/release
Length of output: 374
Add explicit curl timeouts and retries to prevent indefinite blocking on Polarion requests.
The current curl invocation lacks per-request timeout bounds. If Polarion is slow or unreachable, this request can block until the step-level timeout expires. Adding explicit timeouts and retries ensures faster failure and deterministic retry behavior.
Suggested patch
- http_code=$(curl --silent --output /tmp/polarion-response.txt --write-out "%{http_code}" \
+ http_code=$(curl --silent --output /tmp/polarion-response.txt --write-out "%{http_code}" \
+ --connect-timeout 10 \
+ --max-time 120 \
+ --retry 2 \
+ --retry-delay 2 \
+ --retry-connrefused \
-u "${POLARION_USER}:${POLARION_PASS}" \
-F "file=@${xml_file}" \
-F "properties=@${properties_file}" \
"${IMPORT_URL}")Note: This script passes credentials via -u "${POLARION_USER}:${POLARION_PASS}". If debug tracing is enabled (set -x), these will be exposed in logs. Consider temporarily disabling tracing around credential operations per the CLAUDE.md security guidelines.
📝 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.
| http_code=$(curl --silent --output /tmp/polarion-response.txt --write-out "%{http_code}" \ | |
| -u "${POLARION_USER}:${POLARION_PASS}" \ | |
| -F "file=@${xml_file}" \ | |
| -F "properties=@${properties_file}" \ | |
| "${IMPORT_URL}") | |
| http_code=$(curl --silent --output /tmp/polarion-response.txt --write-out "%{http_code}" \ | |
| --connect-timeout 10 \ | |
| --max-time 120 \ | |
| --retry 2 \ | |
| --retry-delay 2 \ | |
| --retry-connrefused \ | |
| -u "${POLARION_USER}:${POLARION_PASS}" \ | |
| -F "file=@${xml_file}" \ | |
| -F "properties=@${properties_file}" \ | |
| "${IMPORT_URL}") |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@ci-operator/step-registry/medik8s/polarion-reporter/medik8s-polarion-reporter-commands.sh`
around lines 34 - 38, Add explicit timeout and retry parameters to the curl
command in the http_code variable assignment to prevent indefinite blocking when
Polarion is slow or unreachable. Include connection timeout (--connect-timeout),
maximum operation timeout (--max-time), and retry settings (--retry and
--retry-delay) to the curl invocation. Additionally, consider disabling debug
tracing around the credential passing section where POLARION_USER and
POLARION_PASS are used to prevent credential exposure in logs if tracing is
enabled.
| documentation: |- | ||
| Uploads JUnit XML test results from $SHARED_DIR to Polarion via the XUnit | ||
| importer API. Reads credentials from the medik8s-polarion-creds secret. | ||
| Must run after the test step that writes junit_*.xml files to $SHARED_DIR. |
There was a problem hiding this comment.
Align the documented XML glob with the implemented one.
The docs say junit_*.xml, but the command script matches *_junit.xml. Please make these consistent to avoid operator confusion.
Suggested patch
- Must run after the test step that writes junit_*.xml files to $SHARED_DIR.
+ Must run after the test step that writes *_junit.xml files to $SHARED_DIR.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@ci-operator/step-registry/medik8s/polarion-reporter/medik8s-polarion-reporter-ref.yaml`
around lines 29 - 32, The documentation in the yaml file states the glob pattern
as junit_*.xml, but the actual command script implementation uses *_junit.xml.
Update the documentation string in the medik8s-polarion-reporter-ref.yaml file
to match the actual glob pattern used in the command script by changing
junit_*.xml to *_junit.xml to ensure consistency and prevent user confusion
about the expected file naming convention.
- Add best_effort: true so a Polarion outage doesn't mark passing jobs failed - Switch from ocp/4.1:base (EOL) to from: cli for a current, curl-bearing image - Remove reporter from e2e-sbr-aws-odf presubmit to avoid orphan Polarion test runs per PR trigger - Pass credentials via netrc file instead of -u user:pass to keep them out of the process argv - XML-escape POLARION_PROJECT_ID and POLARION_TESTRUN_ID before writing to properties XML - Guard against empty SHARED_DIR before globbing - Use a per-run tempfile for the curl response instead of a fixed path
|
[REHEARSALNOTIFIER]
Interacting with pj-rehearseComment: Once you are satisfied with the results of the rehearsals, comment: |
|
@maximunited: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
Summary
step-registry/medik8s/polarion-reporter/— a new post-phase step that POSTs*_junit.xmlfrom$SHARED_DIRto Polarion's XUnit importer API using credentials mounted frommedik8s-polarion-credse2e-sbr-aws-odfande2e-sbr-weekly-aws-odf; the weekly job setsPOLARION_TESTRUN_ID=RHWA-SBR-4.22-weeklyubi base+curlRelated
Blocked on
medik8s-polarion-credssecret must be provisioned in the CItest-credentialsnamespace via vault.ci.openshift.org before the reporter step will function at runtime. The step itself exits gracefully (no error) if no XML files are found in$SHARED_DIR.Summary by CodeRabbit
This PR adds automated Polarion test result reporting to the OpenShift CI infrastructure for the medik8s/system-tests repository. It implements a new post-phase Prow step that collects JUnit XML test results from the shared test directory and uploads them to Polarion's XUnit importer API for centralized test tracking.
Infrastructure changes:
New Prow step registry entry (
medik8s-polarion-reporter):medik8s-polarion-credssecret*_junit.xmlfiles from$SHARED_DIRto Polarion via multipart form POSTIntegration into two SBR (System Builder Recipes) jobs in the 4.22 configuration:
e2e-sbr-aws-odf: Standard job that reports results using the default project ID (OSE)e2e-sbr-weekly-aws-odf: Weekly job (runs Sunday 6am UTC) configured withPOLARION_TESTRUN_ID=RHWA-SBR-4.22-weeklyto consolidate weekly test runsThe implementation is non-blocking—jobs will not fail if the reporter step encounters issues—and depends on the
medik8s-polarion-credssecret being provisioned in the test-credentials namespace before runtime.