CICD-497 · Change failure rate measurement
Encyclopedia · Pipeline governance and operational management · All snippets
Previous · CICD-496 · Next · CICD-498
1. Where it fits
- Placement delivery metrics report.
- Prerequisites trusted policy checkout and normalized deployment events with scoped access.
- Platforms local-linux, github-actions, gitea-actions.
2. Copy the snippet
bash
jq -s '[.[]|select(.environment=="production")]|unique_by(.deployment_id)|if length>0 then (map(select(.caused_failure==true))|length)/length else null end' week-deployments.jsonl3. How it works
The expression filters or transforms the input JSON. Where jq -e is used, a false or empty result can fail the gate.
4. Verify the result
Count deployment-caused failures linked by deployment ID. Do not infer failure only from CI status.
Validation syntax-validated (Bash parse). Status definitions.