95.5% fail rate for Validate pipelines on master in the last month
with pipe as (select *
from ci_pipelines p
where p.project_id = 1
and p.status in ('success', 'failed')
and p.created_at > now() - interval '1 month'
and p.pipeline_schedule_id is null
and p.ref = 'master')
select format('[%s](%s)', j.name, 'https://gitlab.haskell.org/ghc/ghc/-/jobs/' || j.id :: text) "job",
format('[Pipeline #%s}(%s)', pipe.id, 'https://gitlab.haskell.org/ghc/ghc/-/pipelines/' || pipe.id) :: text "pipeline",
pipe.created_at
from ci_builds j
join ci_stages s
on j.stage_id = s.id
join pipe
on s.pipeline_id = pipe.id
where j.status = 'failed'
and not j.allow_failure
order by j.name, pipe.created_at