Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pkg/scm/gitlab/context_valuers.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,8 @@ func (d MergeStatus) AsString() string {
func (d DetailedMergeStatus) AsString() string {
return d.String()
}

// PipelineStatusEnum is a ENUM type
func (d PipelineStatusEnum) AsString() string {
return d.String()
}
58 changes: 58 additions & 0 deletions schema/gitlab.schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,22 @@ enum DetailedMergeStatus {
REQUESTED_CHANGES
}

enum PipelineStatusEnum {
CANCELED
CANCELING
CREATED
FAILED
MANUAL
PENDING
PREPARING
RUNNING
SCHEDULED
SKIPPED
SUCCESS
WAITING_FOR_CALLBACK
WAITING_FOR_RESOURCE
}

input ListMergeRequestsQueryInput {
project_id: ID!
state: MergeRequestState! = "opened"
Expand Down Expand Up @@ -337,6 +353,8 @@ type ContextMergeRequest {
DiffStats: [ContextDiffStat!]
"Labels available on this merge request"
Labels: [ContextLabel!] @generated
"Pipeline running on the branch HEAD of the merge request"
HeadPipeline: ContextPipeline

#
# scm-engine customs
Expand Down Expand Up @@ -466,3 +484,43 @@ type ContextDiffStat {
"File path, relative to repository root"
Path: String!
}

# https://docs.gitlab.com/ee/api/graphql/reference/#pipeline
type ContextPipeline {
"Indicates if the pipeline is active"
Active: Boolean!
"Specifies if a pipeline can be canceled"
Cancelable: Boolean!
"Indicates if a pipeline is complete"
Complete: Boolean!
"Duration of the pipeline in seconds"
Duration: Int
"The reason why the pipeline failed"
FailureReason: String
"Timestamp of the pipeline's completion"
FinishedAt: Time
"ID of the pipeline"
ID: String!
"Internal ID of the pipeline"
IID: String!
"If the pipeline is the latest one or not"
Latest: Boolean!
"Name of the pipeline"
Name: String
"Relative path to the pipeline's page"
Path: String
"Specifies if a pipeline can be retried"
Retryable: Boolean!
"Timestamp when the pipeline was started"
StartedAt: Time
"Status of the pipeline"
Status: PipelineStatusEnum!
"If the pipeline is stuck"
Stuck: Boolean!
"The total number of jobs in the pipeline"
TotalJobs: Int!
"Timestamp of the pipeline's last activity"
UpdatedAt: Time!
"Indicates if a pipeline has warnings"
Warnings: Boolean!
}
Loading