Skip to content
Snippets Groups Projects
Commit b63a4745 authored by Luke Duncalfe's avatar Luke Duncalfe
Browse files

Fix Graphql/Descriptions EE types offenses

https://gitlab.com/gitlab-org/gitlab/-/merge_requests/46721 introduced a
new rubocop that enforced periods at the end of GraphQL description
strings. Existing offenses were added to `.rubocop_manual_todo.yml`.

This change fixes roughly half of the offenses in `ee/app/graphql/types`
and removes the exclusion of them from `.rubocop_manual_todo.yml`.

The changes were generated using the following autocorrect:

    bundle exec rubocop ee/app/graphql \
      --auto-correct \
      --only Graphql/Descriptions

https://gitlab.com/gitlab-org/gitlab/-/issues/292426
parent 1a943a4d
No related branches found
No related tags found
No related merge requests found
Showing
with 584 additions and 625 deletions
Loading
Loading
@@ -691,47 +691,6 @@ RSpec/TimecopTravel:
- 'spec/workers/concerns/reenqueuer_spec.rb'
- 'spec/lib/gitlab/analytics/cycle_analytics/median_spec.rb'
 
Graphql/Descriptions:
Exclude:
- 'ee/app/graphql/types/epic_tree/epic_tree_node_input_type.rb'
- 'ee/app/graphql/types/external_issue_type.rb'
- 'ee/app/graphql/types/geo/geo_node_type.rb'
- 'ee/app/graphql/types/geo/merge_request_diff_registry_type.rb'
- 'ee/app/graphql/types/geo/package_file_registry_type.rb'
- 'ee/app/graphql/types/geo/snippet_repository_registry_type.rb'
- 'ee/app/graphql/types/geo/terraform_state_version_registry_type.rb'
- 'ee/app/graphql/types/group_stats_type.rb'
- 'ee/app/graphql/types/incident_management/oncall_schedule_type.rb'
- 'ee/app/graphql/types/instance_security_dashboard_type.rb'
- 'ee/app/graphql/types/iteration_type.rb'
- 'ee/app/graphql/types/metric_image_type.rb'
- 'ee/app/graphql/types/requirements_management/requirement_states_count_type.rb'
- 'ee/app/graphql/types/requirements_management/requirement_type.rb'
- 'ee/app/graphql/types/requirements_management/test_report_type.rb'
- 'ee/app/graphql/types/scanned_resource_type.rb'
- 'ee/app/graphql/types/security_report_summary_section_type.rb'
- 'ee/app/graphql/types/time_report_stats_type.rb'
- 'ee/app/graphql/types/timebox_metrics_type.rb'
- 'ee/app/graphql/types/timebox_report_interface.rb'
- 'ee/app/graphql/types/timebox_report_type.rb'
- 'ee/app/graphql/types/timelog_type.rb'
- 'ee/app/graphql/types/vulnerabilities_count_by_day_and_severity_type.rb'
- 'ee/app/graphql/types/vulnerabilities_count_by_day_type.rb'
- 'ee/app/graphql/types/vulnerability/external_issue_link_type.rb'
- 'ee/app/graphql/types/vulnerability/issue_link_type.rb'
- 'ee/app/graphql/types/vulnerability_identifier_type.rb'
- 'ee/app/graphql/types/vulnerability_location/container_scanning_type.rb'
- 'ee/app/graphql/types/vulnerability_location/coverage_fuzzing_type.rb'
- 'ee/app/graphql/types/vulnerability_location/dast_type.rb'
- 'ee/app/graphql/types/vulnerability_location/dependency_scanning_type.rb'
- 'ee/app/graphql/types/vulnerability_location/sast_type.rb'
- 'ee/app/graphql/types/vulnerability_location/secret_detection_type.rb'
- 'ee/app/graphql/types/vulnerability_scanner_type.rb'
- 'ee/app/graphql/types/vulnerability_type.rb'
- 'ee/app/graphql/types/vulnerable_dependency_type.rb'
- 'ee/app/graphql/types/vulnerable_package_type.rb'
- 'ee/app/graphql/types/vulnerable_projects_by_grade_type.rb'
# WIP: https://gitlab.com/gitlab-org/gitlab/-/issues/34997
RSpec/AnyInstanceOf:
Exclude:
Loading
Loading
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Loading
Loading
@@ -10,22 +10,22 @@ class EpicTreeNodeInputType < BaseInputObject
argument :id,
::Types::GlobalIDType[::EpicTreeSorting],
required: true,
description: 'The ID of the epic_issue or epic that is being moved'
description: 'The ID of the epic_issue or epic that is being moved.'
 
