Skip to content
代码片段 群组 项目
提交 131cc74f 编辑于 作者: David Barr's avatar David Barr
浏览文件

graphql: Add merge_request_event_type field to pipeline_type

Expose pipeline.merge_request_event_type to the GraphQL object
pipeline_type. Returns "DETACHED", "MERGED_RESULT", or
"MERGE_TRAIN".

Changelog: added
上级 44644ce3
No related branches found
No related tags found
无相关合并请求
# frozen_string_literal: true
module Types
module Ci
class PipelineMergeRequestEventTypeEnum < BaseEnum
graphql_name 'PipelineMergeRequestEventType'
description 'Event type of the pipeline associated with a merge request'
value 'MERGED_RESULT',
'Pipeline run on the changes from the source branch combined with the target branch.',
value: :merged_result
value 'DETACHED',
'Pipeline run on the changes in the merge request source branch.',
value: :detached
end
end
end
Types::Ci::PipelineMergeRequestEventTypeEnum.prepend_mod
...@@ -175,6 +175,9 @@ class PipelineType < BaseObject ...@@ -175,6 +175,9 @@ class PipelineType < BaseObject
field :warning_messages, [Types::Ci::PipelineMessageType], null: true, field :warning_messages, [Types::Ci::PipelineMessageType], null: true,
description: 'Pipeline warning messages.' description: 'Pipeline warning messages.'
field :merge_request_event_type, Types::Ci::PipelineMergeRequestEventTypeEnum, null: true,
description: "Event type of the pipeline associated with a merge request."
def detailed_status def detailed_status
object.detailed_status(current_user) object.detailed_status(current_user)
end end
......
...@@ -14449,6 +14449,7 @@ Represents a file or directory in the project repository that has been locked. ...@@ -14449,6 +14449,7 @@ Represents a file or directory in the project repository that has been locked.
| <a id="pipelineid"></a>`id` | [`ID!`](#id) | ID of the pipeline. | | <a id="pipelineid"></a>`id` | [`ID!`](#id) | ID of the pipeline. |
| <a id="pipelineiid"></a>`iid` | [`String!`](#string) | Internal ID of the pipeline. | | <a id="pipelineiid"></a>`iid` | [`String!`](#string) | Internal ID of the pipeline. |
| <a id="pipelinejobartifacts"></a>`jobArtifacts` | [`[CiJobArtifact!]`](#cijobartifact) | Job artifacts of the pipeline. | | <a id="pipelinejobartifacts"></a>`jobArtifacts` | [`[CiJobArtifact!]`](#cijobartifact) | Job artifacts of the pipeline. |
| <a id="pipelinemergerequesteventtype"></a>`mergeRequestEventType` | [`PipelineMergeRequestEventType`](#pipelinemergerequesteventtype) | Event type of the pipeline associated with a merge request. |
| <a id="pipelinepath"></a>`path` | [`String`](#string) | Relative path to the pipeline's page. | | <a id="pipelinepath"></a>`path` | [`String`](#string) | Relative path to the pipeline's page. |
| <a id="pipelineproject"></a>`project` | [`Project`](#project) | Project the pipeline belongs to. | | <a id="pipelineproject"></a>`project` | [`Project`](#project) | Project the pipeline belongs to. |
| <a id="pipelinequeuedduration"></a>`queuedDuration` | [`Duration`](#duration) | How long the pipeline was queued before starting. | | <a id="pipelinequeuedduration"></a>`queuedDuration` | [`Duration`](#duration) | How long the pipeline was queued before starting. |
...@@ -19188,6 +19189,16 @@ Values for sorting package. ...@@ -19188,6 +19189,16 @@ Values for sorting package.
| <a id="pipelineconfigsourceenumunknown_source"></a>`UNKNOWN_SOURCE` | Unknown source. | | <a id="pipelineconfigsourceenumunknown_source"></a>`UNKNOWN_SOURCE` | Unknown source. |
| <a id="pipelineconfigsourceenumwebide_source"></a>`WEBIDE_SOURCE` | Webide source. | | <a id="pipelineconfigsourceenumwebide_source"></a>`WEBIDE_SOURCE` | Webide source. |
   
### `PipelineMergeRequestEventType`
Event type of the pipeline associated with a merge request.
| Value | Description |
| ----- | ----------- |
| <a id="pipelinemergerequesteventtypedetached"></a>`DETACHED` | Pipeline run on the changes in the merge request source branch. |
| <a id="pipelinemergerequesteventtypemerged_result"></a>`MERGED_RESULT` | Pipeline run on the changes from the source branch combined with the target branch. |
| <a id="pipelinemergerequesteventtypemerge_train"></a>`MERGE_TRAIN` | Pipeline ran as part of a merge train. |
### `PipelineScopeEnum` ### `PipelineScopeEnum`
   
| Value | Description | | Value | Description |
# frozen_string_literal: true
module EE
module Types
module Ci
module PipelineMergeRequestEventTypeEnum
extend ActiveSupport::Concern
prepended do
value 'MERGE_TRAIN', 'Pipeline ran as part of a merge train.', value: :merge_train
end
end
end
end
end
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe GitlabSchema.types['PipelineMergeRequestEventType'] do
it 'has specific values' do
expect(described_class.values).to match a_hash_including(
'MERGE_TRAIN' => have_attributes(value: :merge_train)
)
end
end
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe GitlabSchema.types['PipelineMergeRequestEventType'] do
specify { expect(described_class.graphql_name).to eq('PipelineMergeRequestEventType') }
it 'has specific values' do
expect(described_class.values).to match a_hash_including(
'MERGED_RESULT' => have_attributes(value: :merged_result),
'DETACHED' => have_attributes(value: :detached)
)
end
end
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
coverage created_at updated_at started_at finished_at committed_at coverage created_at updated_at started_at finished_at committed_at
stages user retryable cancelable jobs source_job job job_artifacts downstream stages user retryable cancelable jobs source_job job job_artifacts downstream
upstream path project active user_permissions warnings commit commit_path uses_needs upstream path project active user_permissions warnings commit commit_path uses_needs
test_report_summary test_suite ref ref_path warning_messages test_report_summary test_suite ref ref_path warning_messages merge_request_event_type
] ]
if Gitlab.ee? if Gitlab.ee?
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册