Commit 5abe2353 authored by Stan Hu's avatar Stan Hu

Merge branch '337596-fix-rubocop-offenses-5' into 'master'

Fix Rubocop Graphql/Description offenses

See merge request gitlab-org/gitlab!68819
parents eb6f3337 c7ed4b47
...@@ -23,30 +23,6 @@ Graphql/Descriptions: ...@@ -23,30 +23,6 @@ Graphql/Descriptions:
- 'ee/app/graphql/types/vulnerability_severity_enum.rb' - 'ee/app/graphql/types/vulnerability_severity_enum.rb'
- 'ee/app/graphql/types/vulnerability_state_enum.rb' - 'ee/app/graphql/types/vulnerability_state_enum.rb'
- 'ee/app/graphql/types/vulnerability_confidence_enum.rb' - 'ee/app/graphql/types/vulnerability_confidence_enum.rb'
- 'app/graphql/types/design_management/design_at_version_type.rb'
- 'app/graphql/types/design_management/design_fields.rb'
- 'app/graphql/types/diff_paths_input_type.rb'
- 'app/graphql/types/environment_type.rb'
- 'app/graphql/types/eventable_type.rb'
- 'app/graphql/types/group_type.rb'
- 'app/graphql/types/merge_request_type.rb'
- 'app/graphql/types/metadata/kas_type.rb'
- 'app/graphql/types/milestone_wildcard_id_enum.rb'
- 'app/graphql/types/namespace_type.rb'
- 'app/graphql/types/notes/note_type.rb'
- 'app/graphql/types/notes/position_type_enum.rb'
- 'app/graphql/types/packages/composer/json_type.rb'
- 'app/graphql/types/packages/package_details_type.rb'
- 'app/graphql/types/packages/package_file_type.rb'
- 'app/graphql/types/packages/package_tag_type.rb'
- 'app/graphql/types/packages/package_type.rb'
- 'app/graphql/types/project_type.rb'
- 'app/graphql/types/prometheus_alert_type.rb'
- 'app/graphql/types/query_type.rb'
- 'app/graphql/types/range_input_type.rb'
- 'app/graphql/types/release_asset_link_shared_input_arguments.rb'
- 'app/graphql/types/release_assets_input_type.rb'
- 'app/graphql/types/release_type.rb'
- 'app/graphql/types/repository/blob_type.rb' - 'app/graphql/types/repository/blob_type.rb'
- 'app/graphql/types/root_storage_statistics_type.rb' - 'app/graphql/types/root_storage_statistics_type.rb'
- 'app/graphql/types/snippet_type.rb' - 'app/graphql/types/snippet_type.rb'
......
...@@ -18,12 +18,12 @@ module Types ...@@ -18,12 +18,12 @@ module Types
field :version, field :version,
Types::DesignManagement::VersionType, Types::DesignManagement::VersionType,
null: false, null: false,
description: 'The version this design-at-versions is pinned to.' description: 'Version this design-at-versions is pinned to.'
field :design, field :design,
Types::DesignManagement::DesignType, Types::DesignManagement::DesignType,
null: false, null: false,
description: 'The underlying design.' description: 'Underlying design.'
def cached_stateful_version(_parent) def cached_stateful_version(_parent)
version version
......
...@@ -7,12 +7,12 @@ module Types ...@@ -7,12 +7,12 @@ module Types
field_class Types::BaseField field_class Types::BaseField
field :id, GraphQL::Types::ID, description: 'The ID of this design.', null: false field :id, GraphQL::Types::ID, description: 'ID of this design.', null: false
field :project, Types::ProjectType, null: false, description: 'The project the design belongs to.' field :project, Types::ProjectType, null: false, description: 'Project the design belongs to.'
field :issue, Types::IssueType, null: false, description: 'The issue the design belongs to.' field :issue, Types::IssueType, null: false, description: 'Issue the design belongs to.'
field :filename, GraphQL::Types::String, null: false, description: 'The filename of the design.' field :filename, GraphQL::Types::String, null: false, description: 'Filename of the design.'
field :full_path, GraphQL::Types::String, null: false, description: 'The full path to the design file.' field :full_path, GraphQL::Types::String, null: false, description: 'Full path to the design file.'
field :image, GraphQL::Types::String, null: false, extras: [:parent], description: 'The URL of the full-sized image.' field :image, GraphQL::Types::String, null: false, extras: [:parent], description: 'URL of the full-sized image.'
field :image_v432x230, GraphQL::Types::String, null: true, extras: [:parent], field :image_v432x230, GraphQL::Types::String, null: true, extras: [:parent],
description: 'The URL of the design resized to fit within the bounds of 432x230. ' \ description: 'The URL of the design resized to fit within the bounds of 432x230. ' \
'This will be `null` if the image has not been generated' 'This will be `null` if the image has not been generated'
...@@ -20,7 +20,7 @@ module Types ...@@ -20,7 +20,7 @@ module Types
null: false, null: false,
calls_gitaly: true, calls_gitaly: true,
extras: [:parent], extras: [:parent],
description: 'The diff refs for this design.' description: 'Diff refs for this design.'
field :event, Types::DesignManagement::DesignVersionEventEnum, field :event, Types::DesignManagement::DesignVersionEventEnum,
null: false, null: false,
extras: [:parent], extras: [:parent],
...@@ -29,7 +29,7 @@ module Types ...@@ -29,7 +29,7 @@ module Types
GraphQL::Types::Int, GraphQL::Types::Int,
null: false, null: false,
method: :user_notes_count, method: :user_notes_count,
description: 'The total count of user-created notes for this design.' description: 'Total count of user-created notes for this design.'
def diff_refs(parent:) def diff_refs(parent:)
version = cached_stateful_version(parent) version = cached_stateful_version(parent)
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
module Types module Types
class DiffPathsInputType < BaseInputObject class DiffPathsInputType < BaseInputObject
argument :old_path, GraphQL::Types::String, required: false, argument :old_path, GraphQL::Types::String, required: false,
description: 'The path of the file on the start sha.' description: 'Path of the file on the start SHA.'
argument :new_path, GraphQL::Types::String, required: false, argument :new_path, GraphQL::Types::String, required: false,
description: 'The path of the file on the head sha.' description: 'Path of the file on the HEAD SHA.'
end end
end end
...@@ -19,7 +19,7 @@ module Types ...@@ -19,7 +19,7 @@ module Types
description: 'State of the environment, for example: available/stopped.' description: 'State of the environment, for example: available/stopped.'
field :path, GraphQL::Types::String, null: false, field :path, GraphQL::Types::String, null: false,
description: 'The path to the environment.' description: 'Path to the environment.'
field :metrics_dashboard, Types::Metrics::DashboardType, null: true, field :metrics_dashboard, Types::Metrics::DashboardType, null: true,
description: 'Metrics dashboard schema for the environment.', description: 'Metrics dashboard schema for the environment.',
...@@ -28,6 +28,6 @@ module Types ...@@ -28,6 +28,6 @@ module Types
field :latest_opened_most_severe_alert, field :latest_opened_most_severe_alert,
Types::AlertManagement::AlertType, Types::AlertManagement::AlertType,
null: true, null: true,
description: 'The most severe open alert for the environment. If multiple alerts have equal severity, the most recent is returned.' description: 'Most severe open alert for the environment. If multiple alerts have equal severity, the most recent is returned.'
end end
end end
...@@ -4,6 +4,6 @@ module Types ...@@ -4,6 +4,6 @@ module Types
module EventableType module EventableType
include Types::BaseInterface include Types::BaseInterface
field :events, Types::EventType.connection_type, null: true, description: 'A list of events associated with the object.' field :events, Types::EventType.connection_type, null: true, description: 'List of events associated with the object.'
end end
end end
...@@ -33,12 +33,12 @@ module Types ...@@ -33,12 +33,12 @@ module Types
type: GraphQL::Types::String, type: GraphQL::Types::String,
null: true, null: true,
method: :project_creation_level_str, method: :project_creation_level_str,
description: 'The permission level required to create projects in the group.' description: 'Permission level required to create projects in the group.'
field :subgroup_creation_level, field :subgroup_creation_level,
type: GraphQL::Types::String, type: GraphQL::Types::String,
null: true, null: true,
method: :subgroup_creation_level_str, method: :subgroup_creation_level_str,
description: 'The permission level required to create subgroups within the group.' description: 'Permission level required to create subgroups within the group.'
field :require_two_factor_authentication, field :require_two_factor_authentication,
type: GraphQL::Types::Boolean, type: GraphQL::Types::Boolean,
...@@ -101,7 +101,7 @@ module Types ...@@ -101,7 +101,7 @@ module Types
field :label, field :label,
Types::LabelType, Types::LabelType,
null: true, null: true,
description: 'A label available on this group.' do description: 'Label available on this group.' do
argument :title, argument :title,
type: GraphQL::Types::String, type: GraphQL::Types::String,
required: true, required: true,
......
...@@ -64,7 +64,7 @@ module Types ...@@ -64,7 +64,7 @@ module Types
description: 'Diff head SHA of the merge request.' description: 'Diff head SHA of the merge request.'
field :diff_stats, [Types::DiffStatsType], null: true, calls_gitaly: true, field :diff_stats, [Types::DiffStatsType], null: true, calls_gitaly: true,
description: 'Details about which files were changed in this merge request.' do description: 'Details about which files were changed in this merge request.' do
argument :path, GraphQL::Types::String, required: false, description: 'A specific file-path.' argument :path, GraphQL::Types::String, required: false, description: 'Specific file path.'
end end
field :diff_stats_summary, Types::DiffStatsSummaryType, null: true, calls_gitaly: true, field :diff_stats_summary, Types::DiffStatsSummaryType, null: true, calls_gitaly: true,
...@@ -129,14 +129,14 @@ module Types ...@@ -129,14 +129,14 @@ module Types
description: 'Number of downvotes for the merge request.' description: 'Number of downvotes for the merge request.'
field :head_pipeline, Types::Ci::PipelineType, null: true, method: :actual_head_pipeline, field :head_pipeline, Types::Ci::PipelineType, null: true, method: :actual_head_pipeline,
description: 'The pipeline running on the branch HEAD of the merge request.' description: 'Pipeline running on the branch HEAD of the merge request.'
field :pipelines, field :pipelines,
null: true, null: true,
description: 'Pipelines for the merge request. Note: for performance reasons, no more than the most recent 500 pipelines will be returned.', description: 'Pipelines for the merge request. Note: for performance reasons, no more than the most recent 500 pipelines will be returned.',
resolver: Resolvers::MergeRequestPipelinesResolver resolver: Resolvers::MergeRequestPipelinesResolver
field :milestone, Types::MilestoneType, null: true, field :milestone, Types::MilestoneType, null: true,
description: 'The milestone of the merge request.' description: 'Milestone of the merge request.'
field :assignees, field :assignees,
type: Types::MergeRequests::AssigneeType.connection_type, type: Types::MergeRequests::AssigneeType.connection_type,
null: true, null: true,
......
...@@ -12,7 +12,7 @@ module Types ...@@ -12,7 +12,7 @@ module Types
field :version, GraphQL::Types::String, null: true, field :version, GraphQL::Types::String, null: true,
description: 'KAS version.' description: 'KAS version.'
field :external_url, GraphQL::Types::String, null: true, field :external_url, GraphQL::Types::String, null: true,
description: 'The URL used by the Agents to communicate with KAS.' description: 'URL used by the Agents to communicate with KAS.'
end end
end end
end end
...@@ -6,7 +6,7 @@ module Types ...@@ -6,7 +6,7 @@ module Types
description 'Milestone ID wildcard values' description 'Milestone ID wildcard values'
value 'NONE', 'No milestone is assigned.' value 'NONE', 'No milestone is assigned.'
value 'ANY', 'A milestone is assigned.' value 'ANY', 'Milestone is assigned.'
value 'STARTED', 'An open, started milestone (start date <= today).' value 'STARTED', 'An open, started milestone (start date <= today).'
value 'UPCOMING', 'An open milestone due in the future (due date >= today).' value 'UPCOMING', 'An open milestone due in the future (due date >= today).'
end end
......
...@@ -40,7 +40,7 @@ module Types ...@@ -40,7 +40,7 @@ module Types
field :package_settings, field :package_settings,
Types::Namespace::PackageSettingsType, Types::Namespace::PackageSettingsType,
null: true, null: true,
description: 'The package settings for the namespace.' description: 'Package settings for the namespace.'
field :shared_runners_setting, field :shared_runners_setting,
Types::Namespace::SharedRunnersSettingEnum, Types::Namespace::SharedRunnersSettingEnum,
......
...@@ -40,9 +40,9 @@ module Types ...@@ -40,9 +40,9 @@ module Types
field :updated_at, Types::TimeType, null: false, field :updated_at, Types::TimeType, null: false,
description: "Timestamp of the note's last activity." description: "Timestamp of the note's last activity."
field :discussion, Types::Notes::DiscussionType, null: true, field :discussion, Types::Notes::DiscussionType, null: true,
description: 'The discussion this note is a part of.' description: 'Discussion this note is a part of.'
field :position, Types::Notes::DiffPositionType, null: true, field :position, Types::Notes::DiffPositionType, null: true,
description: 'The position of this note on a diff.' description: 'Position of this note on a diff.'
field :confidential, GraphQL::Types::Boolean, null: true, field :confidential, GraphQL::Types::Boolean, null: true,
description: 'Indicates if this note is confidential.', description: 'Indicates if this note is confidential.',
method: :confidential? method: :confidential?
......
...@@ -6,7 +6,7 @@ module Types ...@@ -6,7 +6,7 @@ module Types
graphql_name 'DiffPositionType' graphql_name 'DiffPositionType'
description 'Type of file the position refers to' description 'Type of file the position refers to'
value 'text', description: "A text file." value 'text', description: "Text file."
value 'image', description: "An image." value 'image', description: "An image."
end end
end end
......
...@@ -8,10 +8,10 @@ module Types ...@@ -8,10 +8,10 @@ module Types
graphql_name 'PackageComposerJsonType' graphql_name 'PackageComposerJsonType'
description 'Represents a composer JSON file' description 'Represents a composer JSON file'
field :name, GraphQL::Types::String, null: true, description: 'The name set in the Composer JSON file.' field :name, GraphQL::Types::String, null: true, description: 'Name set in the Composer JSON file.'
field :type, GraphQL::Types::String, null: true, description: 'The type set in the Composer JSON file.' field :type, GraphQL::Types::String, null: true, description: 'Type set in the Composer JSON file.'
field :license, GraphQL::Types::String, null: true, description: 'The license set in the Composer JSON file.' field :license, GraphQL::Types::String, null: true, description: 'License set in the Composer JSON file.'
field :version, GraphQL::Types::String, null: true, description: 'The version set in the Composer JSON file.' field :version, GraphQL::Types::String, null: true, description: 'Version set in the Composer JSON file.'
end end
end end
end end
......
...@@ -8,7 +8,7 @@ module Types ...@@ -8,7 +8,7 @@ module Types
authorize :read_package authorize :read_package
field :versions, ::Types::Packages::PackageType.connection_type, null: true, field :versions, ::Types::Packages::PackageType.connection_type, null: true,
description: 'The other versions of the package.' description: 'Other versions of the package.'
field :package_files, Types::Packages::PackageFileType.connection_type, null: true, description: 'Package files.' field :package_files, Types::Packages::PackageFileType.connection_type, null: true, description: 'Package files.'
......
...@@ -8,8 +8,8 @@ module Types ...@@ -8,8 +8,8 @@ module Types
authorize :read_package authorize :read_package
field :id, ::Types::GlobalIDType[::Packages::PackageFile], null: false, description: 'ID of the file.' field :id, ::Types::GlobalIDType[::Packages::PackageFile], null: false, description: 'ID of the file.'
field :created_at, Types::TimeType, null: false, description: 'The created date.' field :created_at, Types::TimeType, null: false, description: 'Created date.'
field :updated_at, Types::TimeType, null: false, description: 'The updated date.' field :updated_at, Types::TimeType, null: false, description: 'Updated date.'
field :size, GraphQL::Types::String, null: false, description: 'Size of the package file.' field :size, GraphQL::Types::String, null: false, description: 'Size of the package file.'
field :file_name, GraphQL::Types::String, null: false, description: 'Name of the package file.' field :file_name, GraphQL::Types::String, null: false, description: 'Name of the package file.'
field :download_path, GraphQL::Types::String, null: false, description: 'Download path of the package file.' field :download_path, GraphQL::Types::String, null: false, description: 'Download path of the package file.'
......
...@@ -7,10 +7,10 @@ module Types ...@@ -7,10 +7,10 @@ module Types
description 'Represents a package tag' description 'Represents a package tag'
authorize :read_package authorize :read_package
field :id, GraphQL::Types::ID, null: false, description: 'The ID of the tag.' field :id, GraphQL::Types::ID, null: false, description: 'ID of the tag.'
field :name, GraphQL::Types::String, null: false, description: 'The name of the tag.' field :name, GraphQL::Types::String, null: false, description: 'Name of the tag.'
field :created_at, Types::TimeType, null: false, description: 'The created date.' field :created_at, Types::TimeType, null: false, description: 'Created date.'
field :updated_at, Types::TimeType, null: false, description: 'The updated date.' field :updated_at, Types::TimeType, null: false, description: 'Updated date.'
end end
end end
end end
...@@ -23,7 +23,7 @@ module Types ...@@ -23,7 +23,7 @@ module Types
field :metadata, Types::Packages::MetadataType, null: true, field :metadata, Types::Packages::MetadataType, null: true,
description: 'Package metadata.' description: 'Package metadata.'
field :versions, ::Types::Packages::PackageType.connection_type, null: true, field :versions, ::Types::Packages::PackageType.connection_type, null: true,
description: 'The other versions of the package.', description: 'Other versions of the package.',
deprecated: { reason: 'This field is now only returned in the PackageDetailsType', milestone: '13.11' } deprecated: { reason: 'This field is now only returned in the PackageDetailsType', milestone: '13.11' }
field :status, Types::Packages::PackageStatusEnum, null: false, description: 'Package status.' field :status, Types::Packages::PackageStatusEnum, null: false, description: 'Package status.'
......
...@@ -118,7 +118,7 @@ module Types ...@@ -118,7 +118,7 @@ module Types
field :autoclose_referenced_issues, GraphQL::Types::Boolean, null: true, field :autoclose_referenced_issues, GraphQL::Types::Boolean, null: true,
description: 'Indicates if issues referenced by merge requests and commits within the default branch are closed automatically.' description: 'Indicates if issues referenced by merge requests and commits within the default branch are closed automatically.'
field :suggestion_commit_message, GraphQL::Types::String, null: true, field :suggestion_commit_message, GraphQL::Types::String, null: true,
description: 'The commit message used to apply merge request suggestions.' description: 'Commit message used to apply merge request suggestions.'
field :squash_read_only, GraphQL::Types::Boolean, null: false, method: :squash_readonly?, field :squash_read_only, GraphQL::Types::Boolean, null: false, method: :squash_readonly?,
description: 'Indicates if `squashReadOnly` is enabled.' description: 'Indicates if `squashReadOnly` is enabled.'
...@@ -310,7 +310,7 @@ module Types ...@@ -310,7 +310,7 @@ module Types
field :container_expiration_policy, field :container_expiration_policy,
Types::ContainerExpirationPolicyType, Types::ContainerExpirationPolicyType,
null: true, null: true,
description: 'The container expiration policy of the project.' description: 'Container expiration policy of the project.'
field :container_repositories, field :container_repositories,
Types::ContainerRepositoryType.connection_type, Types::ContainerRepositoryType.connection_type,
...@@ -324,7 +324,7 @@ module Types ...@@ -324,7 +324,7 @@ module Types
field :label, field :label,
Types::LabelType, Types::LabelType,
null: true, null: true,
description: 'A label available on this project.' do description: 'Label available on this project.' do
argument :title, GraphQL::Types::String, argument :title, GraphQL::Types::String,
required: true, required: true,
description: 'Title of the label.' description: 'Title of the label.'
......
...@@ -15,6 +15,6 @@ module Types ...@@ -15,6 +15,6 @@ module Types
field :humanized_text, field :humanized_text,
GraphQL::Types::String, GraphQL::Types::String,
null: false, null: false,
description: 'The human-readable text of the alert condition.' description: 'Human-readable text of the alert condition.'
end end
end end
...@@ -62,7 +62,7 @@ module Types ...@@ -62,7 +62,7 @@ module Types
argument :id, argument :id,
type: ::Types::GlobalIDType[::ContainerRepository], type: ::Types::GlobalIDType[::ContainerRepository],
required: true, required: true,
description: 'The global ID of the container repository.' description: 'Global ID of the container repository.'
end end
field :package, field :package,
...@@ -84,13 +84,13 @@ module Types ...@@ -84,13 +84,13 @@ module Types
field :issue, Types::IssueType, field :issue, Types::IssueType,
null: true, null: true,
description: 'Find an issue.' do description: 'Find an issue.' do
argument :id, ::Types::GlobalIDType[::Issue], required: true, description: 'The global ID of the issue.' argument :id, ::Types::GlobalIDType[::Issue], required: true, description: 'Global ID of the issue.'
end end
field :merge_request, Types::MergeRequestType, field :merge_request, Types::MergeRequestType,
null: true, null: true,
description: 'Find a merge request.' do description: 'Find a merge request.' do
argument :id, ::Types::GlobalIDType[::MergeRequest], required: true, description: 'The global ID of the merge request.' argument :id, ::Types::GlobalIDType[::MergeRequest], required: true, description: 'Global ID of the merge request.'
end end
field :instance_statistics_measurements, field :instance_statistics_measurements,
......
...@@ -8,11 +8,11 @@ module Types ...@@ -8,11 +8,11 @@ module Types
@subtypes[[type, closed]] ||= Class.new(self) do @subtypes[[type, closed]] ||= Class.new(self) do
argument :start, type, argument :start, type,
required: closed, required: closed,
description: 'The start of the range.' description: 'Start of the range.'
argument :end, type, argument :end, type,
required: closed, required: closed,
description: 'The end of the range.' description: 'End of the range.'
end end
end end
......
...@@ -19,7 +19,7 @@ module Types ...@@ -19,7 +19,7 @@ module Types
argument :link_type, Types::ReleaseAssetLinkTypeEnum, argument :link_type, Types::ReleaseAssetLinkTypeEnum,
required: false, default_value: 'other', required: false, default_value: 'other',
description: 'The type of the asset link.' description: 'Type of the asset link.'
end end
end end
end end
...@@ -7,6 +7,6 @@ module Types ...@@ -7,6 +7,6 @@ module Types
argument :links, [Types::ReleaseAssetLinkInputType], argument :links, [Types::ReleaseAssetLinkInputType],
required: false, required: false,
description: 'A list of asset links to associate to the release.' description: 'List of asset links to associate to the release.'
end end
end end
...@@ -49,7 +49,7 @@ module Types ...@@ -49,7 +49,7 @@ module Types
field :commit, Types::CommitType, null: true, field :commit, Types::CommitType, null: true,
complexity: 10, calls_gitaly: true, complexity: 10, calls_gitaly: true,
description: 'The commit associated with the release.' description: 'Commit associated with the release.'
def commit def commit
return if release.sha.nil? return if release.sha.nil?
......
This diff is collapsed.
...@@ -535,8 +535,8 @@ RSpec.describe Tooling::Graphql::Docs::Renderer do ...@@ -535,8 +535,8 @@ RSpec.describe Tooling::Graphql::Docs::Renderer do
| Name | Type | Description | | Name | Type | Description |
| ---- | ---- | ----------- | | ---- | ---- | ----------- |
| <a id="timeframeend"></a>`end` | [`Date!`](#date) | The end of the range. | | <a id="timeframeend"></a>`end` | [`Date!`](#date) | End of the range. |
| <a id="timeframestart"></a>`start` | [`Date!`](#date) | The start of the range. | | <a id="timeframestart"></a>`start` | [`Date!`](#date) | Start of the range. |
DOC DOC
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