argument :adjacent_reference_id,
::Types::GlobalIDType[::EpicTreeSorting],
required: false,
description: 'The ID of the epic_issue or issue that the actual epic or issue is switched with'
description: 'The ID of the epic_issue or issue that the actual epic or issue is switched with.'
 
argument :relative_position,
MoveTypeEnum,
required: false,
description: 'The type of the switch, after or before allowed'
description: 'The type of the switch, after or before allowed.'
 
argument :new_parent_id,
::Types::GlobalIDType[::Epic],
required: false,
description: 'ID of the new parent epic'
description: 'ID of the new parent epic.'
end
# rubocop: enable Graphql/AuthorizeTypes
end
Loading
Loading
Loading
Loading
@@ -7,25 +7,25 @@ class ExternalIssueType < BaseObject
description 'Represents an external issue'
 
field :title, GraphQL::STRING_TYPE, null: true,
description: 'Title of the issue in the external tracker'
description: 'Title of the issue in the external tracker.'
 
field :relative_reference, GraphQL::STRING_TYPE, null: true,
description: 'Relative reference of the issue in the external tracker'
description: 'Relative reference of the issue in the external tracker.'
 
field :status, GraphQL::STRING_TYPE, null: true,
description: 'Status of the issue in the external tracker'
description: 'Status of the issue in the external tracker.'
 
field :external_tracker, GraphQL::STRING_TYPE, null: true,
description: 'Type of external tracker'
description: 'Type of external tracker.'
 
field :web_url, GraphQL::STRING_TYPE, null: true,
description: 'URL to the issue in the external tracker'
description: 'URL to the issue in the external tracker.'
 
field :created_at, Types::TimeType, null: true,
description: 'Timestamp of when the issue was created'
description: 'Timestamp of when the issue was created.'
 
field :updated_at, Types::TimeType, null: true,
description: 'Timestamp of when the issue was updated'
description: 'Timestamp of when the issue was updated.'
 
def relative_reference
object.dig(:references, :relative)
Loading
Loading
Loading
Loading
@@ -7,37 +7,37 @@ class GeoNodeType < BaseObject
 
authorize :read_geo_node
 
