Commit 18329ea0 authored by Luke Duncalfe's avatar Luke Duncalfe Committed by Stan Hu

Fix Rubocop Graphql/Description offenses [RUN AS-IF-FOSS]

parent 5c6f8923
......@@ -10,7 +10,7 @@
# - guidelines for use found in
# https://docs.gitlab.com/ee/development/contributing/style_guides.html#resolving-rubocop-exceptions.
# WIP See https://gitlab.com/gitlab-org/gitlab/-/issues/322903
# WIP See https://gitlab.com/gitlab-org/gitlab/-/issues/337596
Graphql/Descriptions:
Exclude:
- 'ee/app/graphql/types/iteration_state_enum.rb'
......@@ -23,40 +23,6 @@ Graphql/Descriptions:
- 'ee/app/graphql/types/vulnerability_severity_enum.rb'
- 'ee/app/graphql/types/vulnerability_state_enum.rb'
- 'ee/app/graphql/types/vulnerability_confidence_enum.rb'
- 'app/graphql/mutations/notes/base.rb'
- 'app/graphql/mutations/notes/create/base.rb'
- 'app/graphql/mutations/notes/create/note.rb'
- 'app/graphql/mutations/notes/destroy.rb'
- 'app/graphql/mutations/notes/reposition_image_diff_note.rb'
- 'app/graphql/mutations/notes/update/base.rb'
- 'app/graphql/mutations/notes/update/note.rb'
- 'app/graphql/mutations/release_asset_links/create.rb'
- 'app/graphql/mutations/release_asset_links/delete.rb'
- 'app/graphql/mutations/release_asset_links/update.rb'
- 'app/graphql/mutations/releases/create.rb'
- 'app/graphql/mutations/releases/delete.rb'
- 'app/graphql/mutations/releases/update.rb'
- 'app/graphql/mutations/snippets/base.rb'
- 'app/graphql/mutations/snippets/create.rb'
- 'app/graphql/mutations/snippets/destroy.rb'
- 'app/graphql/mutations/snippets/mark_as_spam.rb'
- 'app/graphql/mutations/snippets/update.rb'
- 'app/graphql/mutations/todos/create.rb'
- 'app/graphql/mutations/todos/mark_done.rb'
- 'app/graphql/mutations/todos/restore.rb'
- 'app/graphql/mutations/todos/restore_many.rb'
- 'app/graphql/mutations/user_callouts/create.rb'
- 'app/graphql/resolvers/admin/analytics/usage_trends/measurements_resolver.rb'
- 'app/graphql/resolvers/blobs_resolver.rb'
- 'app/graphql/resolvers/board_resolver.rb'
- 'app/graphql/resolvers/ci/config_resolver.rb'
- 'app/graphql/resolvers/concerns/resolves_snippets.rb'
- 'app/graphql/resolvers/design_management/design_at_version_resolver.rb'
- 'app/graphql/resolvers/design_management/version/design_at_version_resolver.rb'
- 'app/graphql/resolvers/design_management/version_in_collection_resolver.rb'
- 'app/graphql/resolvers/design_management/version_resolver.rb'
- 'app/graphql/resolvers/design_management/versions_resolver.rb'
- 'app/graphql/resolvers/full_path_resolver.rb'
- 'app/graphql/resolvers/labels_resolver.rb'
- 'app/graphql/resolvers/merge_requests_resolver.rb'
- 'app/graphql/resolvers/milestones_resolver.rb'
......
......@@ -6,7 +6,7 @@ module Mutations
field :note,
Types::Notes::NoteType,
null: true,
description: 'The note after mutation.'
description: 'Note after mutation.'
private
......
......@@ -11,7 +11,7 @@ module Mutations
argument :noteable_id,
::Types::GlobalIDType[::Noteable],
required: true,
description: 'The global ID of the resource to add a note to.'
description: 'Global ID of the resource to add a note to.'
argument :body,
GraphQL::Types::String,
......@@ -21,7 +21,7 @@ module Mutations
argument :confidential,
GraphQL::Types::Boolean,
required: false,
description: 'The confidentiality flag of a note. Default is false.'
description: 'Confidentiality flag of a note. Default is false.'
def resolve(args)
noteable = authorized_find!(id: args[:noteable_id])
......
......@@ -9,7 +9,7 @@ module Mutations
argument :discussion_id,
::Types::GlobalIDType[::Discussion],
required: false,
description: 'The global ID of the discussion this note is in reply to.'
description: 'Global ID of the discussion this note is in reply to.'
private
......
......@@ -10,7 +10,7 @@ module Mutations
argument :id,
::Types::GlobalIDType[::Note],
required: true,
description: 'The global ID of the note to destroy.'
description: 'Global ID of the note to destroy.'
def resolve(id:)
note = authorized_find!(id: id)
......
......@@ -16,7 +16,7 @@ module Mutations
loads: Types::Notes::NoteType,
as: :note,
required: true,
description: 'The global ID of the DiffNote to update.'
description: 'Global ID of the DiffNote to update.'
argument :position,
Types::Notes::UpdateDiffImagePositionInputType,
......
......@@ -17,7 +17,7 @@ module Mutations
argument :id,
::Types::GlobalIDType[::Note],
required: true,
description: 'The global ID of the note to update.'
description: 'Global ID of the note to update.'
def resolve(args)
note = authorized_find!(id: args[:id])
......
......@@ -15,7 +15,7 @@ module Mutations
argument :confidential,
GraphQL::Types::Boolean,
required: false,
description: 'The confidentiality flag of a note. Default is false.'
description: 'Confidentiality flag of a note. Default is false.'
private
......
......@@ -22,7 +22,7 @@ module Mutations
field :link,
Types::ReleaseAssetLinkType,
null: true,
description: 'The asset link after mutation.'
description: 'Asset link after mutation.'
def resolve(project_path:, tag:, **link_attrs)
project = authorized_find!(project_path)
......
......@@ -16,7 +16,7 @@ module Mutations
field :link,
Types::ReleaseAssetLinkType,
null: true,
description: 'The deleted release asset link.'
description: 'Deleted release asset link.'
def resolve(id:)
link = authorized_find!(id)
......
......@@ -27,12 +27,12 @@ module Mutations
argument :link_type, Types::ReleaseAssetLinkTypeEnum,
required: false,
description: 'The type of the asset link.'
description: 'Type of the asset link.'
field :link,
Types::ReleaseAssetLinkType,
null: true,
description: 'The asset link after mutation.'
description: 'Asset link after mutation.'
def ready?(**args)
if args.key?(:link_type) && args[:link_type].nil?
......
......@@ -8,7 +8,7 @@ module Mutations
field :release,
Types::ReleaseType,
null: true,
description: 'The release after mutation.'
description: 'Release after mutation.'
argument :tag_name, GraphQL::Types::String,
required: true, as: :tag,
......@@ -16,7 +16,7 @@ module Mutations
argument :ref, GraphQL::Types::String,
required: false,
description: 'The commit SHA or branch name to use if creating a new tag.'
description: 'Commit SHA or branch name to use if creating a new tag.'
argument :name, GraphQL::Types::String,
required: false,
......@@ -28,11 +28,11 @@ module Mutations
argument :released_at, Types::TimeType,
required: false,
description: 'The date when the release will be/was ready. Defaults to the current time.'
description: 'Date and time for the release. Defaults to the current date and time.'
argument :milestones, [GraphQL::Types::String],
required: false,
description: 'The title of each milestone the release is associated with. GitLab Premium customers can specify group milestones.'
description: 'Title of each milestone the release is associated with. GitLab Premium customers can specify group milestones.'
argument :assets, Types::ReleaseAssetsInputType,
required: false,
......
......@@ -8,7 +8,7 @@ module Mutations
field :release,
Types::ReleaseType,
null: true,
description: 'The deleted release.'
description: 'Deleted release.'
argument :tag_name, GraphQL::Types::String,
required: true, as: :tag,
......
......@@ -8,7 +8,7 @@ module Mutations
field :release,
Types::ReleaseType,
null: true,
description: 'The release after mutation.'
description: 'Release after mutation.'
argument :tag_name, GraphQL::Types::String,
required: true, as: :tag,
......@@ -24,11 +24,11 @@ module Mutations
argument :released_at, Types::TimeType,
required: false,
description: 'The release date.'
description: 'Release date.'
argument :milestones, [GraphQL::Types::String],
required: false,
description: 'The title of each milestone the release is associated with. GitLab Premium customers can specify group milestones.'
description: 'Title of each milestone the release is associated with. GitLab Premium customers can specify group milestones.'
authorize :update_release
......
......@@ -6,7 +6,7 @@ module Mutations
field :snippet,
Types::SnippetType,
null: true,
description: 'The snippet after mutation.'
description: 'Snippet after mutation.'
private
......
......@@ -14,7 +14,7 @@ module Mutations
field :snippet,
Types::SnippetType,
null: true,
description: 'The snippet after mutation.'
description: 'Snippet after mutation.'
argument :title, GraphQL::Types::String,
required: true,
......@@ -25,16 +25,16 @@ module Mutations
description: 'Description of the snippet.'
argument :visibility_level, Types::VisibilityLevelsEnum,
description: 'The visibility level of the snippet.',
description: 'Visibility level of the snippet.',
required: true
argument :project_path, GraphQL::Types::ID,
required: false,
description: 'The project full path the snippet is associated with.'
description: 'Full path of the project the snippet is associated with.'
argument :uploaded_files, [GraphQL::Types::String],
required: false,
description: 'The paths to files uploaded in the snippet description.'
description: 'Paths to files uploaded in the snippet description.'
argument :blob_actions, [Types::Snippets::BlobActionInputType],
description: 'Actions to perform over the snippet repository and blobs.',
......
......@@ -9,7 +9,7 @@ module Mutations
argument :id, ::Types::GlobalIDType[::Snippet],
required: true,
description: 'The global ID of the snippet to destroy.'
description: 'Global ID of the snippet to destroy.'
def resolve(id:)
snippet = authorized_find!(id: id)
......
......@@ -7,7 +7,7 @@ module Mutations
argument :id, ::Types::GlobalIDType[::Snippet],
required: true,
description: 'The global ID of the snippet to update.'
description: 'Global ID of the snippet to update.'
def resolve(id:)
snippet = authorized_find!(id: id)
......
......@@ -11,7 +11,7 @@ module Mutations
argument :id, ::Types::GlobalIDType[::Snippet],
required: true,
description: 'The global ID of the snippet to update.'
description: 'Global ID of the snippet to update.'
argument :title, GraphQL::Types::String,
required: false,
......@@ -22,7 +22,7 @@ module Mutations
description: 'Description of the snippet.'
argument :visibility_level, Types::VisibilityLevelsEnum,
description: 'The visibility level of the snippet.',
description: 'Visibility level of the snippet.',
required: false
argument :blob_actions, [Types::Snippets::BlobActionInputType],
......
......@@ -10,11 +10,11 @@ module Mutations
argument :target_id,
Types::GlobalIDType[Todoable],
required: true,
description: "The global ID of the to-do item's parent. Issues, merge requests, designs and epics are supported."
description: "Global ID of the to-do item's parent. Issues, merge requests, designs, and epics are supported."
field :todo, Types::TodoType,
null: true,
description: 'The to-do item created.'
description: 'To-do item created.'
def resolve(target_id:)
id = ::Types::GlobalIDType[Todoable].coerce_isolated_input(target_id)
......
......@@ -10,11 +10,11 @@ module Mutations
argument :id,
::Types::GlobalIDType[::Todo],
required: true,
description: 'The global ID of the to-do item to mark as done.'
description: 'Global ID of the to-do item to mark as done.'
field :todo, Types::TodoType,
null: false,
description: 'The requested to-do item.'
description: 'Requested to-do item.'
def resolve(id:)
todo = authorized_find!(id: id)
......
......@@ -10,11 +10,11 @@ module Mutations
argument :id,
::Types::GlobalIDType[::Todo],
required: true,
description: 'The global ID of the to-do item to restore.'
description: 'Global ID of the to-do item to restore.'
field :todo, Types::TodoType,
null: false,
description: 'The requested to-do item.'
description: 'Requested to-do item.'
def resolve(id:)
todo = authorized_find!(id: id)
......
......@@ -10,7 +10,7 @@ module Mutations
argument :ids,
[::Types::GlobalIDType[::Todo]],
required: true,
description: 'The global IDs of the to-do items to restore (a maximum of 50 is supported at once).'
description: 'Global IDs of the to-do items to restore (a maximum of 50 is supported at once).'
field :todos, [::Types::TodoType],
null: false,
......
......@@ -8,11 +8,11 @@ module Mutations
argument :feature_name,
GraphQL::Types::String,
required: true,
description: "The feature name you want to dismiss the callout for."
description: "Feature name you want to dismiss the callout for."
field :user_callout, Types::UserCalloutType,
null: false,
description: 'The user callout dismissed.'
description: 'User callout dismissed.'
def resolve(feature_name:)
callout = Users::DismissUserCalloutService.new(
......
......@@ -11,7 +11,7 @@ module Resolvers
argument :identifier, Types::Admin::Analytics::UsageTrends::MeasurementIdentifierEnum,
required: true,
description: 'The type of measurement/statistics to retrieve.'
description: 'Type of measurement or statistics to retrieve.'
argument :recorded_after, Types::TimeType,
required: false,
......
......@@ -16,7 +16,7 @@ module Resolvers
argument :ref, GraphQL::Types::String,
required: false,
default_value: nil,
description: 'The commit ref to get the blobs from. Default value is HEAD.'
description: 'Commit ref to get the blobs from. Default value is HEAD.'
# We fetch blobs from Gitaly efficiently but it still scales O(N) with the
# number of paths being fetched, so apply a scaling limit to that.
......
......@@ -8,7 +8,7 @@ module Resolvers
argument :id, ::Types::GlobalIDType[::Board],
required: true,
description: 'The board\'s ID.'
description: 'ID of the board.'
def resolve(id: nil)
return unless parent
......
......@@ -16,7 +16,7 @@ module Resolvers
argument :project_path, GraphQL::Types::ID,
required: true,
description: 'The project of the CI config.'
description: 'Project of the CI config.'
argument :sha, GraphQL::Types::String,
required: false,
......
......@@ -13,7 +13,7 @@ module ResolvesSnippets
argument :visibility, Types::Snippets::VisibilityScopesEnum,
required: false,
description: 'The visibility of the snippet.'
description: 'Visibility of the snippet.'
end
def resolve(**args)
......
......@@ -11,7 +11,7 @@ module Resolvers
argument :id, ::Types::GlobalIDType[::DesignManagement::DesignAtVersion],
required: true,
description: 'The Global ID of the design at this version.'
description: 'Global ID of the design at this version.'
def resolve(id:)
authorized_find!(id: id)
......
......@@ -19,13 +19,13 @@ module Resolvers
argument :id, DesignAtVersionID,
required: false,
as: :design_at_version_id,
description: 'The ID of the DesignAtVersion.'
description: 'ID of the DesignAtVersion.'
argument :design_id, DesignID,
required: false,
description: 'The ID of a specific design.'
description: 'ID of a specific design.'
argument :filename, GraphQL::Types::String,
required: false,
description: 'The filename of a specific design.'
description: 'Filename of a specific design.'
def self.single
self
......
......@@ -17,11 +17,11 @@ module Resolvers
argument :sha, GraphQL::Types::String,
required: false,
description: "The SHA256 of a specific version."
description: "SHA256 of a specific version."
argument :id, VersionID,
as: :version_id,
required: false,
description: 'The Global ID of the version.'
description: 'Global ID of the version.'
def resolve(version_id: nil, sha: nil)
# TODO: remove this line when the compatibility layer is removed
......
......@@ -11,7 +11,7 @@ module Resolvers
argument :id, ::Types::GlobalIDType[::DesignManagement::Version],
required: true,
description: 'The Global ID of the version.'
description: 'Global ID of the version.'
def resolve(id:)
authorized_find!(id: id)
......
......@@ -14,12 +14,12 @@ module Resolvers
argument :earlier_or_equal_to_sha, GraphQL::Types::String,
as: :sha,
required: false,
description: 'The SHA256 of the most recent acceptable version.'
description: 'SHA256 of the most recent acceptable version.'
argument :earlier_or_equal_to_id, VersionID,
as: :id,
required: false,
description: 'The Global ID of the most recent acceptable version.'
description: 'Global ID of the most recent acceptable version.'
# This resolver has a custom singular resolver
def self.single
......
......@@ -7,7 +7,7 @@ module Resolvers
prepended do
argument :full_path, GraphQL::Types::ID,
required: true,
description: 'The full path of the project, group or namespace, e.g., `gitlab-org/gitlab-foss`.'
description: 'Full path of the project, group, or namespace. For example, `gitlab-org/gitlab-foss`.'
end
def model_by_full_path(model, full_path)
......
This diff is collapsed.
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