diff --git a/ci-operator/step-registry/redhat-developer/rhdh-plugin-export-overlays/ocp/helm/redhat-developer-rhdh-plugin-export-overlays-ocp-helm-commands.sh b/ci-operator/step-registry/redhat-developer/rhdh-plugin-export-overlays/ocp/helm/redhat-developer-rhdh-plugin-export-overlays-ocp-helm-commands.sh index 98be0e5bfc661..2347d17f461b1 100644 --- a/ci-operator/step-registry/redhat-developer/rhdh-plugin-export-overlays/ocp/helm/redhat-developer-rhdh-plugin-export-overlays-ocp-helm-commands.sh +++ b/ci-operator/step-registry/redhat-developer/rhdh-plugin-export-overlays/ocp/helm/redhat-developer-rhdh-plugin-export-overlays-ocp-helm-commands.sh @@ -206,9 +206,18 @@ collect_artifacts() { cp -a node_modules/.cache/e2e-test-results "${ARTIFACT_DIR}/" 2>&1 || echo "[WARNING] e2e-test-results not found" fi # Copy JUnit results to SHARED_DIR for data-router step + # Gzip to stay under Kubernetes Secret 1 MiB limit (raw XML can exceed it) if [[ -f "playwright-report/junit-results.xml" ]]; then - cp "playwright-report/junit-results.xml" "${SHARED_DIR}/" - echo "[INFO] Copied junit-results.xml to ${SHARED_DIR}/" + gzip -c "playwright-report/junit-results.xml" > "${SHARED_DIR}/junit-results.xml.gz" + local gz_size + gz_size=$(stat -c%s "${SHARED_DIR}/junit-results.xml.gz" 2>/dev/null || stat -f%z "${SHARED_DIR}/junit-results.xml.gz") + local max_size=$((800 * 1024)) + if (( gz_size > max_size )); then + echo "[WARNING] junit-results.xml.gz is $(( gz_size / 1024 )) KB, exceeds $(( max_size / 1024 )) KB limit. Removing from SHARED_DIR to prevent Secret update failure." + rm -f "${SHARED_DIR}/junit-results.xml.gz" + else + echo "[INFO] Copied junit-results.xml.gz to ${SHARED_DIR}/ ($(( gz_size / 1024 )) KB)" + fi fi } diff --git a/ci-operator/step-registry/redhat-developer/rhdh-plugin-export-overlays/ocp/helm/redhat-developer-rhdh-plugin-export-overlays-ocp-helm-ref.yaml b/ci-operator/step-registry/redhat-developer/rhdh-plugin-export-overlays/ocp/helm/redhat-developer-rhdh-plugin-export-overlays-ocp-helm-ref.yaml index 0777f7bceb287..31b1b48ad83ca 100644 --- a/ci-operator/step-registry/redhat-developer/rhdh-plugin-export-overlays/ocp/helm/redhat-developer-rhdh-plugin-export-overlays-ocp-helm-ref.yaml +++ b/ci-operator/step-registry/redhat-developer/rhdh-plugin-export-overlays/ocp/helm/redhat-developer-rhdh-plugin-export-overlays-ocp-helm-ref.yaml @@ -33,8 +33,8 @@ ref: timeout: 3h30m0s resources: limits: - memory: 8Gi - cpu: "4" + cpu: "10" + memory: 5Gi requests: - cpu: "2" - memory: 6Gi + cpu: "1" + memory: 1Gi diff --git a/ci-operator/step-registry/redhat-developer/rhdh-plugin-export-overlays/send/data-router/redhat-developer-rhdh-plugin-export-overlays-send-data-router-commands.sh b/ci-operator/step-registry/redhat-developer/rhdh-plugin-export-overlays/send/data-router/redhat-developer-rhdh-plugin-export-overlays-send-data-router-commands.sh index ab4f8b3cc9616..379562bdcaa3d 100644 --- a/ci-operator/step-registry/redhat-developer/rhdh-plugin-export-overlays/send/data-router/redhat-developer-rhdh-plugin-export-overlays-send-data-router-commands.sh +++ b/ci-operator/step-registry/redhat-developer/rhdh-plugin-export-overlays/send/data-router/redhat-developer-rhdh-plugin-export-overlays-send-data-router-commands.sh @@ -1,7 +1,8 @@ #!/bin/bash +# This post step must never fail the overall CI job — it is a reporting step. +# errexit is disabled so errors are handled internally (retries, warnings, graceful skips). set +o errexit -set +o nounset # Skip data router reporting when job was triggered via Gangway API with overrides OVERRIDE_VARS=( @@ -87,8 +88,20 @@ get_artifacts_url() { process_junit_file() { echo "Processing JUnit file for Data Router compatibility..." - local junit_file="${SHARED_DIR}/junit-results.xml" - if [[ ! -f "$junit_file" ]]; then + mkdir -p "${ARTIFACT_DIR}/data-router" + + local junit_gz="${SHARED_DIR}/junit-results.xml.gz" + local junit_shared="${SHARED_DIR}/junit-results.xml" + local junit_file="${ARTIFACT_DIR}/data-router/junit-results.xml" + + # Decompress gzipped junit to ARTIFACT_DIR (new format); fall back to plain XML (backward compat) + if [[ -f "$junit_gz" ]]; then + gunzip -c "$junit_gz" > "$junit_file" + echo "Decompressed junit-results.xml.gz -> ${junit_file}" + elif [[ -f "$junit_shared" ]]; then + cp "$junit_shared" "$junit_file" + echo "Copied junit-results.xml from SHARED_DIR to ARTIFACT_DIR" + else echo "WARNING: junit-results.xml not found in ${SHARED_DIR}, skipping processing" return fi @@ -96,7 +109,6 @@ process_junit_file() { echo "Processing: junit-results.xml" # Create backup in ARTIFACT_DIR - mkdir -p "${ARTIFACT_DIR}/data-router" cp "$junit_file" "${ARTIFACT_DIR}/data-router/junit-results.xml.original.xml" # Construct artifacts URL for attachment placeholder replacement @@ -253,9 +265,10 @@ main() { local output="" local DATA_ROUTER_REQUEST_ID="" - if [[ ! -f "${SHARED_DIR}/junit-results.xml" ]]; then - echo "ERROR: No JUnit results file (junit-results.xml) found in ${SHARED_DIR}" - return + local junit_for_send="${ARTIFACT_DIR}/data-router/junit-results.xml" + if [[ ! -f "$junit_for_send" ]]; then + echo "WARNING: No JUnit results file found (processed by process_junit_file), skipping Data Router upload" + return 0 fi for ((i = 1; i <= max_attempts; i++)); do @@ -265,7 +278,7 @@ main() { --url "${DATA_ROUTER_URL}" \ --username "${DATA_ROUTER_USERNAME}" \ --password "${DATA_ROUTER_PASSWORD}" \ - --results "${SHARED_DIR}/junit-results.xml" \ + --results "$junit_for_send" \ --verbose --wirelog 2>&1) && \ DATA_ROUTER_REQUEST_ID=$(echo "$output" | grep "request:" | awk '{print $2}') && [ -n "$DATA_ROUTER_REQUEST_ID" ]; then @@ -320,3 +333,6 @@ main() { } main + +# Ensure this reporting step never fails the CI job regardless of what main() returned +exit 0 diff --git a/ci-operator/step-registry/redhat-developer/rhdh/send/data-router/redhat-developer-rhdh-send-data-router-commands.sh b/ci-operator/step-registry/redhat-developer/rhdh/send/data-router/redhat-developer-rhdh-send-data-router-commands.sh index 3de25deafc75c..b4e12671ebae3 100644 --- a/ci-operator/step-registry/redhat-developer/rhdh/send/data-router/redhat-developer-rhdh-send-data-router-commands.sh +++ b/ci-operator/step-registry/redhat-developer/rhdh/send/data-router/redhat-developer-rhdh-send-data-router-commands.sh @@ -1,7 +1,8 @@ #!/bin/bash +# This post step must never fail the overall CI job — it is a reporting step. +# errexit is disabled so errors are handled internally (retries, warnings, graceful skips). set +o errexit -set +o nounset # Skip data router reporting when job was triggered via Gangway API with overrides OVERRIDE_VARS=( @@ -96,7 +97,30 @@ get_artifacts_url() { process_junit_files() { echo "📝 Processing JUnit files for Data Router compatibility..." - for junit_file in "${SHARED_DIR}"/junit-results-*.xml; do + mkdir -p "${ARTIFACT_DIR}/data-router" + + # Decompress gzipped junit files to ARTIFACT_DIR (new format); copy plain XML as fallback (backward compat) + for junit_gz in "${SHARED_DIR}"/junit-results-*.xml.gz; do + if [[ -f "$junit_gz" ]]; then + local filename + filename=$(basename "${junit_gz%.gz}") + gunzip -c "$junit_gz" > "${ARTIFACT_DIR}/data-router/${filename}" + echo "Decompressed $(basename "$junit_gz") -> ${ARTIFACT_DIR}/data-router/${filename}" + fi + done + for junit_shared in "${SHARED_DIR}"/junit-results-*.xml; do + if [[ -f "$junit_shared" ]]; then + local filename + filename=$(basename "$junit_shared") + # Only copy if not already decompressed from .gz + if [[ ! -f "${ARTIFACT_DIR}/data-router/${filename}" ]]; then + cp "$junit_shared" "${ARTIFACT_DIR}/data-router/${filename}" + echo "Copied ${filename} from SHARED_DIR to ARTIFACT_DIR" + fi + fi + done + + for junit_file in "${ARTIFACT_DIR}"/data-router/junit-results-*.xml; do if [[ ! -f "$junit_file" ]]; then continue fi @@ -204,9 +228,9 @@ save_data_router_metadata() { --arg name "$JOB_NAME" \ --arg description "[View job run details](${JOB_URL})" \ --arg job_type "$JOB_TYPE" \ - --arg pr "$GIT_PR_NUMBER" \ + --arg pr "${GIT_PR_NUMBER:-}" \ --arg job_name "$JOB_NAME" \ - --arg tag_name "$TAG_NAME" \ + --arg tag_name "${TAG_NAME:-}" \ --arg install_method "$install_method" \ --arg cluster_type "$cluster_type" \ --arg container_platform "$CONTAINER_PLATFORM" \ @@ -270,9 +294,9 @@ main() { for ((i = 1; i <= max_attempts; i++)); do echo "Attempt ${i} of ${max_attempts} to send test results through Data Router." - # Check if JUnit results files exist in SHARED_DIR + # Check if JUnit results files exist in ARTIFACT_DIR (decompressed by process_junit_files) local junit_files_found=false - for file in "${SHARED_DIR}"/junit-*.xml; do + for file in "${ARTIFACT_DIR}"/data-router/junit-*.xml; do if [[ -f "$file" ]]; then junit_files_found=true break @@ -280,15 +304,15 @@ main() { done if [[ "$junit_files_found" == false ]]; then - echo "ERROR: No JUnit results files (junit-*.xml) found in ${SHARED_DIR}" - return + echo "WARNING: No JUnit results files (junit-*.xml) found in ${ARTIFACT_DIR}/data-router, skipping Data Router upload" + return 0 fi if output=$(droute send --metadata "$(get_metadata_output_path)" \ --url "${DATA_ROUTER_URL}" \ --username "${DATA_ROUTER_USERNAME}" \ --password "${DATA_ROUTER_PASSWORD}" \ - --results "${SHARED_DIR}/junit-*.xml" \ + --results "${ARTIFACT_DIR}/data-router/junit-*.xml" \ --verbose --wirelog 2>&1) && \ DATA_ROUTER_REQUEST_ID=$(echo "$output" | grep "request:" | awk '{print $2}') && [ -n "$DATA_ROUTER_REQUEST_ID" ]; then @@ -349,3 +373,6 @@ main() { } main + +# Ensure this reporting step never fails the CI job regardless of what main() returned +exit 0