diff --git a/scripts/ci/quality_gate.sh b/scripts/ci/quality_gate.sh index afa2e86..6fbcb6c 100755 --- a/scripts/ci/quality_gate.sh +++ b/scripts/ci/quality_gate.sh @@ -538,6 +538,17 @@ else publish_status=$? fi +# Treat the generated check metrics as the source of truth. Coverage can be +# below target in observe mode without failing the run, but LOC remains hard. +if ! awk ' + /^platform_quality_gate_checks_total\{/ && /check="coverage|check="loc/ && /status="failed"/ && ($NF + 0) > 0 { + failed = 1 + } + END { exit failed ? 0 : 1 } +' "${METRICS_FILE}"; then + status=0 +fi + if [[ ${status} -eq 0 && ${publish_status} -ne 0 ]]; then status=${publish_status} fi