engineering_analytics
engineering_analytics

Every workflow run attributed to a pull request, across all its commits (grouped by head SHA client-side), newest first. Run-level only.

get/api/projects/{project_id}/engineering_analytics/pr_runs/

Request

  • Base URL: https://us.posthog.com
  • URL: https://us.posthog.com/api/projects/{project_id}/engineering_analytics/pr_runs/
  • Auth: HTTP bearer

Path parameters

project_idstring required

Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Query parameters

pr_numberinteger required

Pull request number whose runs to list.

repostring required

'owner/name' repository the pull request belongs to.

source_idstring uuid

Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.

Response

idinteger required

Integer run id; unique only together with ci_engine.

workflow_namestring required

CI workflow name.

head_shastring required

Commit SHA the run was triggered on.

head_branchstring required

Git branch the run was triggered on.

statusstring required

Raw run status: 'queued', 'in_progress', 'completed', etc.

conclusionstring nullable required

Run conclusion ('success', 'failure', 'timed_out', 'cancelled', 'skipped', 'action_required', ...), or null while still in progress.

run_started_atstring date-time nullable required

When the run started, or null for a queued/barely-started run.

updated_atstring date-time nullable required

When the run was last updated (its finish time once completed), or null when unstarted.

duration_secondsinteger nullable required

Wall-clock duration in seconds; null until the run completes.

run_attemptinteger required

Re-run attempt number; 1 for the first attempt.

pr_numberinteger required

Pull request this run ran for, from the run's own-repo PR association; 0 when unattributed (a default-branch push, or a fork PR).

commit_pr_numberinteger nullable required

Pull request whose merge produced this run's head commit, resolved through the merged pull request's merge commit and falling back to the commit subject's '(#NNNN)' suffix. Null when neither resolves. The only PR attribution a default-branch push has: read pr_number first and fall back to this.

is_merge_queueboolean required

True when a merge queue pushed this run to gate pr_number, rather than the author pushing it. Count it when measuring CI; drop it when counting what the author did.

native_run_idstring nullable

Source-native run id; use with ci_engine for identity.

native_workflow_run_idstring nullable

Source-native workflow run id; use with ci_engine for identity.

workflow_idinteger nullable

GitHub's numeric id of the workflow. It stays the same when the workflow is renamed, so use it to follow one workflow over time. Null for a Depot CI run, and for a run whose source does not carry the id.

eventstring nullable

Event that triggered the run, such as 'push', 'pull_request' or 'schedule'. Null when unknown, as for a Depot CI run.

Changes

No recorded changes to this operation across all 1 revision of this API.