Insights API endpoints not returning data

The Insights API endpoints allow you to pull information about workflows and jobs, there are several endpoints outlined here:

https://circleci.com/docs/api/v2/#tag/Insights

There are a few caveats when utilizing these endpoints where you may find the response you receive back isn't what you are expecting.

Not specifying a branch parameter

The Insights endpoints are scoped to branches, and if you don't pass a branch parameter we will pull the data for the default branch of your project.

However, a new parameter was introduced all-brancheswhich is a boolean parameter. If you set it to true you will get information back on all branches.

The workflow is currently "On-Hold"

We will only return data for workflows that have moved to an "end" state -- i.e. "Success", "Failed", "Cancelled".

Since an "On-Hold" workflow is technically still running, the workflow and job data associated with it will not be returned.

The workflow was started by a tag

At the moment we will only return data from the Insights endpoints if the workflow was started from a branch. Any workflow that was started by a tag will not be returned in the API responses.

You can add a vote to the request to implement that here:

https://circleci.canny.io/insights-dashboard-feedback/p/show-tags-in-insights

and here:

https://circleci.canny.io/api-feature-requests/p/include-workflows-triggered-by-tag-pushes-in-the-insights-api

Was this article helpful?
1 out of 1 found this helpful

Comments

0 comments

Article is closed for comments.