summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/graphql/types/ci/detailed_status_type.rb26
-rw-r--r--app/graphql/types/ci/pipeline_type.rb43
2 files changed, 42 insertions, 27 deletions
diff --git a/app/graphql/types/ci/detailed_status_type.rb b/app/graphql/types/ci/detailed_status_type.rb
index d2847641d91..90b5283fc9a 100644
--- a/app/graphql/types/ci/detailed_status_type.rb
+++ b/app/graphql/types/ci/detailed_status_type.rb
@@ -6,14 +6,24 @@ module Types
class DetailedStatusType < BaseObject
graphql_name 'DetailedStatus'
- field :group, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
- field :icon, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
- field :favicon, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
- field :details_path, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
- field :has_details, GraphQL::BOOLEAN_TYPE, null: false, method: :has_details? # rubocop:disable Graphql/Descriptions
- field :label, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
- field :text, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
- field :tooltip, GraphQL::STRING_TYPE, null: false, method: :status_tooltip # rubocop:disable Graphql/Descriptions
+ field :group, GraphQL::STRING_TYPE, null: false,
+ description: 'Group of the pipeline status'
+ field :icon, GraphQL::STRING_TYPE, null: false,
+ description: 'Icon of the pipeline status'
+ field :favicon, GraphQL::STRING_TYPE, null: false,
+ description: 'Favicon of the pipeline status'
+ field :details_path, GraphQL::STRING_TYPE, null: false,
+ description: 'Path of the details for the pipeline status'
+ field :has_details, GraphQL::BOOLEAN_TYPE, null: false,
+ description: 'Indicates if the pipeline status has further details',
+ method: :has_details?
+ field :label, GraphQL::STRING_TYPE, null: false,
+ description: 'Label of the pipeline status'
+ field :text, GraphQL::STRING_TYPE, null: false,
+ description: 'Text of the pipeline status'
+ field :tooltip, GraphQL::STRING_TYPE, null: false,
+ description: 'Tooltip associated with the pipeline status',
+ method: :status_tooltip
end
# rubocop: enable Graphql/AuthorizeTypes
end
diff --git a/app/graphql/types/ci/pipeline_type.rb b/app/graphql/types/ci/pipeline_type.rb
index dfcfd6211bc..e786add6359 100644
--- a/app/graphql/types/ci/pipeline_type.rb
+++ b/app/graphql/types/ci/pipeline_type.rb
@@ -9,29 +9,34 @@ module Types
expose_permissions Types::PermissionTypes::Ci::Pipeline
- field :id, GraphQL::ID_TYPE, null: false # rubocop:disable Graphql/Descriptions
- field :iid, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
+ field :id, GraphQL::ID_TYPE, null: false,
+ description: 'ID of the pipeline'
+ field :iid, GraphQL::STRING_TYPE, null: false,
+ description: 'Internal ID of the pipeline'
- field :sha, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
- field :before_sha, GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
- field :status, PipelineStatusEnum, null: false # rubocop:disable Graphql/Descriptions
- field :detailed_status, # rubocop:disable Graphql/Descriptions
- Types::Ci::DetailedStatusType,
- null: false,
+ field :sha, GraphQL::STRING_TYPE, null: false,
+ description: "SHA of the pipeline's commit"
+ field :before_sha, GraphQL::STRING_TYPE, null: true,
+ description: "Base SHA of the source branch"
+ field :status, PipelineStatusEnum, null: false,
+ description: "Status of the pipeline (#{::Ci::Pipeline.all_state_names.compact.join(', ').upcase})"
+ 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 :duration,
- GraphQL::INT_TYPE,
- null: true,
+ field :duration, GraphQL::INT_TYPE, null: true,
description: "Duration of the pipeline in seconds"
- field :coverage,
- GraphQL::FLOAT_TYPE,
- null: true,
+ field :coverage, GraphQL::FLOAT_TYPE, null: true,
description: "Coverage percentage"
- field :created_at, Types::TimeType, null: false # rubocop:disable Graphql/Descriptions
- field :updated_at, Types::TimeType, null: false # rubocop:disable Graphql/Descriptions
- field :started_at, Types::TimeType, null: true # rubocop:disable Graphql/Descriptions
- field :finished_at, Types::TimeType, null: true # rubocop:disable Graphql/Descriptions
- field :committed_at, Types::TimeType, null: true # rubocop:disable Graphql/Descriptions
+ field :created_at, Types::TimeType, null: false,
+ description: "Timestamp of the pipeline's creation"
+ field :updated_at, Types::TimeType, null: false,
+ description: "Timestamp of the pipeline's last activity"
+ field :started_at, Types::TimeType, null: true,
+ description: 'Timestamp when the pipeline was started'
+ field :finished_at, Types::TimeType, null: true,
+ 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
end