CircleCI-Archived / api-preview-docs

In-progress docs about the pre-release preview of CircleCI API v2
72 stars 39 forks source link

Desired: Ability to query (filtered) workflows for a project. #16

Closed eddiewebb closed 4 years ago

eddiewebb commented 5 years ago

Current Preview endpoints include specific workflows (GET /workflow/:id) and project details (GET /project/:project_slug) but no way to get the list of workflows for a project. This feels like a gap given our V1 API allowed all jobs for a project, and without a listing/index I don't understand where the workflow_ID would come from unless running inside a job.

This endpoint is important for essentially any API call that needs to discover workflow IDs, statuses, etc.

It would be particularly useful for my Queuing orb to understand all running workflows for the current project since querying individual jobs can have a race condition in the transitions between jobs. https://github.com/eddiewebb/circleci-queue/issues/26

ndintenfass commented 5 years ago

We are likely to first add a way to list recent pipelines, each of which would know its workflow IDs. We might also add a way to query directly to recent workflows for a project and/or triggerer, but that's still TBD.

eddiewebb commented 5 years ago

A listing of all pipelines (ideally still supporting the filters, including date :D) that included their workflow IDs would be perfectly sufficient for my use cases.

ndintenfass commented 4 years ago

@eddiewebb you can now retrieve recent pipelines for a project using GET /project/:project_slug/pipeline/

eddiewebb commented 4 years ago

Woot!

https://github.com/CircleCI-Public/api-preview-docs/blob/master/docs/api-changes.md#get-projectproject_slugpipeline is light on details.

ndintenfass commented 4 years ago

We don’t yet have any filtering. Recent really means ordered descending by date. The endpoint is paginated.