[semver:minor] Detect on-hold pipelines
Opened this issue · 1 comments
Is your feature request related to a problem? Please describe.
I've noticed when using the queue, Circle CI doesn't list a pipeline as running when using the running filter if the pipeline is using the hold job (ex: https://circleci.com/docs/workflows#holding-a-workflow-for-a-manual-approval), so subsequent pipelines may kick off while in that waiting period. (I think this might be a circle limitation but wanted to see if you had any ideas)
Describe the solution you'd like
The queue would be able to block until all running or on_hold pipelines were finished.
Describe alternatives you've considered
I'm trying to think of workarounds, and that might be ultimately what is needed, but wanted to create an issue to see if this was a known problem or if other people have found workarounds.
Additional context
This fork uses circleci v2 api to get workflows and check their status. Unfortunately, it only checks for "running" or "created" status, not "on_hold". I may open a PR there. https://github.com/promiseofcake/circleci-workflow-queue/blob/main/src/scripts/queue.sh#L69
This change might be difficult in this orb because the "root" API call is getting a list running jobs from v1 API. Incorporating this feature would mean revamping the entire wait loop to fetch to fetch all workflows for a project (get pipelines for project, then get workflows for each pipeline, each result possibly paginated), then filtering on status. This is an entirely different use-case than if block-workflow
is false, which just checks for individual jobs that are running.
My recommendation is to use the forked orb that specializes on serializing workflows, once my PR there is approved :)