Skip to main content

project_pipeline

Gets or lists a project_pipeline resource.

Overview​

Nameproject_pipeline
TypeResource
Idgitlab.ci.project_pipeline

Fields​

The following fields are returned by SELECT queries:

GraphQL response envelope

NameDatatypeDescription
idstringID of the pipeline.
namestringName of the pipeline.
activebooleanIndicates if the pipeline is active.
before_shastringBase SHA of the source branch.
cancelablebooleanSpecifies if a pipeline can be canceled.
childbooleanIf the pipeline is a child or not.
commit_pathstringPath to the commit that triggered the pipeline.
committed_atstringTimestamp of the pipeline's commit.
completebooleanIndicates if a pipeline is complete.
compute_minutesnumberTotal minutes consumed by the pipeline.
config_sourcestringConfiguration source of the pipeline (UNKNOWN_SOURCE, REPOSITORY_SOURCE, AUTO_DEVOPS_SOURCE, WEBIDE_SOURCE, REMOTE_SOURCE, EXTERNAL_PROJECT_SOURCE, BRIDGE_SOURCE, PARAMETER_SOURCE, COMPLIANCE_SOURCE, SECURITY_POLICIES_DEFAULT_SOURCE, PIPELINE_EXECUTION_POLICY_FORCED, SECURITY_SCAN_PROFILES_SOURCE) (UNKNOWN_SOURCE, REPOSITORY_SOURCE, AUTO_DEVOPS_SOURCE, WEBIDE_SOURCE, REMOTE_SOURCE, EXTERNAL_PROJECT_SOURCE, BRIDGE_SOURCE, PARAMETER_SOURCE, COMPLIANCE_SOURCE, SECURITY_POLICIES_DEFAULT_SOURCE, PIPELINE_EXECUTION_POLICY_FORCED, SECURITY_SCAN_PROFILES_SOURCE)
coveragenumberCoverage percentage.
created_atstringTimestamp of the pipeline's creation.
durationintegerDuration of the pipeline in seconds.
failed_jobs_countintegerNumber of failed jobs in the pipeline, including trigger jobs and external jobs.
failure_reasonstringReason why the pipeline failed.
finished_atstringTimestamp of the pipeline's completion.
has_manual_actionsbooleanIndicates if the pipeline has manual actions.
has_scheduled_actionsbooleanIndicates if the pipeline has scheduled actions.
iidstringInternal ID of the pipeline.
latestbooleanIf the pipeline is the latest one or not.
merge_request_event_typestringEvent type of the pipeline associated with a merge request. (MERGED_RESULT, DETACHED, MERGE_TRAIN)
pathstringRelative path to the pipeline's page.
projectobjectProject identity (id, full_path, name)
queued_durationstringHow long the pipeline was queued before starting.
refstringReference to the branch from which the pipeline was triggered.
ref_pathstringReference path to the branch from which the pipeline was triggered.
ref_textstringReference text from the presenter.
retryablebooleanSpecifies if a pipeline's jobs can be retried.
shastringSHA of the pipeline's commit.
sourcestringSource of the pipeline.
started_atstringTimestamp when the pipeline was started.
statusstringStatus of the pipeline (CREATED, WAITING_FOR_RESOURCE, PREPARING, WAITING_FOR_CALLBACK, PENDING, RUNNING, FAILED, SUCCESS, CANCELED, CANCELING, SKIPPED, MANUAL, SCHEDULED) (CREATED, WAITING_FOR_RESOURCE, PREPARING, WAITING_FOR_CALLBACK, PENDING, RUNNING, FAILED, SUCCESS, CANCELING, CANCELED, SKIPPED, MANUAL, SCHEDULED)
stuckbooleanIf the pipeline is stuck.
total_jobsintegerTotal number of jobs in the pipeline.
triggerbooleanIf the pipeline was created by a Trigger request.
triggered_by_pathstringPath that triggered the pipeline.
troubleshoot_job_with_aibooleanIf the user can troubleshoot jobs of a pipeline.
typestringType of the pipeline.
updated_atstringTimestamp of the pipeline's last activity.
userobjectUserCore identity (id, username, name)
uses_needsbooleanIndicates if the pipeline has jobs with needs dependencies.
warningsbooleanIndicates if a pipeline has warnings.
yaml_error_messagesstringPipeline YAML errors.
yaml_errorsbooleanIf the pipeline has YAML errors.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectfull_path, hostid, iid, shaPipeline of the project. If no arguments are provided, returns the latest pipeline for the head commit on the default branch Generated from the GitLab GraphQL schema field Project.pipeline (Pipeline).

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
full_pathstringFull path of the project, for example gitlab-org/gitlab
hoststringGitLab host, with an optional port (default gitlab.com). Resolved from the GITLAB_HOST environment variable when it is set (x-stackQL-envVar); a WHERE host value always takes precedence. Self-managed instances: the provider is generated from the gitlab.com schema, so older instances may reject fields they do not serve. (default: gitlab.com, x-stackQL-envVar: GITLAB_HOST)
idstringGlobal ID of the Pipeline. For example, "gid:​//gitlab/Ci::Pipeline/314".
iidstringIID of the Pipeline. For example, "1".
shastringSHA of the Pipeline. For example, "dyd0f15ay83993f5ab66k927w28673882x99100b".

SELECT examples​

Pipeline of the project. If no arguments are provided, returns the latest pipeline for the head commit on the default branch Generated from the GitLab GraphQL schema field Project.pipeline (Pipeline).

SELECT
id,
name,
active,
before_sha,
cancelable,
child,
commit_path,
committed_at,
complete,
compute_minutes,
config_source,
coverage,
created_at,
duration,
failed_jobs_count,
failure_reason,
finished_at,
has_manual_actions,
has_scheduled_actions,
iid,
latest,
merge_request_event_type,
path,
project,
queued_duration,
ref,
ref_path,
ref_text,
retryable,
sha,
source,
started_at,
status,
stuck,
total_jobs,
trigger,
triggered_by_path,
troubleshoot_job_with_ai,
type,
updated_at,
user,
uses_needs,
warnings,
yaml_error_messages,
yaml_errors
FROM gitlab.ci.project_pipeline
WHERE full_path = '{{ full_path }}' -- required
AND host = '{{ host }}' -- required (defaults to gitlab.com; or set GITLAB_HOST)
AND id = '{{ id }}'
AND iid = '{{ iid }}'
AND sha = '{{ sha }}'
;