field :id, GraphQL::ID_TYPE, null: false, description: 'ID of this GeoNode'
field :primary, GraphQL::BOOLEAN_TYPE, null: true, description: 'Indicates whether this Geo node is the primary'
field :enabled, GraphQL::BOOLEAN_TYPE, null: true, description: 'Indicates whether this Geo node is enabled'
field :name, GraphQL::STRING_TYPE, null: true, description: 'The unique identifier for this Geo node'
field :url, GraphQL::STRING_TYPE, null: true, description: 'The user-facing URL for this Geo node'
field :internal_url, GraphQL::STRING_TYPE, null: true, description: 'The URL defined on the primary node that secondary nodes should use to contact it'
field :files_max_capacity, GraphQL::INT_TYPE, null: true, description: 'The maximum concurrency of LFS/attachment backfill for this secondary node'
field :repos_max_capacity, GraphQL::INT_TYPE, null: true, description: 'The maximum concurrency of repository backfill for this secondary node'
field :verification_max_capacity, GraphQL::INT_TYPE, null: true, description: 'The maximum concurrency of repository verification for this secondary node'
field :container_repositories_max_capacity, GraphQL::INT_TYPE, null: true, description: 'The maximum concurrency of container repository sync for this secondary node'
field :sync_object_storage, GraphQL::BOOLEAN_TYPE, null: true, description: 'Indicates if this secondary node will replicate blobs in Object Storage'
field :selective_sync_type, GraphQL::STRING_TYPE, null: true, description: 'Indicates if syncing is limited to only specific groups, or shards'
field :selective_sync_shards, type: [GraphQL::STRING_TYPE], null: true, description: 'The repository storages whose projects should be synced, if `selective_sync_type` == `shards`'
field :selective_sync_namespaces, ::Types::NamespaceType.connection_type, null: true, method: :namespaces, description: 'The namespaces that should be synced, if `selective_sync_type` == `namespaces`'
field :minimum_reverification_interval, GraphQL::INT_TYPE, null: true, description: 'The interval (in days) in which the repository verification is valid. Once expired, it will be reverified'
field :id, GraphQL::ID_TYPE, null: false, description: 'ID of this GeoNode.'
field :primary, GraphQL::BOOLEAN_TYPE, null: true, description: 'Indicates whether this Geo node is the primary.'
field :enabled, GraphQL::BOOLEAN_TYPE, null: true, description: 'Indicates whether this Geo node is enabled.'
field :name, GraphQL::STRING_TYPE, null: true, description: 'The unique identifier for this Geo node.'
field :url, GraphQL::STRING_TYPE, null: true, description: 'The user-facing URL for this Geo node.'
field :internal_url, GraphQL::STRING_TYPE, null: true, description: 'The URL defined on the primary node that secondary nodes should use to contact it.'
field :files_max_capacity, GraphQL::INT_TYPE, null: true, description: 'The maximum concurrency of LFS/attachment backfill for this secondary node.'
field :repos_max_capacity, GraphQL::INT_TYPE, null: true, description: 'The maximum concurrency of repository backfill for this secondary node.'
field :verification_max_capacity, GraphQL::INT_TYPE, null: true, description: 'The maximum concurrency of repository verification for this secondary node.'
field :container_repositories_max_capacity, GraphQL::INT_TYPE, null: true, description: 'The maximum concurrency of container repository sync for this secondary node.'
field :sync_object_storage, GraphQL::BOOLEAN_TYPE, null: true, description: 'Indicates if this secondary node will replicate blobs in Object Storage.'
field :selective_sync_type, GraphQL::STRING_TYPE, null: true, description: 'Indicates if syncing is limited to only specific groups, or shards.'
field :selective_sync_shards, type: [GraphQL::STRING_TYPE], null: true, description: 'The repository storages whose projects should be synced, if `selective_sync_type` == `shards`.'
field :selective_sync_namespaces, ::Types::NamespaceType.connection_type, null: true, method: :namespaces, description: 'The namespaces that should be synced, if `selective_sync_type` == `namespaces`.'
field :minimum_reverification_interval, GraphQL::INT_TYPE, null: true, description: 'The interval (in days) in which the repository verification is valid. Once expired, it will be reverified.'
field :merge_request_diff_registries, ::Types::Geo::MergeRequestDiffRegistryType.connection_type,
null: true,
resolver: ::Resolvers::Geo::MergeRequestDiffRegistriesResolver,
description: 'Find merge request diff registries on this Geo node'
description: 'Find merge request diff registries on this Geo node.'
field :package_file_registries, ::Types::Geo::PackageFileRegistryType.connection_type,
null: true,
resolver: ::Resolvers::Geo::PackageFileRegistriesResolver,
description: 'Package file registries of the GeoNode'
description: 'Package file registries of the GeoNode.'
field :snippet_repository_registries, ::Types::Geo::SnippetRepositoryRegistryType.connection_type,
null: true,
resolver: ::Resolvers::Geo::SnippetRepositoryRegistriesResolver,
description: 'Find snippet repository registries on this Geo node'
description: 'Find snippet repository registries on this Geo node.'
field :terraform_state_version_registries, ::Types::Geo::TerraformStateVersionRegistryType.connection_type,
null: true,
resolver: ::Resolvers::Geo::TerraformStateVersionRegistriesResolver,
description: 'Find terraform state version registries on this Geo node'
description: 'Find terraform state version registries on this Geo node.'
end
end
end
Loading
Loading
@@ -9,7 +9,7 @@ class MergeRequestDiffRegistryType < BaseObject
graphql_name 'MergeRequestDiffRegistry'
description 'Represents the Geo sync and verification state of a Merge Request diff'
 
