Commit 688082f0 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'issue_346033_1/10' into 'master'

Fix GraphQL/OrderedFields offenses

See merge request gitlab-org/gitlab!81481
parents eb95fe01 1c211096
---
GraphQL/OrderedFields:
Exclude:
- app/graphql/types/board_list_type.rb
- app/graphql/types/ci/analytics_type.rb
- app/graphql/types/ci/ci_cd_setting_type.rb
- app/graphql/types/ci/config/group_type.rb
- app/graphql/types/ci/config/job_type.rb
- app/graphql/types/ci/config/stage_type.rb
- app/graphql/types/ci/detailed_status_type.rb
- app/graphql/types/ci/group_type.rb
- app/graphql/types/ci/job_type.rb
- app/graphql/types/ci/runner_architecture_type.rb
- app/graphql/types/ci/runner_platform_type.rb
- app/graphql/types/ci/runner_type.rb
- app/graphql/types/ci/stage_type.rb
......
......@@ -14,18 +14,18 @@ module Types
null: false,
description: 'ID (global ID) of the list.'
field :title, GraphQL::Types::String, null: false,
description: 'Title of the list.'
field :list_type, GraphQL::Types::String, null: false,
description: 'Type of the list.'
field :position, GraphQL::Types::Int, null: true,
description: 'Position of list within the board.'
field :label, Types::LabelType, null: true,
description: 'Label of the list.'
field :collapsed, GraphQL::Types::Boolean, null: true,
description: 'Indicates if the list is collapsed for this user.'
field :issues_count, GraphQL::Types::Int, null: true,
description: 'Count of issues in the list.'
field :label, Types::LabelType, null: true,
description: 'Label of the list.'
field :list_type, GraphQL::Types::String, null: false,
description: 'Type of the list.'
field :position, GraphQL::Types::Int, null: true,
description: 'Position of list within the board.'
field :title, GraphQL::Types::String, null: false,
description: 'Title of the list.'
field :issues, ::Types::IssueType.connection_type, null: true,
description: 'Board issues.',
......
......@@ -6,28 +6,28 @@ module Types
class AnalyticsType < BaseObject
graphql_name 'PipelineAnalytics'
field :week_pipelines_totals, [GraphQL::Types::Int], null: true,
description: 'Total weekly pipeline count.'
field :week_pipelines_successful, [GraphQL::Types::Int], null: true,
description: 'Total weekly successful pipeline count.'
field :week_pipelines_labels, [GraphQL::Types::String], null: true,
description: 'Labels for the weekly pipeline count.'
field :month_pipelines_totals, [GraphQL::Types::Int], null: true,
description: 'Total monthly pipeline count.'
field :month_pipelines_successful, [GraphQL::Types::Int], null: true,
description: 'Total monthly successful pipeline count.'
field :month_pipelines_labels, [GraphQL::Types::String], null: true,
description: 'Labels for the monthly pipeline count.'
field :year_pipelines_totals, [GraphQL::Types::Int], null: true,
description: 'Total yearly pipeline count.'
field :year_pipelines_successful, [GraphQL::Types::Int], null: true,
description: 'Total yearly successful pipeline count.'
field :year_pipelines_labels, [GraphQL::Types::String], null: true,
description: 'Labels for the yearly pipeline count.'
field :pipeline_times_values, [GraphQL::Types::Int], null: true,
description: 'Pipeline times.'
field :month_pipelines_successful, [GraphQL::Types::Int], null: true,
description: 'Total monthly successful pipeline count.'
field :month_pipelines_totals, [GraphQL::Types::Int], null: true,
description: 'Total monthly pipeline count.'
field :pipeline_times_labels, [GraphQL::Types::String], null: true,
description: 'Pipeline times labels.'
field :pipeline_times_values, [GraphQL::Types::Int], null: true,
description: 'Pipeline times.'
field :week_pipelines_labels, [GraphQL::Types::String], null: true,
description: 'Labels for the weekly pipeline count.'
field :week_pipelines_successful, [GraphQL::Types::Int], null: true,
description: 'Total weekly successful pipeline count.'
field :week_pipelines_totals, [GraphQL::Types::Int], null: true,
description: 'Total weekly pipeline count.'
field :year_pipelines_labels, [GraphQL::Types::String], null: true,
description: 'Labels for the yearly pipeline count.'
field :year_pipelines_successful, [GraphQL::Types::Int], null: true,
description: 'Total yearly successful pipeline count.'
field :year_pipelines_totals, [GraphQL::Types::Int], null: true,
description: 'Total yearly pipeline count.'
end
end
end
......@@ -7,18 +7,18 @@ module Types
authorize :admin_project
field :job_token_scope_enabled, GraphQL::Types::Boolean, null: true,
description: 'Indicates CI job tokens generated in this project have restricted access to resources.',
method: :job_token_scope_enabled?
field :keep_latest_artifact, GraphQL::Types::Boolean, null: true,
description: 'Whether to keep the latest builds artifacts.',
method: :keep_latest_artifacts_available?
field :merge_pipelines_enabled, GraphQL::Types::Boolean, null: true,
description: 'Whether merge pipelines are enabled.',
method: :merge_pipelines_enabled?
field :merge_trains_enabled, GraphQL::Types::Boolean, null: true,
description: 'Whether merge trains are enabled.',
method: :merge_trains_enabled?
field :keep_latest_artifact, GraphQL::Types::Boolean, null: true,
description: 'Whether to keep the latest builds artifacts.',
method: :keep_latest_artifacts_available?
field :job_token_scope_enabled, GraphQL::Types::Boolean, null: true,
description: 'Indicates CI job tokens generated in this project have restricted access to resources.',
method: :job_token_scope_enabled?
field :project, Types::ProjectType, null: true,
description: 'Project the CI/CD settings belong to.'
end
......
......@@ -7,10 +7,10 @@ module Types
class GroupType < BaseObject
graphql_name 'CiConfigGroup'
field :name, GraphQL::Types::String, null: true,
description: 'Name of the job group.'
field :jobs, Types::Ci::Config::JobType.connection_type, null: true,
description: 'Jobs in group.'
field :name, GraphQL::Types::String, null: true,
description: 'Name of the job group.'
field :size, GraphQL::Types::Int, null: true,
description: 'Size of the job group.'
end
......
......@@ -7,33 +7,33 @@ module Types
class JobType < BaseObject
graphql_name 'CiConfigJob'
field :name, GraphQL::Types::String, null: true,
description: 'Name of the job.'
field :group_name, GraphQL::Types::String, null: true,
description: 'Name of the job group.'
field :stage, GraphQL::Types::String, null: true,
description: 'Name of the job stage.'
field :needs, Types::Ci::Config::NeedType.connection_type, null: true,
description: 'Builds that must complete before the jobs run.'
field :after_script, [GraphQL::Types::String], null: true,
description: 'Override a set of commands that are executed after the job.'
field :allow_failure, GraphQL::Types::Boolean, null: true,
description: 'Allow job to fail.'
field :before_script, [GraphQL::Types::String], null: true,
description: 'Override a set of commands that are executed before the job.'
field :script, [GraphQL::Types::String], null: true,
description: 'Shell script that is executed by a runner.'
field :after_script, [GraphQL::Types::String], null: true,
description: 'Override a set of commands that are executed after the job.'
field :when, GraphQL::Types::String, null: true,
description: 'When to run the job.',
resolver_method: :restrict_when_to_run_jobs
field :environment, GraphQL::Types::String, null: true,
description: 'Name of an environment to which the job deploys.'
field :except, Types::Ci::Config::JobRestrictionType, null: true,
description: 'Limit when jobs are not created.'
field :group_name, GraphQL::Types::String, null: true,
description: 'Name of the job group.'
field :name, GraphQL::Types::String, null: true,
description: 'Name of the job.'
field :needs, Types::Ci::Config::NeedType.connection_type, null: true,
description: 'Builds that must complete before the jobs run.'
field :only, Types::Ci::Config::JobRestrictionType, null: true,
description: 'Jobs are created when these conditions do not apply.'
field :script, [GraphQL::Types::String], null: true,
description: 'Shell script that is executed by a runner.'
field :stage, GraphQL::Types::String, null: true,
description: 'Name of the job stage.'
field :tags, [GraphQL::Types::String], null: true,
description: 'List of tags that are used to select a runner.'
field :when, GraphQL::Types::String, null: true,
description: 'When to run the job.',
resolver_method: :restrict_when_to_run_jobs
def restrict_when_to_run_jobs
object[:when]
......
......@@ -7,10 +7,10 @@ module Types
class StageType < BaseObject
graphql_name 'CiConfigStage'
field :name, GraphQL::Types::String, null: true,
description: 'Name of the stage.'
field :groups, Types::Ci::Config::GroupType.connection_type, null: true,
description: 'Groups of jobs for the stage.'
field :name, GraphQL::Types::String, null: true,
description: 'Name of the stage.'
end
end
end
......
......@@ -6,20 +6,23 @@ module Types
class DetailedStatusType < BaseObject
graphql_name 'DetailedStatus'
field :id, GraphQL::Types::String, null: false,
description: 'ID for a detailed status.',
extras: [:parent]
field :group, GraphQL::Types::String, null: true,
description: 'Group of the status.'
field :icon, GraphQL::Types::String, null: true,
description: 'Icon of the status.'
field :favicon, GraphQL::Types::String, null: true,
description: 'Favicon of the status.'
field :action, Types::Ci::StatusActionType, null: true,
calls_gitaly: true,
description: 'Action information for the status. This includes method, button title, icon, path, and title.'
field :details_path, GraphQL::Types::String, null: true,
description: 'Path of the details for the status.'
field :favicon, GraphQL::Types::String, null: true,
description: 'Favicon of the status.'
field :group, GraphQL::Types::String, null: true,
description: 'Group of the status.'
field :has_details, GraphQL::Types::Boolean, null: true,
description: 'Indicates if the status has further details.',
method: :has_details?
field :icon, GraphQL::Types::String, null: true,
description: 'Icon of the status.'
field :id, GraphQL::Types::String, null: false,
description: 'ID for a detailed status.',
extras: [:parent]
field :label, GraphQL::Types::String, null: true,
calls_gitaly: true,
description: 'Label of the status.'
......@@ -28,9 +31,6 @@ module Types
field :tooltip, GraphQL::Types::String, null: true,
description: 'Tooltip associated with the status.',
method: :status_tooltip
field :action, Types::Ci::StatusActionType, null: true,
calls_gitaly: true,
description: 'Action information for the status. This includes method, button title, icon, path, and title.'
def id(parent:)
"#{object.id}-#{parent.object.object.id}"
......
......@@ -6,16 +6,16 @@ module Types
class GroupType < BaseObject
graphql_name 'CiGroup'
field :detailed_status, Types::Ci::DetailedStatusType, null: true,
description: 'Detailed status of the group.'
field :id, GraphQL::Types::String, null: false,
description: 'ID for a group.'
field :jobs, Ci::JobType.connection_type, null: true,
description: 'Jobs in group.'
field :name, GraphQL::Types::String, null: true,
description: 'Name of the job group.'
field :size, GraphQL::Types::Int, null: true,
description: 'Size of the group.'
field :jobs, Ci::JobType.connection_type, null: true,
description: 'Jobs in group.'
field :detailed_status, Types::Ci::DetailedStatusType, null: true,
description: 'Detailed status of the group.'
def detailed_status
object.detailed_status(context[:current_user])
......
......@@ -11,38 +11,38 @@ module Types
expose_permissions Types::PermissionTypes::Ci::Job
field :allow_failure, ::GraphQL::Types::Boolean, null: false,
description: 'Whether the job is allowed to fail.'
field :duration, GraphQL::Types::Int, null: true,
description: 'Duration of the job in seconds.'
field :id, ::Types::GlobalIDType[::CommitStatus].as('JobID'), null: true,
description: 'ID of the job.'
field :pipeline, Types::Ci::PipelineType, null: true,
description: 'Pipeline the job belongs to.'
field :name, GraphQL::Types::String, null: true,
description: 'Name of the job.'
field :needs, BuildNeedType.connection_type, null: true,
description: 'References to builds that must complete before the jobs run.'
field :pipeline, Types::Ci::PipelineType, null: true,
description: 'Pipeline the job belongs to.'
field :stage, Types::Ci::StageType, null: true,
description: 'Stage of the job.'
field :status,
type: ::Types::Ci::JobStatusEnum,
null: true,
description: "Status of the job."
field :stage, Types::Ci::StageType, null: true,
description: 'Stage of the job.'
field :allow_failure, ::GraphQL::Types::Boolean, null: false,
description: 'Whether the job is allowed to fail.'
field :duration, GraphQL::Types::Int, null: true,
description: 'Duration of the job in seconds.'
field :tags, [GraphQL::Types::String], null: true,
description: 'Tags for the current job.'
# Life-cycle timestamps:
field :created_at, Types::TimeType, null: false,
description: "When the job was created."
field :queued_at, Types::TimeType, null: true,
description: 'When the job was enqueued and marked as pending.'
field :started_at, Types::TimeType, null: true,
description: 'When the job was started.'
field :finished_at, Types::TimeType, null: true,
description: 'When a job has finished running.'
field :queued_at, Types::TimeType, null: true,
description: 'When the job was enqueued and marked as pending.'
field :scheduled_at, Types::TimeType, null: true,
description: 'Schedule for the build.'
field :started_at, Types::TimeType, null: true,
description: 'When the job was started.'
# Life-cycle durations:
field :queued_duration,
......@@ -50,40 +50,40 @@ module Types
null: true,
description: 'How long the job was enqueued before starting.'
field :downstream_pipeline, Types::Ci::PipelineType, null: true,
description: 'Downstream pipeline for a bridge.'
field :previous_stage_jobs_or_needs, Types::Ci::JobNeedUnion.connection_type, null: true,
description: 'Jobs that must complete before the job runs. Returns `BuildNeed`, which is the needed jobs if the job uses the `needs` keyword, or the previous stage jobs otherwise.'
field :detailed_status, Types::Ci::DetailedStatusType, null: true,
description: 'Detailed status of the job.'
field :active, GraphQL::Types::Boolean, null: false, method: :active?,
description: 'Indicates the job is active.'
field :artifacts, Types::Ci::JobArtifactType.connection_type, null: true,
description: 'Artifacts generated by the job.'
field :short_sha, type: GraphQL::Types::String, null: false,
description: 'Short SHA1 ID of the commit.'
field :scheduling_type, GraphQL::Types::String, null: true,
description: 'Type of job scheduling. Value is `dag` if the job uses the `needs` keyword, and `stage` otherwise.'
field :cancelable, GraphQL::Types::Boolean, null: false, method: :cancelable?,
description: 'Indicates the job can be canceled.'
field :commit_path, GraphQL::Types::String, null: true,
description: 'Path to the commit that triggered the job.'
field :coverage, GraphQL::Types::Float, null: true,
description: 'Coverage level of the job.'
field :created_by_tag, GraphQL::Types::Boolean, null: false,
description: 'Whether the job was created by a tag.'
field :detailed_status, Types::Ci::DetailedStatusType, null: true,
description: 'Detailed status of the job.'
field :downstream_pipeline, Types::Ci::PipelineType, null: true,
description: 'Downstream pipeline for a bridge.'
field :manual_job, GraphQL::Types::Boolean, null: true,
description: 'Whether the job has a manual action.'
field :playable, GraphQL::Types::Boolean, null: false, method: :playable?,
description: 'Indicates the job can be played.'
field :previous_stage_jobs_or_needs, Types::Ci::JobNeedUnion.connection_type, null: true,
description: 'Jobs that must complete before the job runs. Returns `BuildNeed`, which is the needed jobs if the job uses the `needs` keyword, or the previous stage jobs otherwise.'
field :ref_name, GraphQL::Types::String, null: true,
description: 'Ref name of the job.'
field :ref_path, GraphQL::Types::String, null: true,
description: 'Path to the ref.'
field :playable, GraphQL::Types::Boolean, null: false, method: :playable?,
description: 'Indicates the job can be played.'
field :retryable, GraphQL::Types::Boolean, null: false, method: :retryable?,
description: 'Indicates the job can be retried.'
field :cancelable, GraphQL::Types::Boolean, null: false, method: :cancelable?,
description: 'Indicates the job can be canceled.'
field :active, GraphQL::Types::Boolean, null: false, method: :active?,
description: 'Indicates the job is active.'
field :scheduling_type, GraphQL::Types::String, null: true,
description: 'Type of job scheduling. Value is `dag` if the job uses the `needs` keyword, and `stage` otherwise.'
field :short_sha, type: GraphQL::Types::String, null: false,
description: 'Short SHA1 ID of the commit.'
field :stuck, GraphQL::Types::Boolean, null: false, method: :stuck?,
description: 'Indicates the job is stuck.'
field :coverage, GraphQL::Types::Float, null: true,
description: 'Coverage level of the job.'
field :created_by_tag, GraphQL::Types::Boolean, null: false,
description: 'Whether the job was created by a tag.'
field :manual_job, GraphQL::Types::Boolean, null: true,
description: 'Whether the job has a manual action.'
field :triggered, GraphQL::Types::Boolean, null: true,
description: 'Whether the job was triggered.'
......
......@@ -6,10 +6,10 @@ module Types
class RunnerArchitectureType < BaseObject
graphql_name 'RunnerArchitecture'
field :name, GraphQL::Types::String, null: false,
description: 'Name of the runner platform architecture.'
field :download_location, GraphQL::Types::String, null: false,
description: 'Download location for the runner for the platform architecture.'
field :name, GraphQL::Types::String, null: false,
description: 'Name of the runner platform architecture.'
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment