diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /app/graphql/types/ci/pipeline_type.rb | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'app/graphql/types/ci/pipeline_type.rb')
-rw-r--r-- | app/graphql/types/ci/pipeline_type.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/app/graphql/types/ci/pipeline_type.rb b/app/graphql/types/ci/pipeline_type.rb index 32050766e5b..82a9f8495ce 100644 --- a/app/graphql/types/ci/pipeline_type.rb +++ b/app/graphql/types/ci/pipeline_type.rb @@ -5,6 +5,8 @@ module Types class PipelineType < BaseObject graphql_name 'Pipeline' + connection_type_class(Types::CountableConnectionType) + authorize :read_pipeline expose_permissions Types::PermissionTypes::Ci::Pipeline @@ -23,6 +25,8 @@ module Types field :detailed_status, Types::Ci::DetailedStatusType, null: false, description: 'Detailed status of the pipeline', resolve: -> (obj, _args, ctx) { obj.detailed_status(ctx[:current_user]) } + field :config_source, PipelineConfigSourceEnum, null: true, + description: "Config source of the pipeline (#{::Ci::PipelineEnums.config_sources.keys.join(', ').upcase})" field :duration, GraphQL::INT_TYPE, null: true, description: 'Duration of the pipeline in seconds' field :coverage, GraphQL::FLOAT_TYPE, null: true, @@ -37,8 +41,13 @@ module Types description: "Timestamp of the pipeline's completion" field :committed_at, Types::TimeType, null: true, description: "Timestamp of the pipeline's commit" - - # TODO: Add triggering user as a type + field :stages, Types::Ci::StageType.connection_type, null: true, + description: 'Stages of the pipeline', + extras: [:lookahead], + resolver: Resolvers::Ci::PipelineStagesResolver + field :user, Types::UserType, null: true, + description: 'Pipeline user', + resolve: -> (pipeline, _args, _context) { Gitlab::Graphql::Loaders::BatchModelLoader.new(User, pipeline.user_id).find } end end end |