field :merge_request_diff_id, GraphQL::ID_TYPE, null: false, description: 'ID of the Merge Request diff'
field :merge_request_diff_id, GraphQL::ID_TYPE, null: false, description: 'ID of the Merge Request diff.'
end
end
end
Loading
Loading
@@ -9,7 +9,7 @@ class PackageFileRegistryType < BaseObject
graphql_name 'PackageFileRegistry'
description 'Represents the Geo sync and verification state of a package file'
 
field :package_file_id, GraphQL::ID_TYPE, null: false, description: 'ID of the PackageFile'
field :package_file_id, GraphQL::ID_TYPE, null: false, description: 'ID of the PackageFile.'
end
end
end
Loading
Loading
@@ -9,7 +9,7 @@ class SnippetRepositoryRegistryType < BaseObject
graphql_name 'SnippetRepositoryRegistry'
description 'Represents the Geo sync and verification state of a snippet repository'
 
field :snippet_repository_id, GraphQL::ID_TYPE, null: false, description: 'ID of the Snippet Repository'
field :snippet_repository_id, GraphQL::ID_TYPE, null: false, description: 'ID of the Snippet Repository.'
end
end
end
Loading
Loading
@@ -9,7 +9,7 @@ class TerraformStateVersionRegistryType < BaseObject
graphql_name 'TerraformStateVersionRegistry'
description 'Represents the Geo sync and verification state of a terraform state version'
 
field :terraform_state_version_id, GraphQL::ID_TYPE, null: false, description: 'ID of the terraform state version'
field :terraform_state_version_id, GraphQL::ID_TYPE, null: false, description: 'ID of the terraform state version.'
end
end
end
Loading
Loading
@@ -9,6 +9,6 @@ class GroupStatsType < BaseObject
 
field :release_stats, Types::GroupReleaseStatsType,
null: true, method: :itself,
description: 'Statistics related to releases within the group'
description: 'Statistics related to releases within the group.'
end
end
Loading
Loading
@@ -11,27 +11,27 @@ class OncallScheduleType < BaseObject
field :iid,
GraphQL::ID_TYPE,
null: false,
description: 'Internal ID of the on-call schedule'
description: 'Internal ID of the on-call schedule.'
 
field :name,
GraphQL::STRING_TYPE,
null: false,
description: 'Name of the on-call schedule'
description: 'Name of the on-call schedule.'
 
field :description,
GraphQL::STRING_TYPE,
null: true,
description: 'Description of the on-call schedule'
description: 'Description of the on-call schedule.'
 
field :timezone,
GraphQL::STRING_TYPE,
null: false,
description: 'Time zone of the on-call schedule'
description: 'Time zone of the on-call schedule.'
 
field :rotations,
OncallRotationType.connection_type,
null: false,
description: 'On-call rotations for the on-call schedule'
description: 'On-call rotations for the on-call schedule.'
end
end
end
Loading
Loading
@@ -9,22 +9,22 @@ class InstanceSecurityDashboardType < BaseObject
field :projects,
Types::ProjectType.connection_type,
null: false,
description: 'Projects selected in Instance Security Dashboard'
description: 'Projects selected in Instance Security Dashboard.'
 
field :vulnerability_scanners,
::Types::VulnerabilityScannerType.connection_type,
null: true,
description: 'Vulnerability scanners reported on the vulnerabilities from projects selected in Instance Security Dashboard',
description: 'Vulnerability scanners reported on the vulnerabilities from projects selected in Instance Security Dashboard.',
resolver: ::Resolvers::Vulnerabilities::ScannersResolver
 
