API: jobs endpoint should have more filtering options
Contents
The jobs api is pretty limited compared to pipelines and only allows search by scope
.
Proposal
It should be possible to search jobs by job_name
and ref
.
Real world example
In our pipelines we have dozens of jobs over dozens of branches, and they end with a deploy
job.
I'd like to find only currently running or recently finished deploy
jobs targeting production
.
This is not currently possible. The workarounds could be constructed but they would be very poor:
- find all jobs via several paginated calls, and filter them down to branch and job name on client side: Doable but would require many calls to give reasonable number of matching items
- find recent pipelines for a given branch, and get
deploy
jobs from those: This is not correct, because there might be some outdated pipelines that won't show up via this query that got adeploy
job triggered (by mistake etc.)