project_pipeline
Gets or lists a project_pipeline resource.
Overview​
| Name | project_pipeline |
| Type | Resource |
| Id | gitlab.ci.project_pipeline |
Fields​
The following fields are returned by SELECT queries:
- get
GraphQL response envelope
| Name | Datatype | Description |
|---|---|---|
id | string | ID of the pipeline. |
name | string | Name of the pipeline. |
active | boolean | Indicates if the pipeline is active. |
before_sha | string | Base SHA of the source branch. |
cancelable | boolean | Specifies if a pipeline can be canceled. |
child | boolean | If the pipeline is a child or not. |
commit_path | string | Path to the commit that triggered the pipeline. |
committed_at | string | Timestamp of the pipeline's commit. |
complete | boolean | Indicates if a pipeline is complete. |
compute_minutes | number | Total minutes consumed by the pipeline. |
config_source | string | Configuration 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) |
coverage | number | Coverage percentage. |
created_at | string | Timestamp of the pipeline's creation. |
duration | integer | Duration of the pipeline in seconds. |
failed_jobs_count | integer | Number of failed jobs in the pipeline, including trigger jobs and external jobs. |
failure_reason | string | Reason why the pipeline failed. |
finished_at | string | Timestamp of the pipeline's completion. |
has_manual_actions | boolean | Indicates if the pipeline has manual actions. |
has_scheduled_actions | boolean | Indicates if the pipeline has scheduled actions. |
iid | string | Internal ID of the pipeline. |
latest | boolean | If the pipeline is the latest one or not. |
merge_request_event_type | string | Event type of the pipeline associated with a merge request. (MERGED_RESULT, DETACHED, MERGE_TRAIN) |
path | string | Relative path to the pipeline's page. |
project | object | Project identity (id, full_path, name) |
queued_duration | string | How long the pipeline was queued before starting. |
ref | string | Reference to the branch from which the pipeline was triggered. |
ref_path | string | Reference path to the branch from which the pipeline was triggered. |
ref_text | string | Reference text from the presenter. |
retryable | boolean | Specifies if a pipeline's jobs can be retried. |
sha | string | SHA of the pipeline's commit. |
source | string | Source of the pipeline. |
started_at | string | Timestamp when the pipeline was started. |
status | string | Status 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) |
stuck | boolean | If the pipeline is stuck. |
total_jobs | integer | Total number of jobs in the pipeline. |
trigger | boolean | If the pipeline was created by a Trigger request. |
triggered_by_path | string | Path that triggered the pipeline. |
troubleshoot_job_with_ai | boolean | If the user can troubleshoot jobs of a pipeline. |
type | string | Type of the pipeline. |
updated_at | string | Timestamp of the pipeline's last activity. |
user | object | UserCore identity (id, username, name) |
uses_needs | boolean | Indicates if the pipeline has jobs with needs dependencies. |
warnings | boolean | Indicates if a pipeline has warnings. |
yaml_error_messages | string | Pipeline YAML errors. |
yaml_errors | boolean | If the pipeline has YAML errors. |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | full_path, host | id, iid, sha | 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). |
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.
| Name | Datatype | Description |
|---|---|---|
full_path | string | Full path of the project, for example gitlab-org/gitlab |
host | string | GitLab 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) |
id | string | Global ID of the Pipeline. For example, "gid:​//gitlab/Ci::Pipeline/314". |
iid | string | IID of the Pipeline. For example, "1". |
sha | string | SHA of the Pipeline. For example, "dyd0f15ay83993f5ab66k927w28673882x99100b". |
SELECT examples​
- get
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 }}'
;