field :vulnerability_severities_count, ::Types::VulnerabilitySeveritiesCountType, null: true,
description: 'Counts for each vulnerability severity from projects selected in Instance Security Dashboard',
description: 'Counts for each vulnerability severity from projects selected in Instance Security Dashboard.',
resolver: ::Resolvers::VulnerabilitySeveritiesCountResolver
 
field :vulnerability_grades,
[Types::VulnerableProjectsByGradeType],
null: false,
description: 'Represents vulnerable project counts for each grade'
description: 'Represents vulnerable project counts for each grade.'
 
def vulnerability_grades
::Gitlab::Graphql::Aggregations::VulnerabilityStatistics::LazyAggregate.new(
Loading
Loading
Loading
Loading
@@ -12,43 +12,43 @@ class IterationType < BaseObject
implements ::Types::TimeboxReportInterface
 
field :id, GraphQL::ID_TYPE, null: false,
description: 'ID of the iteration'
description: 'ID of the iteration.'
 
field :iid, GraphQL::ID_TYPE, null: false,
description: 'Internal ID of the iteration'
description: 'Internal ID of the iteration.'
 
field :title, GraphQL::STRING_TYPE, null: false,
description: 'Title of the iteration'
description: 'Title of the iteration.'
 
field :description, GraphQL::STRING_TYPE, null: true,
description: 'Description of the iteration'
description: 'Description of the iteration.'
markdown_field :description_html, null: true
 
field :state, Types::IterationStateEnum, null: false,
description: 'State of the iteration'
description: 'State of the iteration.'
 
field :web_path, GraphQL::STRING_TYPE, null: false, method: :iteration_path,
description: 'Web path of the iteration'
description: 'Web path of the iteration.'
 
field :web_url, GraphQL::STRING_TYPE, null: false, method: :iteration_url,
description: 'Web URL of the iteration'
description: 'Web URL of the iteration.'
 
field :scoped_path, GraphQL::STRING_TYPE, null: true, method: :scoped_iteration_path, extras: [:parent],
description: 'Web path of the iteration, scoped to the query parent. Only valid for Project parents. Returns null in other contexts'
description: 'Web path of the iteration, scoped to the query parent. Only valid for Project parents. Returns null in other contexts.'
 
field :scoped_url, GraphQL::STRING_TYPE, null: true, method: :scoped_iteration_url, extras: [:parent],
description: 'Web URL of the iteration, scoped to the query parent. Only valid for Project parents. Returns null in other contexts'
description: 'Web URL of the iteration, scoped to the query parent. Only valid for Project parents. Returns null in other contexts.'
 
field :due_date, Types::TimeType, null: true,
description: 'Timestamp of the iteration due date'
description: 'Timestamp of the iteration due date.'
 
field :start_date, Types::TimeType, null: true,
description: 'Timestamp of the iteration start date'
description: 'Timestamp of the iteration start date.'
 
field :created_at, Types::TimeType, null: false,
description: 'Timestamp of iteration creation'
description: 'Timestamp of iteration creation.'
 
field :updated_at, Types::TimeType, null: false,
description: 'Timestamp of last iteration update'
description: 'Timestamp of last iteration update.'
end
end
Loading
Loading
@@ -8,19 +8,19 @@ class MetricImageType < BaseObject
authorize :read_issuable_metric_image
 
field :id, GraphQL::ID_TYPE, null: false,
description: 'ID of the metric upload'
description: 'ID of the metric upload.'
 
field :iid, GraphQL::ID_TYPE, null: false,
description: 'Internal ID of the metric upload'
description: 'Internal ID of the metric upload.'
 
field :url, GraphQL::STRING_TYPE, null: false,
description: 'URL of the metric source'
description: 'URL of the metric source.'
 
field :file_name, GraphQL::STRING_TYPE, null: true,
description: 'File name of the metric image',
description: 'File name of the metric image.',
method: :filename
 
field :file_path, GraphQL::STRING_TYPE, null: true,
description: 'File path of the metric image'
description: 'File path of the metric image.'
end
end
Loading
Loading
@@ -7,8 +7,8 @@ class RequirementStatesCountType < BaseObject
graphql_name 'RequirementStatesCount'
description 'Counts of requirements by their state'
 
field :opened, GraphQL::INT_TYPE, null: true, description: 'Number of opened requirements'
field :archived, GraphQL::INT_TYPE, null: true, description: 'Number of archived requirements'
field :opened, GraphQL::INT_TYPE, null: true, description: 'Number of opened requirements.'
field :archived, GraphQL::INT_TYPE, null: true, description: 'Number of archived requirements.'
end
# rubocop: enable Graphql/AuthorizeTypes
end
Loading
Loading
Loading
Loading
@@ -11,46 +11,46 @@ class RequirementType < BaseObject
expose_permissions Types::PermissionTypes::Requirement
 
field :id, GraphQL::ID_TYPE, null: false,
description: 'ID of the requirement'
description: 'ID of the requirement.'
 
field :iid, GraphQL::ID_TYPE, null: false,
description: 'Internal ID of the requirement'
description: 'Internal ID of the requirement.'
 
field :title, GraphQL::STRING_TYPE, null: true,
description: 'Title of the requirement'
description: 'Title of the requirement.'
markdown_field :title_html, null: true
 
field :description, GraphQL::STRING_TYPE, null: true,
description: 'Description of the requirement'
description: 'Description of the requirement.'
markdown_field :description_html, null: true
 
field :state, RequirementsManagement::RequirementStateEnum, null: false,
description: 'State of the requirement'
description: 'State of the requirement.'
 
field :last_test_report_state, RequirementsManagement::TestReportStateEnum, null: true,
description: 'Latest requirement test report state'
description: 'Latest requirement test report state.'
 
field :last_test_report_manually_created,
GraphQL::BOOLEAN_TYPE,
method: :last_test_report_manually_created?,
null: true,
description: 'Indicates if latest test report was created by user'
description: 'Indicates if latest test report was created by user.'
 
field :project, ProjectType, null: false,
description: 'Project to which the requirement belongs'
description: 'Project to which the requirement belongs.'
 
field :author, UserType, null: false,
description: 'Author of the requirement'
description: 'Author of the requirement.'
 
field :test_reports, TestReportType.connection_type, null: true, complexity: 5,
description: 'Test reports of the requirement',
description: 'Test reports of the requirement.',
resolver: Resolvers::RequirementsManagement::TestReportsResolver
 
field :created_at, Types::TimeType, null: false,
description: 'Timestamp of when the requirement was created'
description: 'Timestamp of when the requirement was created.'
 
field :updated_at, Types::TimeType, null: false,
description: 'Timestamp of when the requirement was last updated'
description: 'Timestamp of when the requirement was last updated.'
 
def project
Gitlab::Graphql::Loaders::BatchModelLoader.new(Project, object.project_id).find
Loading
Loading
Loading
Loading
@@ -9,16 +9,16 @@ class TestReportType < BaseObject
authorize :read_requirement
 
field :id, GraphQL::ID_TYPE, null: false,
description: 'ID of the test report'
description: 'ID of the test report.'
 
field :state, TestReportStateEnum, null: false,
description: 'State of the test report'
description: 'State of the test report.'
 
field :author, UserType, null: true,
description: 'Author of the test report'
description: 'Author of the test report.'
 
field :created_at, TimeType, null: false,
description: 'Timestamp of when the test report was created'
description: 'Timestamp of when the test report was created.'
 
def author
Gitlab::Graphql::Loaders::BatchModelLoader.new(User, object.author_id).find
Loading
Loading
Loading
Loading
@@ -6,7 +6,7 @@ class ScannedResourceType < BaseObject
graphql_name 'ScannedResource'
description 'Represents a resource scanned by a security scan'
 
field :url, GraphQL::STRING_TYPE, null: true, description: 'The URL scanned by the scanner'
field :request_method, GraphQL::STRING_TYPE, null: true, description: 'The HTTP request method used to access the URL'
field :url, GraphQL::STRING_TYPE, null: true, description: 'The URL scanned by the scanner.'
field :request_method, GraphQL::STRING_TYPE, null: true, description: 'The HTTP request method used to access the URL.'
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment