Commit 3e2a4ca5 authored by Luke Duncalfe's avatar Luke Duncalfe

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

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

See merge request gitlab-org/gitlab!67912
parents d1422c4b 7d512091
......@@ -23,39 +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/commits/create.rb'
- 'app/graphql/mutations/concerns/mutations/assignable.rb'
- 'app/graphql/mutations/concerns/mutations/can_mutate_spammable.rb'
- 'app/graphql/mutations/concerns/mutations/resolves_subscription.rb'
- 'app/graphql/mutations/container_expiration_policies/update.rb'
- 'app/graphql/mutations/container_repositories/destroy.rb'
- 'app/graphql/mutations/custom_emoji/create.rb'
- 'app/graphql/mutations/design_management/base.rb'
- 'app/graphql/mutations/design_management/delete.rb'
- 'app/graphql/mutations/design_management/move.rb'
- 'app/graphql/mutations/design_management/upload.rb'
- 'app/graphql/mutations/discussions/toggle_resolve.rb'
- 'app/graphql/mutations/environments/canary_ingress/update.rb'
- 'app/graphql/mutations/groups/update.rb'
- 'app/graphql/mutations/issues/base.rb'
- 'app/graphql/mutations/issues/create.rb'
- 'app/graphql/mutations/issues/move.rb'
- 'app/graphql/mutations/issues/set_due_date.rb'
- 'app/graphql/mutations/issues/set_subscription.rb'
- 'app/graphql/mutations/issues/update.rb'
- 'app/graphql/mutations/jira_import/import_users.rb'
- 'app/graphql/mutations/jira_import/start.rb'
- 'app/graphql/mutations/labels/create.rb'
- 'app/graphql/mutations/merge_requests/accept.rb'
- 'app/graphql/mutations/merge_requests/base.rb'
- 'app/graphql/mutations/merge_requests/create.rb'
- 'app/graphql/mutations/merge_requests/reviewer_rereview.rb'
- 'app/graphql/mutations/merge_requests/set_labels.rb'
- 'app/graphql/mutations/merge_requests/set_milestone.rb'
- 'app/graphql/mutations/merge_requests/set_subscription.rb'
- 'app/graphql/mutations/merge_requests/update.rb'
- 'app/graphql/mutations/metrics/dashboard/annotations/create.rb'
- 'app/graphql/mutations/namespace/package_settings/update.rb'
- 'app/graphql/mutations/notes/base.rb'
- 'app/graphql/mutations/notes/create/base.rb'
- 'app/graphql/mutations/notes/create/note.rb'
......
......@@ -42,7 +42,7 @@ module Mutations
field :commit,
Types::CommitType,
null: true,
description: 'The commit after mutation.'
description: 'Commit after mutation.'
field :content,
[GraphQL::Types::String],
......
......@@ -8,13 +8,13 @@ module Mutations
argument :assignee_usernames,
[GraphQL::Types::String],
required: true,
description: 'The usernames to assign to the resource. Replaces existing assignees by default.'
description: 'Usernames to assign to the resource. Replaces existing assignees by default.'
argument :operation_mode,
Types::MutationOperationModeEnum,
required: false,
default_value: Types::MutationOperationModeEnum.default_mode,
description: 'The operation to perform. Defaults to REPLACE.'
description: 'Operation to perform. Defaults to REPLACE.'
end
def resolve(project_path:, iid:, assignee_usernames:, operation_mode:)
......
......@@ -16,12 +16,12 @@ module Mutations
argument :captcha_response, GraphQL::Types::String,
required: false,
deprecated: DEPRECATION_NOTICE,
description: 'A valid CAPTCHA response value obtained by using the provided captchaSiteKey with a CAPTCHA API to present a challenge to be solved on the client. Required to resubmit if the previous operation returned "NeedsCaptchaResponse: true".'
description: 'Valid CAPTCHA response value obtained by using the provided captchaSiteKey with a CAPTCHA API to present a challenge to be solved on the client. Required to resubmit if the previous operation returned "NeedsCaptchaResponse: true".'
argument :spam_log_id, GraphQL::Types::Int,
required: false,
deprecated: DEPRECATION_NOTICE,
description: 'The spam log ID which must be passed along with a valid CAPTCHA response for the operation to be completed. Required to resubmit if the previous operation returned "NeedsCaptchaResponse: true".'
description: 'Spam log ID which must be passed along with a valid CAPTCHA response for the operation to be completed. Required to resubmit if the previous operation returned "NeedsCaptchaResponse: true".'
field :spam,
GraphQL::Types::Boolean,
......@@ -39,13 +39,13 @@ module Mutations
GraphQL::Types::Int,
null: true,
deprecated: DEPRECATION_NOTICE,
description: 'The spam log ID which must be passed along with a valid CAPTCHA response for an operation to be completed. Included only when an operation was not completed because "NeedsCaptchaResponse" is true.'
description: 'Spam log ID which must be passed along with a valid CAPTCHA response for an operation to be completed. Included only when an operation was not completed because "NeedsCaptchaResponse" is true.'
field :captcha_site_key,
GraphQL::Types::String,
null: true,
deprecated: DEPRECATION_NOTICE,
description: 'The CAPTCHA site key which must be used to render a challenge for the user to solve to obtain a valid captchaResponse value. Included only when an operation was not completed because "NeedsCaptchaResponse" is true.'
description: 'CAPTCHA site key which must be used to render a challenge for the user to solve to obtain a valid captchaResponse value. Included only when an operation was not completed because "NeedsCaptchaResponse" is true.'
end
end
end
......@@ -8,7 +8,7 @@ module Mutations
argument :subscribed_state,
GraphQL::Types::Boolean,
required: true,
description: 'The desired state of the subscription.'
description: 'Desired state of the subscription.'
end
def resolve(project_path:, iid:, subscribed_state:)
......
......@@ -12,7 +12,7 @@ module Mutations
argument :project_path,
GraphQL::Types::ID,
required: true,
description: 'The project path where the container expiration policy is located.'
description: 'Project path where the container expiration policy is located.'
argument :enabled,
GraphQL::Types::Boolean,
......@@ -47,7 +47,7 @@ module Mutations
field :container_expiration_policy,
Types::ContainerExpirationPolicyType,
null: true,
description: 'The container expiration policy after mutation.'
description: 'Container expiration policy after mutation.'
def resolve(project_path:, **args)
project = authorized_find!(project_path)
......
......@@ -15,7 +15,7 @@ module Mutations
field :container_repository,
Types::ContainerRepositoryType,
null: false,
description: 'The container repository policy after scheduling the deletion.'
description: 'Container repository policy after scheduling the deletion.'
def resolve(id:)
container_repository = authorized_find!(id: id)
......
......@@ -12,7 +12,7 @@ module Mutations
field :custom_emoji,
Types::CustomEmojiType,
null: true,
description: 'The new custom emoji.'
description: 'New custom emoji.'
argument :group_path, GraphQL::Types::ID,
required: true,
......
......@@ -7,11 +7,11 @@ module Mutations
argument :project_path, GraphQL::Types::ID,
required: true,
description: "The project where the issue is to upload designs for."
description: "Project where the issue is to upload designs for."
argument :iid, GraphQL::Types::ID,
required: true,
description: "The IID of the issue to modify designs for."
description: "IID of the issue to modify designs for."
private
......
......@@ -9,14 +9,14 @@ module Mutations
argument :filenames, [GraphQL::Types::String],
required: true,
description: "The filenames of the designs to delete.",
description: "Filenames of the designs to delete.",
prepare: ->(names, _ctx) do
names.presence || (raise Errors::ArgumentError, 'no filenames')
end
field :version, Types::DesignManagement::VersionType,
null: true, # null on error
description: 'The new version in which the designs are deleted.'
description: 'New version in which the designs are deleted.'
authorize :destroy_design
......
......@@ -18,7 +18,7 @@ module Mutations
field :design_collection, Types::DesignManagement::DesignCollectionType,
null: true,
description: "The current state of the collection."
description: "Current state of the collection."
def resolve(**args)
service = ::DesignManagement::MoveDesignsService.new(current_user, parameters(**args))
......
......@@ -7,13 +7,13 @@ module Mutations
argument :files, [ApolloUploadServer::Upload],
required: true,
description: "The files to upload."
description: "Files to upload."
authorize :create_design
field :designs, [Types::DesignManagement::DesignType],
null: false,
description: "The designs that were uploaded by the mutation."
description: "Designs that were uploaded by the mutation."
field :skipped_designs, [Types::DesignManagement::DesignType],
null: false,
......
......@@ -10,7 +10,7 @@ module Mutations
argument :id,
Types::GlobalIDType[Discussion],
required: true,
description: 'The global ID of the discussion.'
description: 'Global ID of the discussion.'
argument :resolve,
GraphQL::Types::Boolean,
......@@ -20,7 +20,7 @@ module Mutations
field :discussion,
Types::Notes::DiscussionType,
null: true,
description: 'The discussion after mutation.'
description: 'Discussion after mutation.'
def resolve(id:, resolve:)
discussion = authorized_find_discussion!(id: id)
......
......@@ -11,12 +11,12 @@ module Mutations
argument :id,
::Types::GlobalIDType[::Environment],
required: true,
description: 'The global ID of the environment to update.'
description: 'Global ID of the environment to update.'
argument :weight,
GraphQL::Types::Int,
required: true,
description: 'The weight of the Canary Ingress.'
description: 'Weight of the Canary Ingress.'
def resolve(id:, **kwargs)
environment = authorized_find!(id: id)
......
......@@ -11,7 +11,7 @@ module Mutations
field :group, Types::GroupType,
null: true,
description: 'The group after update.'
description: 'Group after update.'
argument :full_path, GraphQL::Types::ID,
required: true,
......
......@@ -7,16 +7,16 @@ module Mutations
argument :project_path, GraphQL::Types::ID,
required: true,
description: "The project the issue to mutate is in."
description: "Project the issue to mutate is in."
argument :iid, GraphQL::Types::String,
required: true,
description: "The IID of the issue to mutate."
description: "IID of the issue to mutate."
field :issue,
Types::IssueType,
null: true,
description: "The issue after mutation."
description: "Issue after mutation."
authorize :update_issue
......
......@@ -16,7 +16,7 @@ module Mutations
argument :iid, GraphQL::Types::Int,
required: false,
description: 'The IID (internal ID) of a project issue. Only admins and project owners can modify.'
description: 'IID (internal ID) of a project issue. Only admins and project owners can modify.'
argument :title, GraphQL::Types::String,
required: true,
......@@ -24,7 +24,7 @@ module Mutations
argument :milestone_id, ::Types::GlobalIDType[::Milestone],
required: false,
description: 'The ID of the milestone to assign to the issue. On update milestone will be removed if set to null.'
description: 'ID of the milestone to assign to the issue. On update milestone will be removed if set to null.'
argument :labels, [GraphQL::Types::String],
required: false,
......@@ -32,7 +32,7 @@ module Mutations
argument :label_ids, [::Types::GlobalIDType[::Label]],
required: false,
description: 'The IDs of labels to be added to the issue.'
description: 'IDs of labels to be added to the issue.'
argument :created_at, Types::TimeType,
required: false,
......@@ -40,20 +40,20 @@ module Mutations
argument :merge_request_to_resolve_discussions_of, ::Types::GlobalIDType[::MergeRequest],
required: false,
description: 'The IID of a merge request for which to resolve discussions.'
description: 'IID of a merge request for which to resolve discussions.'
argument :discussion_to_resolve, GraphQL::Types::String,
required: false,
description: 'The ID of a discussion to resolve. Also pass `merge_request_to_resolve_discussions_of`.'
description: 'ID of a discussion to resolve. Also pass `merge_request_to_resolve_discussions_of`.'
argument :assignee_ids, [::Types::GlobalIDType[::User]],
required: false,
description: 'The array of user IDs to assign to the issue.'
description: 'Array of user IDs to assign to the issue.'
field :issue,
Types::IssueType,
null: true,
description: 'The issue after mutation.'
description: 'Issue after mutation.'
def ready?(**args)
if args.slice(*mutually_exclusive_label_args).size > 1
......
......@@ -8,7 +8,7 @@ module Mutations
argument :target_project_path,
GraphQL::Types::ID,
required: true,
description: 'The project to move the issue to.'
description: 'Project to move the issue to.'
def resolve(project_path:, iid:, target_project_path:)
Gitlab::QueryLimiting.disable!('https://gitlab.com/gitlab-org/gitlab/-/issues/20816')
......
......@@ -8,7 +8,7 @@ module Mutations
argument :due_date,
Types::TimeType,
required: :nullable,
description: 'The desired due date for the issue. Due date is removed if null.'
description: 'Desired due date for the issue. Due date is removed if null.'
def resolve(project_path:, iid:, due_date:)
issue = authorized_find!(project_path: project_path, iid: iid)
......
......@@ -10,16 +10,16 @@ module Mutations
argument :project_path, GraphQL::Types::ID,
required: true,
description: "The project the issue to mutate is in."
description: "Project the issue to mutate is in."
argument :iid, GraphQL::Types::String,
required: true,
description: "The IID of the issue to mutate."
description: "IID of the issue to mutate."
field :issue,
Types::IssueType,
null: true,
description: "The issue after mutation."
description: "Issue after mutation."
authorize :update_subscription
......
......@@ -13,19 +13,19 @@ module Mutations
argument :milestone_id, GraphQL::Types::ID, # rubocop: disable Graphql/IDType
required: false,
description: 'The ID of the milestone to assign to the issue. On update milestone will be removed if set to null.'
description: 'ID of the milestone to assign to the issue. On update milestone will be removed if set to null.'
argument :add_label_ids, [GraphQL::Types::ID],
required: false,
description: 'The IDs of labels to be added to the issue.'
description: 'IDs of labels to be added to the issue.'
argument :remove_label_ids, [GraphQL::Types::ID],
required: false,
description: 'The IDs of labels to be removed from the issue.'
description: 'IDs of labels to be removed from the issue.'
argument :label_ids, [GraphQL::Types::ID],
required: false,
description: 'The IDs of labels to be set. Replaces existing issue labels.'
description: 'IDs of labels to be set. Replaces existing issue labels.'
argument :state_event, Types::IssueStateEventEnum,
description: 'Close or reopen an issue.',
......
......@@ -16,10 +16,10 @@ module Mutations
argument :project_path, GraphQL::Types::ID,
required: true,
description: 'The project to import the Jira users into.'
description: 'Project to import the Jira users into.'
argument :start_at, GraphQL::Types::Int,
required: false,
description: 'The index of the record the import should started at, default 0 (50 records returned).'
description: 'Index of the record the import should started at, default 0 (50 records returned).'
def resolve(project_path:, start_at: 0)
project = authorized_find!(project_path)
......
......@@ -12,11 +12,11 @@ module Mutations
field :jira_import,
Types::JiraImportType,
null: true,
description: 'The Jira import data after mutation.'
description: 'Jira import data after mutation.'
argument :project_path, GraphQL::Types::ID,
required: true,
description: 'The project to import the Jira project into.'
description: 'Project to import the Jira project into.'
argument :jira_project_key, GraphQL::Types::String,
required: true,
description: 'Project key of the importer Jira project.'
......@@ -26,7 +26,7 @@ module Mutations
argument :users_mapping,
[Types::JiraUsersMappingInputType],
required: false,
description: 'The mapping of Jira to GitLab users.'
description: 'Mapping of Jira to GitLab users.'
def resolve(project_path:, jira_project_key:, users_mapping:)
project = authorized_find!(project_path)
......
......@@ -10,7 +10,7 @@ module Mutations
field :label,
Types::LabelType,
null: true,
description: 'The label after mutation.'
description: 'Label after mutation.'
argument :title, GraphQL::Types::String,
required: true,
......
......@@ -31,7 +31,7 @@ module Mutations
description: 'Custom squash commit message (if squash is true).'
argument :sha, ::GraphQL::Types::String,
required: true,
description: 'The HEAD SHA at the time when this merge was requested.'
description: 'HEAD SHA at the time when this merge was requested.'
argument :should_remove_source_branch, ::GraphQL::Types::Boolean,
required: false,
......
......@@ -7,16 +7,16 @@ module Mutations
argument :project_path, GraphQL::Types::ID,
required: true,
description: "The project the merge request to mutate is in."
description: "Project the merge request to mutate is in."
argument :iid, GraphQL::Types::String,
required: true,
description: "The IID of the merge request to mutate."
description: "IID of the merge request to mutate."
field :merge_request,
Types::MergeRequestType,
null: true,
description: "The merge request after mutation."
description: "Merge request after mutation."
authorize :update_merge_request
......
......@@ -34,7 +34,7 @@ module Mutations
field :merge_request,
Types::MergeRequestType,
null: true,
description: 'The merge request after mutation.'
description: 'Merge request after mutation.'
authorize :create_merge_request_from
......
......@@ -9,7 +9,7 @@ module Mutations
loads: Types::UserType,
required: true,
description: <<~DESC
The user ID for the user that has been requested for a new review.
User ID for the user that has been requested for a new review.
DESC
def resolve(project_path:, iid:, user:)
......
......@@ -9,7 +9,7 @@ module Mutations
[::Types::GlobalIDType[Label]],
required: true,
description: <<~DESC
The Label IDs to set. Replaces existing labels by default.
Label IDs to set. Replaces existing labels by default.
DESC
argument :operation_mode,
......
......@@ -10,7 +10,7 @@ module Mutations
required: false,
loads: Types::MilestoneType,
description: <<~DESC
The milestone to assign to the merge request.
Milestone to assign to the merge request.
DESC
def resolve(project_path:, iid:, milestone: nil)
......
......@@ -10,16 +10,16 @@ module Mutations
argument :project_path, GraphQL::Types::ID,
required: true,
description: "The project the merge request to mutate is in."
description: "Project the merge request to mutate is in."
argument :iid, GraphQL::Types::String,
required: true,
description: "The IID of the merge request to mutate."
description: "IID of the merge request to mutate."
field :merge_request,
Types::MergeRequestType,
null: true,
description: "The merge request after mutation."
description: "Merge request after mutation."
authorize :update_subscription
......
......@@ -22,7 +22,7 @@ module Mutations
argument :state, ::Types::MergeRequestStateEventEnum,
required: false,
as: :state_event,
description: 'The action to perform to change the state.'
description: 'Action to perform to change the state.'
def resolve(project_path:, iid:, **args)
merge_request = authorized_find!(project_path: project_path, iid: iid)
......
......@@ -15,17 +15,17 @@ module Mutations
field :annotation,
Types::Metrics::Dashboards::AnnotationType,
null: true,
description: 'The created annotation.'
description: 'Created annotation.'
argument :environment_id,
::Types::GlobalIDType[::Environment],
required: false,
description: 'The global ID of the environment to add an annotation to.'
description: 'Global ID of the environment to add an annotation to.'
argument :cluster_id,
::Types::GlobalIDType[::Clusters::Cluster],
required: false,
description: 'The global ID of the cluster to add an annotation to.'
description: 'Global ID of the cluster to add an annotation to.'
argument :starting_at, Types::TimeType,
required: true,
......@@ -38,12 +38,12 @@ module Mutations
argument :dashboard_path,
GraphQL::Types::String,
required: true,
description: 'The path to a file defining the dashboard on which the annotation should be added.'
description: 'Path to a file defining the dashboard on which the annotation should be added.'
argument :description,
GraphQL::Types::String,
required: true,
description: 'The description of the annotation.'
description: 'Description of the annotation.'
AnnotationSource = Struct.new(:object, keyword_init: true) do
def type_keys
......
......@@ -13,7 +13,7 @@ module Mutations
argument :namespace_path,
GraphQL::Types::ID,
required: true,
description: 'The namespace path where the namespace package setting is located.'
description: 'Namespace path where the namespace package setting is located.'
argument :maven_duplicates_allowed,
GraphQL::Types::Boolean,
......@@ -38,7 +38,7 @@ module Mutations
field :package_settings,
Types::Namespace::PackageSettingsType,
null: true,
description: 'The namespace package setting after mutation.'
description: 'Namespace package setting after mutation.'
def resolve(namespace_path:, **args)
namespace = authorized_find!(namespace_path: namespace_path)
......
This diff is collapsed.
......@@ -13,7 +13,7 @@ module EE
prepended do
argument :epic_id, EpicID,
required: false,
description: 'The ID of the parent epic. NULL when removing the association.'
description: 'ID of the parent epic. NULL when removing the association.'
end
override :move_issue
......
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