Commit b63a4745 authored by Luke Duncalfe's avatar Luke Duncalfe

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
...@@ -691,47 +691,6 @@ RSpec/TimecopTravel: ...@@ -691,47 +691,6 @@ RSpec/TimecopTravel:
- 'spec/workers/concerns/reenqueuer_spec.rb' - 'spec/workers/concerns/reenqueuer_spec.rb'
- 'spec/lib/gitlab/analytics/cycle_analytics/median_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 # WIP: https://gitlab.com/gitlab-org/gitlab/-/issues/34997
RSpec/AnyInstanceOf: RSpec/AnyInstanceOf:
Exclude: Exclude:
......
This diff is collapsed.
...@@ -10,22 +10,22 @@ module Types ...@@ -10,22 +10,22 @@ module Types
argument :id, argument :id,
::Types::GlobalIDType[::EpicTreeSorting], ::Types::GlobalIDType[::EpicTreeSorting],
required: true, 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, argument :adjacent_reference_id,
::Types::GlobalIDType[::EpicTreeSorting], ::Types::GlobalIDType[::EpicTreeSorting],
required: false, 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, argument :relative_position,
MoveTypeEnum, MoveTypeEnum,
required: false, 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, argument :new_parent_id,
::Types::GlobalIDType[::Epic], ::Types::GlobalIDType[::Epic],
required: false, required: false,
description: 'ID of the new parent epic' description: 'ID of the new parent epic.'
end end
# rubocop: enable Graphql/AuthorizeTypes # rubocop: enable Graphql/AuthorizeTypes
end end
......
...@@ -7,25 +7,25 @@ module Types ...@@ -7,25 +7,25 @@ module Types
description 'Represents an external issue' description 'Represents an external issue'
field :title, GraphQL::STRING_TYPE, null: true, 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, 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, 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, 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, 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, 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, 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 def relative_reference
object.dig(:references, :relative) object.dig(:references, :relative)
......
...@@ -7,37 +7,37 @@ module Types ...@@ -7,37 +7,37 @@ module Types
authorize :read_geo_node authorize :read_geo_node
field :id, GraphQL::ID_TYPE, null: false, description: 'ID of this GeoNode' 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 :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 :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 :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 :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 :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 :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 :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 :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 :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 :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_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_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 :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 :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, field :merge_request_diff_registries, ::Types::Geo::MergeRequestDiffRegistryType.connection_type,
null: true, null: true,
resolver: ::Resolvers::Geo::MergeRequestDiffRegistriesResolver, 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, field :package_file_registries, ::Types::Geo::PackageFileRegistryType.connection_type,
null: true, null: true,
resolver: ::Resolvers::Geo::PackageFileRegistriesResolver, 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, field :snippet_repository_registries, ::Types::Geo::SnippetRepositoryRegistryType.connection_type,
null: true, null: true,
resolver: ::Resolvers::Geo::SnippetRepositoryRegistriesResolver, 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, field :terraform_state_version_registries, ::Types::Geo::TerraformStateVersionRegistryType.connection_type,
null: true, null: true,
resolver: ::Resolvers::Geo::TerraformStateVersionRegistriesResolver, 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 end
end end
...@@ -9,7 +9,7 @@ module Types ...@@ -9,7 +9,7 @@ module Types
graphql_name 'MergeRequestDiffRegistry' graphql_name 'MergeRequestDiffRegistry'
description 'Represents the Geo sync and verification state of a Merge Request diff' 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 end
end end
...@@ -9,7 +9,7 @@ module Types ...@@ -9,7 +9,7 @@ module Types
graphql_name 'PackageFileRegistry' graphql_name 'PackageFileRegistry'
description 'Represents the Geo sync and verification state of a package file' 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 end
end end
...@@ -9,7 +9,7 @@ module Types ...@@ -9,7 +9,7 @@ module Types
graphql_name 'SnippetRepositoryRegistry' graphql_name 'SnippetRepositoryRegistry'
description 'Represents the Geo sync and verification state of a snippet repository' 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 end
end end
...@@ -9,7 +9,7 @@ module Types ...@@ -9,7 +9,7 @@ module Types
graphql_name 'TerraformStateVersionRegistry' graphql_name 'TerraformStateVersionRegistry'
description 'Represents the Geo sync and verification state of a terraform state version' 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 end
end end
...@@ -9,6 +9,6 @@ module Types ...@@ -9,6 +9,6 @@ module Types
field :release_stats, Types::GroupReleaseStatsType, field :release_stats, Types::GroupReleaseStatsType,
null: true, method: :itself, null: true, method: :itself,
description: 'Statistics related to releases within the group' description: 'Statistics related to releases within the group.'
end end
end end
...@@ -11,27 +11,27 @@ module Types ...@@ -11,27 +11,27 @@ module Types
field :iid, field :iid,
GraphQL::ID_TYPE, GraphQL::ID_TYPE,
null: false, null: false,
description: 'Internal ID of the on-call schedule' description: 'Internal ID of the on-call schedule.'
field :name, field :name,
GraphQL::STRING_TYPE, GraphQL::STRING_TYPE,
null: false, null: false,
description: 'Name of the on-call schedule' description: 'Name of the on-call schedule.'
field :description, field :description,
GraphQL::STRING_TYPE, GraphQL::STRING_TYPE,
null: true, null: true,
description: 'Description of the on-call schedule' description: 'Description of the on-call schedule.'
field :timezone, field :timezone,
GraphQL::STRING_TYPE, GraphQL::STRING_TYPE,
null: false, null: false,
description: 'Time zone of the on-call schedule' description: 'Time zone of the on-call schedule.'
field :rotations, field :rotations,
OncallRotationType.connection_type, OncallRotationType.connection_type,
null: false, null: false,
description: 'On-call rotations for the on-call schedule' description: 'On-call rotations for the on-call schedule.'
end end
end end
end end
...@@ -9,22 +9,22 @@ module Types ...@@ -9,22 +9,22 @@ module Types
field :projects, field :projects,
Types::ProjectType.connection_type, Types::ProjectType.connection_type,
null: false, null: false,
description: 'Projects selected in Instance Security Dashboard' description: 'Projects selected in Instance Security Dashboard.'
field :vulnerability_scanners, field :vulnerability_scanners,
::Types::VulnerabilityScannerType.connection_type, ::Types::VulnerabilityScannerType.connection_type,
null: true, 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 resolver: ::Resolvers::Vulnerabilities::ScannersResolver
field :vulnerability_severities_count, ::Types::VulnerabilitySeveritiesCountType, null: true, 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 resolver: ::Resolvers::VulnerabilitySeveritiesCountResolver
field :vulnerability_grades, field :vulnerability_grades,
[Types::VulnerableProjectsByGradeType], [Types::VulnerableProjectsByGradeType],
null: false, null: false,
description: 'Represents vulnerable project counts for each grade' description: 'Represents vulnerable project counts for each grade.'
def vulnerability_grades def vulnerability_grades
::Gitlab::Graphql::Aggregations::VulnerabilityStatistics::LazyAggregate.new( ::Gitlab::Graphql::Aggregations::VulnerabilityStatistics::LazyAggregate.new(
......
...@@ -12,43 +12,43 @@ module Types ...@@ -12,43 +12,43 @@ module Types
implements ::Types::TimeboxReportInterface implements ::Types::TimeboxReportInterface
field :id, GraphQL::ID_TYPE, null: false, field :id, GraphQL::ID_TYPE, null: false,
description: 'ID of the iteration' description: 'ID of the iteration.'
field :iid, GraphQL::ID_TYPE, null: false, 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, field :title, GraphQL::STRING_TYPE, null: false,
description: 'Title of the iteration' description: 'Title of the iteration.'
field :description, GraphQL::STRING_TYPE, null: true, field :description, GraphQL::STRING_TYPE, null: true,
description: 'Description of the iteration' description: 'Description of the iteration.'
markdown_field :description_html, null: true markdown_field :description_html, null: true
field :state, Types::IterationStateEnum, null: false, 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, 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, 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], 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], 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, 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, 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, field :created_at, Types::TimeType, null: false,
description: 'Timestamp of iteration creation' description: 'Timestamp of iteration creation.'
field :updated_at, Types::TimeType, null: false, field :updated_at, Types::TimeType, null: false,
description: 'Timestamp of last iteration update' description: 'Timestamp of last iteration update.'
end end
end end
...@@ -8,19 +8,19 @@ module Types ...@@ -8,19 +8,19 @@ module Types
authorize :read_issuable_metric_image authorize :read_issuable_metric_image
field :id, GraphQL::ID_TYPE, null: false, 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, 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, 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, field :file_name, GraphQL::STRING_TYPE, null: true,
description: 'File name of the metric image', description: 'File name of the metric image.',
method: :filename method: :filename
field :file_path, GraphQL::STRING_TYPE, null: true, field :file_path, GraphQL::STRING_TYPE, null: true,
description: 'File path of the metric image' description: 'File path of the metric image.'
end end
end end
...@@ -7,8 +7,8 @@ module Types ...@@ -7,8 +7,8 @@ module Types
graphql_name 'RequirementStatesCount' graphql_name 'RequirementStatesCount'
description 'Counts of requirements by their state' description 'Counts of requirements by their state'
field :opened, GraphQL::INT_TYPE, null: true, description: 'Number of opened 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' field :archived, GraphQL::INT_TYPE, null: true, description: 'Number of archived requirements.'
end end
# rubocop: enable Graphql/AuthorizeTypes # rubocop: enable Graphql/AuthorizeTypes
end end
......
...@@ -11,46 +11,46 @@ module Types ...@@ -11,46 +11,46 @@ module Types
expose_permissions Types::PermissionTypes::Requirement expose_permissions Types::PermissionTypes::Requirement
field :id, GraphQL::ID_TYPE, null: false, field :id, GraphQL::ID_TYPE, null: false,
description: 'ID of the requirement' description: 'ID of the requirement.'
field :iid, GraphQL::ID_TYPE, null: false, 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, field :title, GraphQL::STRING_TYPE, null: true,
description: 'Title of the requirement' description: 'Title of the requirement.'
markdown_field :title_html, null: true markdown_field :title_html, null: true
field :description, GraphQL::STRING_TYPE, 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 markdown_field :description_html, null: true
field :state, RequirementsManagement::RequirementStateEnum, null: false, 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, 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, field :last_test_report_manually_created,
GraphQL::BOOLEAN_TYPE, GraphQL::BOOLEAN_TYPE,
method: :last_test_report_manually_created?, method: :last_test_report_manually_created?,
null: true, 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, field :project, ProjectType, null: false,
description: 'Project to which the requirement belongs' description: 'Project to which the requirement belongs.'
field :author, UserType, null: false, 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, 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 resolver: Resolvers::RequirementsManagement::TestReportsResolver
field :created_at, Types::TimeType, null: false, 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, 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 def project
Gitlab::Graphql::Loaders::BatchModelLoader.new(Project, object.project_id).find Gitlab::Graphql::Loaders::BatchModelLoader.new(Project, object.project_id).find
......
...@@ -9,16 +9,16 @@ module Types ...@@ -9,16 +9,16 @@ module Types
authorize :read_requirement authorize :read_requirement
field :id, GraphQL::ID_TYPE, null: false, field :id, GraphQL::ID_TYPE, null: false,
description: 'ID of the test report' description: 'ID of the test report.'
field :state, TestReportStateEnum, null: false, field :state, TestReportStateEnum, null: false,
description: 'State of the test report' description: 'State of the test report.'
field :author, UserType, null: true, field :author, UserType, null: true,
description: 'Author of the test report' description: 'Author of the test report.'
field :created_at, TimeType, null: false, 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 def author
Gitlab::Graphql::Loaders::BatchModelLoader.new(User, object.author_id).find Gitlab::Graphql::Loaders::BatchModelLoader.new(User, object.author_id).find
......
...@@ -6,7 +6,7 @@ module Types ...@@ -6,7 +6,7 @@ module Types
graphql_name 'ScannedResource' graphql_name 'ScannedResource'
description 'Represents a resource scanned by a security scan' description 'Represents a resource scanned by a security scan'
field :url, GraphQL::STRING_TYPE, null: true, description: 'The URL scanned by the scanner' 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 :request_method, GraphQL::STRING_TYPE, null: true, description: 'The HTTP request method used to access the URL.'
end end
end end
...@@ -6,9 +6,9 @@ module Types ...@@ -6,9 +6,9 @@ module Types
graphql_name 'SecurityReportSummarySection' graphql_name 'SecurityReportSummarySection'
description 'Represents a section of a summary of a security report' description 'Represents a section of a summary of a security report'
field :vulnerabilities_count, GraphQL::INT_TYPE, null: true, description: 'Total number of vulnerabilities' field :vulnerabilities_count, GraphQL::INT_TYPE, null: true, description: 'Total number of vulnerabilities.'
field :scanned_resources_count, GraphQL::INT_TYPE, null: true, description: 'Total number of scanned resources' field :scanned_resources_count, GraphQL::INT_TYPE, null: true, description: 'Total number of scanned resources.'
field :scanned_resources, ::Types::ScannedResourceType.connection_type, null: true, description: 'A list of the first 20 scanned resources' field :scanned_resources, ::Types::ScannedResourceType.connection_type, null: true, description: 'A list of the first 20 scanned resources.'
field :scanned_resources_csv_path, GraphQL::STRING_TYPE, null: true, description: 'Path to download all the scanned resources in CSV format' field :scanned_resources_csv_path, GraphQL::STRING_TYPE, null: true, description: 'Path to download all the scanned resources in CSV format.'
end end
end end
...@@ -7,12 +7,12 @@ module Types ...@@ -7,12 +7,12 @@ module Types
description 'Represents the time report stats for timeboxes' description 'Represents the time report stats for timeboxes'
field :complete, ::Types::TimeboxMetricsType, null: true, field :complete, ::Types::TimeboxMetricsType, null: true,
description: 'Completed issues metrics' description: 'Completed issues metrics.'
field :incomplete, ::Types::TimeboxMetricsType, null: true, field :incomplete, ::Types::TimeboxMetricsType, null: true,
description: 'Incomplete issues metrics' description: 'Incomplete issues metrics.'
field :total, ::Types::TimeboxMetricsType, null: true, field :total, ::Types::TimeboxMetricsType, null: true,
description: 'Total issues metrics' description: 'Total issues metrics.'
end end
end end
...@@ -7,9 +7,9 @@ module Types ...@@ -7,9 +7,9 @@ module Types
description 'Represents measured stats metrics for timeboxes' description 'Represents measured stats metrics for timeboxes'
field :count, GraphQL::INT_TYPE, null: false, field :count, GraphQL::INT_TYPE, null: false,
description: 'The count metric' description: 'The count metric.'
field :weight, GraphQL::INT_TYPE, null: false, field :weight, GraphQL::INT_TYPE, null: false,
description: 'The weight metric' description: 'The weight metric.'
end end
end end
...@@ -6,7 +6,7 @@ module Types ...@@ -6,7 +6,7 @@ module Types
field :report, Types::TimeboxReportType, null: true, field :report, Types::TimeboxReportType, null: true,
resolver: ::Resolvers::TimeboxReportResolver, resolver: ::Resolvers::TimeboxReportResolver,
description: 'Historically accurate report about the timebox', description: 'Historically accurate report about the timebox.',
complexity: 175 complexity: 175
end end
end end
...@@ -7,8 +7,8 @@ module Types ...@@ -7,8 +7,8 @@ module Types
description 'Represents a historically accurate report about the timebox' description 'Represents a historically accurate report about the timebox'
field :stats, ::Types::TimeReportStatsType, null: true, field :stats, ::Types::TimeReportStatsType, null: true,
description: 'Represents the time report stats for the timebox' description: 'Represents the time report stats for the timebox.'
field :burnup_time_series, [::Types::BurnupChartDailyTotalsType], null: true, field :burnup_time_series, [::Types::BurnupChartDailyTotalsType], null: true,
description: 'Daily scope and completed totals for burnup charts' description: 'Daily scope and completed totals for burnup charts.'
end end
end end
...@@ -9,27 +9,27 @@ module Types ...@@ -9,27 +9,27 @@ module Types
field :spent_at, field :spent_at,
Types::TimeType, Types::TimeType,
null: true, null: true,
description: 'Timestamp of when the time tracked was spent at' description: 'Timestamp of when the time tracked was spent at.'
field :time_spent, field :time_spent,
GraphQL::INT_TYPE, GraphQL::INT_TYPE,
null: false, null: false,
description: 'The time spent displayed in seconds' description: 'The time spent displayed in seconds.'
field :user, field :user,
Types::UserType, Types::UserType,
null: false, null: false,
description: 'The user that logged the time' description: 'The user that logged the time.'
field :issue, field :issue,
Types::IssueType, Types::IssueType,
null: true, null: true,
description: 'The issue that logged time was added to' description: 'The issue that logged time was added to.'
field :note, field :note,
Types::Notes::NoteType, Types::Notes::NoteType,
null: true, null: true,
description: 'The note where the quick action to add the logged time was executed' description: 'The note where the quick action to add the logged time was executed.'
def user def user
Gitlab::Graphql::Loaders::BatchModelLoader.new(User, object.user_id).find Gitlab::Graphql::Loaders::BatchModelLoader.new(User, object.user_id).find
......
...@@ -7,12 +7,12 @@ module Types ...@@ -7,12 +7,12 @@ module Types
description 'Represents the number of vulnerabilities for a particular severity on a particular day. This data is retained for 365 days' description 'Represents the number of vulnerabilities for a particular severity on a particular day. This data is retained for 365 days'
field :count, GraphQL::INT_TYPE, null: true, field :count, GraphQL::INT_TYPE, null: true,
description: 'Number of vulnerabilities' description: 'Number of vulnerabilities.'
field :day, GraphQL::Types::ISO8601Date, null: true, field :day, GraphQL::Types::ISO8601Date, null: true,
description: 'Date for the count' description: 'Date for the count.'
field :severity, VulnerabilitySeverityEnum, null: true, field :severity, VulnerabilitySeverityEnum, null: true,
description: 'Severity of the counted vulnerabilities' description: 'Severity of the counted vulnerabilities.'
end end
end end
...@@ -7,10 +7,10 @@ module Types ...@@ -7,10 +7,10 @@ module Types
description 'Represents the count of vulnerabilities by severity on a particular day. This data is retained for 365 days' description 'Represents the count of vulnerabilities by severity on a particular day. This data is retained for 365 days'
field :date, GraphQL::Types::ISO8601Date, null: false, field :date, GraphQL::Types::ISO8601Date, null: false,
description: 'Date for the count' description: 'Date for the count.'
field :total, GraphQL::INT_TYPE, null: false, field :total, GraphQL::INT_TYPE, null: false,
description: 'Total number of vulnerabilities on a particular day' description: 'Total number of vulnerabilities on a particular day.'
::Enums::Vulnerability.severity_levels.keys.each do |severity| ::Enums::Vulnerability.severity_levels.keys.each do |severity|
field severity.to_s, GraphQL::INT_TYPE, null: false, field severity.to_s, GraphQL::INT_TYPE, null: false,
......
...@@ -9,13 +9,13 @@ module Types ...@@ -9,13 +9,13 @@ module Types
authorize :read_vulnerability authorize :read_vulnerability
field :id, GlobalIDType[::Vulnerabilities::ExternalIssueLink], null: false, field :id, GlobalIDType[::Vulnerabilities::ExternalIssueLink], null: false,
description: 'GraphQL ID of the external issue link' description: 'GraphQL ID of the external issue link.'
field :link_type, ::Types::Vulnerability::ExternalIssueLinkTypeEnum, null: false, field :link_type, ::Types::Vulnerability::ExternalIssueLinkTypeEnum, null: false,
description: 'Type of the external issue link' description: 'Type of the external issue link.'
field :external_issue, ::Types::ExternalIssueType, null: true, field :external_issue, ::Types::ExternalIssueType, null: true,
description: 'The external issue attached to the issue link', description: 'The external issue attached to the issue link.',
resolver: Resolvers::ExternalIssueResolver resolver: Resolvers::ExternalIssueResolver
end end
end end
......
...@@ -8,13 +8,13 @@ module Types ...@@ -8,13 +8,13 @@ module Types
description 'Represents an issue link of a vulnerability' description 'Represents an issue link of a vulnerability'
field :id, GraphQL::ID_TYPE, null: false, field :id, GraphQL::ID_TYPE, null: false,
description: 'GraphQL ID of the vulnerability' description: 'GraphQL ID of the vulnerability.'
field :link_type, ::Types::Vulnerability::IssueLinkTypeEnum, null: false, field :link_type, ::Types::Vulnerability::IssueLinkTypeEnum, null: false,
description: "Type of the issue link" description: "Type of the issue link."
field :issue, ::Types::IssueType, null: false, field :issue, ::Types::IssueType, null: false,
description: 'The issue attached to issue link' description: 'The issue attached to issue link.'
end end
# rubocop: enable Graphql/AuthorizeTypes # rubocop: enable Graphql/AuthorizeTypes
end end
......
...@@ -7,16 +7,16 @@ module Types ...@@ -7,16 +7,16 @@ module Types
description 'Represents a vulnerability identifier' description 'Represents a vulnerability identifier'
field :name, GraphQL::STRING_TYPE, null: true, field :name, GraphQL::STRING_TYPE, null: true,
description: 'Name of the vulnerability identifier' description: 'Name of the vulnerability identifier.'
field :url, GraphQL::STRING_TYPE, null: true, field :url, GraphQL::STRING_TYPE, null: true,
description: 'URL of the vulnerability identifier' description: 'URL of the vulnerability identifier.'
field :external_type, GraphQL::STRING_TYPE, null: true, field :external_type, GraphQL::STRING_TYPE, null: true,
description: 'External type of the vulnerability identifier' description: 'External type of the vulnerability identifier.'
field :external_id, GraphQL::STRING_TYPE, null: true, field :external_id, GraphQL::STRING_TYPE, null: true,
description: 'External ID of the vulnerability identifier' description: 'External ID of the vulnerability identifier.'
end end
# rubocop: enable Graphql/AuthorizeTypes # rubocop: enable Graphql/AuthorizeTypes
end end
...@@ -8,13 +8,13 @@ module Types ...@@ -8,13 +8,13 @@ module Types
description 'Represents the location of a vulnerability found by a container security scan' description 'Represents the location of a vulnerability found by a container security scan'
field :dependency, ::Types::VulnerableDependencyType, null: true, field :dependency, ::Types::VulnerableDependencyType, null: true,
description: 'Dependency containing the vulnerability' description: 'Dependency containing the vulnerability.'
field :image, GraphQL::STRING_TYPE, null: true, field :image, GraphQL::STRING_TYPE, null: true,
description: 'Name of the vulnerable container image' description: 'Name of the vulnerable container image.'
field :operating_system, GraphQL::STRING_TYPE, null: true, field :operating_system, GraphQL::STRING_TYPE, null: true,
description: 'Operating system that runs on the vulnerable container image' description: 'Operating system that runs on the vulnerable container image.'
end end
end end
end end
...@@ -8,24 +8,24 @@ module Types ...@@ -8,24 +8,24 @@ module Types
description 'Represents the location of a vulnerability found by a Coverage Fuzzing scan' description 'Represents the location of a vulnerability found by a Coverage Fuzzing scan'
field :vulnerable_class, GraphQL::STRING_TYPE, null: true, field :vulnerable_class, GraphQL::STRING_TYPE, null: true,
description: 'Class containing the vulnerability', description: 'Class containing the vulnerability.',
hash_key: :class hash_key: :class
field :end_line, GraphQL::STRING_TYPE, null: true, field :end_line, GraphQL::STRING_TYPE, null: true,
description: 'Number of the last relevant line in the vulnerable file' description: 'Number of the last relevant line in the vulnerable file.'
field :file, GraphQL::STRING_TYPE, null: true, field :file, GraphQL::STRING_TYPE, null: true,
description: 'Path to the vulnerable file' description: 'Path to the vulnerable file.'
field :vulnerable_method, GraphQL::STRING_TYPE, null: true, field :vulnerable_method, GraphQL::STRING_TYPE, null: true,
description: 'Method containing the vulnerability', description: 'Method containing the vulnerability.',
hash_key: :method hash_key: :method
field :start_line, GraphQL::STRING_TYPE, null: true, field :start_line, GraphQL::STRING_TYPE, null: true,
description: 'Number of the first relevant line in the vulnerable file' description: 'Number of the first relevant line in the vulnerable file.'
field :blob_path, GraphQL::STRING_TYPE, null: true, field :blob_path, GraphQL::STRING_TYPE, null: true,
description: 'Blob path to the vulnerable file' description: 'Blob path to the vulnerable file.'
end end
end end
end end
...@@ -8,16 +8,16 @@ module Types ...@@ -8,16 +8,16 @@ module Types
description 'Represents the location of a vulnerability found by a DAST scan' description 'Represents the location of a vulnerability found by a DAST scan'
field :hostname, GraphQL::STRING_TYPE, null: true, field :hostname, GraphQL::STRING_TYPE, null: true,
description: 'Domain name of the vulnerable request' description: 'Domain name of the vulnerable request.'
field :param, GraphQL::STRING_TYPE, null: true, field :param, GraphQL::STRING_TYPE, null: true,
description: 'Query parameter for the URL on which the vulnerability occurred' description: 'Query parameter for the URL on which the vulnerability occurred.'
field :path, GraphQL::STRING_TYPE, null: true, field :path, GraphQL::STRING_TYPE, null: true,
description: 'URL path and query string of the vulnerable request' description: 'URL path and query string of the vulnerable request.'
field :request_method, GraphQL::STRING_TYPE, null: true, field :request_method, GraphQL::STRING_TYPE, null: true,
description: 'HTTP method of the vulnerable request' description: 'HTTP method of the vulnerable request.'
end end
end end
end end
...@@ -8,13 +8,13 @@ module Types ...@@ -8,13 +8,13 @@ module Types
description 'Represents the location of a vulnerability found by a dependency security scan' description 'Represents the location of a vulnerability found by a dependency security scan'
field :dependency, ::Types::VulnerableDependencyType, null: true, field :dependency, ::Types::VulnerableDependencyType, null: true,
description: 'Dependency containing the vulnerability' description: 'Dependency containing the vulnerability.'
field :file, GraphQL::STRING_TYPE, null: true, field :file, GraphQL::STRING_TYPE, null: true,
description: 'Path to the vulnerable file' description: 'Path to the vulnerable file.'
field :blob_path, GraphQL::STRING_TYPE, null: true, field :blob_path, GraphQL::STRING_TYPE, null: true,
description: 'Blob path to the vulnerable file' description: 'Blob path to the vulnerable file.'
end end
end end
end end
...@@ -8,24 +8,24 @@ module Types ...@@ -8,24 +8,24 @@ module Types
description 'Represents the location of a vulnerability found by a SAST scan' description 'Represents the location of a vulnerability found by a SAST scan'
field :vulnerable_class, GraphQL::STRING_TYPE, null: true, field :vulnerable_class, GraphQL::STRING_TYPE, null: true,
description: 'Class containing the vulnerability', description: 'Class containing the vulnerability.',
hash_key: :class hash_key: :class
field :end_line, GraphQL::STRING_TYPE, null: true, field :end_line, GraphQL::STRING_TYPE, null: true,
description: 'Number of the last relevant line in the vulnerable file' description: 'Number of the last relevant line in the vulnerable file.'
field :file, GraphQL::STRING_TYPE, null: true, field :file, GraphQL::STRING_TYPE, null: true,
description: 'Path to the vulnerable file' description: 'Path to the vulnerable file.'
field :vulnerable_method, GraphQL::STRING_TYPE, null: true, field :vulnerable_method, GraphQL::STRING_TYPE, null: true,
description: 'Method containing the vulnerability', description: 'Method containing the vulnerability.',
hash_key: :method hash_key: :method
field :start_line, GraphQL::STRING_TYPE, null: true, field :start_line, GraphQL::STRING_TYPE, null: true,
description: 'Number of the first relevant line in the vulnerable file' description: 'Number of the first relevant line in the vulnerable file.'
field :blob_path, GraphQL::STRING_TYPE, null: true, field :blob_path, GraphQL::STRING_TYPE, null: true,
description: 'Blob path to the vulnerable file' description: 'Blob path to the vulnerable file.'
end end
end end
end end
...@@ -8,24 +8,24 @@ module Types ...@@ -8,24 +8,24 @@ module Types
description 'Represents the location of a vulnerability found by a secret detection scan' description 'Represents the location of a vulnerability found by a secret detection scan'
field :vulnerable_class, GraphQL::STRING_TYPE, null: true, field :vulnerable_class, GraphQL::STRING_TYPE, null: true,
description: 'Class containing the vulnerability', description: 'Class containing the vulnerability.',
hash_key: :class hash_key: :class
field :end_line, GraphQL::STRING_TYPE, null: true, field :end_line, GraphQL::STRING_TYPE, null: true,
description: 'Number of the last relevant line in the vulnerable file' description: 'Number of the last relevant line in the vulnerable file.'
field :file, GraphQL::STRING_TYPE, null: true, field :file, GraphQL::STRING_TYPE, null: true,
description: 'Path to the vulnerable file' description: 'Path to the vulnerable file.'
field :vulnerable_method, GraphQL::STRING_TYPE, null: true, field :vulnerable_method, GraphQL::STRING_TYPE, null: true,
description: 'Method containing the vulnerability', description: 'Method containing the vulnerability.',
hash_key: :method hash_key: :method
field :start_line, GraphQL::STRING_TYPE, null: true, field :start_line, GraphQL::STRING_TYPE, null: true,
description: 'Number of the first relevant line in the vulnerable file' description: 'Number of the first relevant line in the vulnerable file.'
field :blob_path, GraphQL::STRING_TYPE, null: true, field :blob_path, GraphQL::STRING_TYPE, null: true,
description: 'Blob path to the vulnerable file' description: 'Blob path to the vulnerable file.'
end end
end end
end end
...@@ -8,15 +8,15 @@ module Types ...@@ -8,15 +8,15 @@ module Types
authorize :read_vulnerability_scanner authorize :read_vulnerability_scanner
field :name, GraphQL::STRING_TYPE, null: true, field :name, GraphQL::STRING_TYPE, null: true,
description: 'Name of the vulnerability scanner' description: 'Name of the vulnerability scanner.'
field :external_id, GraphQL::STRING_TYPE, null: true, field :external_id, GraphQL::STRING_TYPE, null: true,
description: 'External ID of the vulnerability scanner' description: 'External ID of the vulnerability scanner.'
field :vendor, GraphQL::STRING_TYPE, null: true, field :vendor, GraphQL::STRING_TYPE, null: true,
description: 'Vendor of the vulnerability scanner' description: 'Vendor of the vulnerability scanner.'
field :report_type, VulnerabilityReportTypeEnum, null: true, field :report_type, VulnerabilityReportTypeEnum, null: true,
description: 'Type of the vulnerability report' description: 'Type of the vulnerability report.'
end end
end end
...@@ -12,13 +12,13 @@ module Types ...@@ -12,13 +12,13 @@ module Types
expose_permissions Types::PermissionTypes::Vulnerability expose_permissions Types::PermissionTypes::Vulnerability
field :id, GraphQL::ID_TYPE, null: false, field :id, GraphQL::ID_TYPE, null: false,
description: 'GraphQL ID of the vulnerability' description: 'GraphQL ID of the vulnerability.'
field :title, GraphQL::STRING_TYPE, null: true, field :title, GraphQL::STRING_TYPE, null: true,
description: 'Title of the vulnerability' description: 'Title of the vulnerability.'
field :description, GraphQL::STRING_TYPE, null: true, field :description, GraphQL::STRING_TYPE, null: true,
description: 'Description of the vulnerability' description: 'Description of the vulnerability.'
field :state, VulnerabilityStateEnum, null: true, field :state, VulnerabilityStateEnum, null: true,
description: "State of the vulnerability (#{::Vulnerability.states.keys.join(', ').upcase})" description: "State of the vulnerability (#{::Vulnerability.states.keys.join(', ').upcase})"
...@@ -30,23 +30,23 @@ module Types ...@@ -30,23 +30,23 @@ module Types
description: "Type of the security report that found the vulnerability (#{::Enums::Vulnerability.report_types.keys.join(', ').upcase})" description: "Type of the security report that found the vulnerability (#{::Enums::Vulnerability.report_types.keys.join(', ').upcase})"
field :resolved_on_default_branch, GraphQL::BOOLEAN_TYPE, null: false, field :resolved_on_default_branch, GraphQL::BOOLEAN_TYPE, null: false,
description: "Indicates whether the vulnerability is fixed on the default branch or not" description: "Indicates whether the vulnerability is fixed on the default branch or not."
field :user_notes_count, GraphQL::INT_TYPE, null: false, field :user_notes_count, GraphQL::INT_TYPE, null: false,
description: 'Number of user notes attached to the vulnerability' description: 'Number of user notes attached to the vulnerability.'
field :vulnerability_path, GraphQL::STRING_TYPE, null: true, field :vulnerability_path, GraphQL::STRING_TYPE, null: true,
description: "URL to the vulnerability's details page" description: "URL to the vulnerability's details page."
field :issue_links, ::Types::Vulnerability::IssueLinkType.connection_type, null: false, field :issue_links, ::Types::Vulnerability::IssueLinkType.connection_type, null: false,
description: "List of issue links related to the vulnerability", description: "List of issue links related to the vulnerability.",
resolver: Resolvers::Vulnerabilities::IssueLinksResolver resolver: Resolvers::Vulnerabilities::IssueLinksResolver
field :external_issue_links, ::Types::Vulnerability::ExternalIssueLinkType.connection_type, null: false, field :external_issue_links, ::Types::Vulnerability::ExternalIssueLinkType.connection_type, null: false,
description: 'List of external issue links related to the vulnerability' description: 'List of external issue links related to the vulnerability.'
field :location, VulnerabilityLocationType, null: true, field :location, VulnerabilityLocationType, null: true,
description: 'Location metadata for the vulnerability. Its fields depend on the type of security scan that found the vulnerability' description: 'Location metadata for the vulnerability. Its fields depend on the type of security scan that found the vulnerability.'
field :scanner, VulnerabilityScannerType, null: true, field :scanner, VulnerabilityScannerType, null: true,
description: 'Scanner metadata for the vulnerability.' description: 'Scanner metadata for the vulnerability.'
...@@ -58,21 +58,21 @@ module Types ...@@ -58,21 +58,21 @@ module Types
description: 'Identifiers of the vulnerability.' description: 'Identifiers of the vulnerability.'
field :project, ::Types::ProjectType, null: true, field :project, ::Types::ProjectType, null: true,
description: 'The project on which the vulnerability was found', description: 'The project on which the vulnerability was found.',
authorize: :read_project authorize: :read_project
field :detected_at, Types::TimeType, null: false, field :detected_at, Types::TimeType, null: false,
description: 'Timestamp of when the vulnerability was first detected', description: 'Timestamp of when the vulnerability was first detected.',
method: :created_at method: :created_at
field :confirmed_at, Types::TimeType, null: true, field :confirmed_at, Types::TimeType, null: true,
description: 'Timestamp of when the vulnerability state was changed to confirmed' description: 'Timestamp of when the vulnerability state was changed to confirmed.'
field :resolved_at, Types::TimeType, null: true, field :resolved_at, Types::TimeType, null: true,
description: 'Timestamp of when the vulnerability state was changed to resolved' description: 'Timestamp of when the vulnerability state was changed to resolved.'
field :dismissed_at, Types::TimeType, null: true, field :dismissed_at, Types::TimeType, null: true,
description: 'Timestamp of when the vulnerability state was changed to dismissed' description: 'Timestamp of when the vulnerability state was changed to dismissed.'
field :has_solutions, GraphQL::BOOLEAN_TYPE, null: true, field :has_solutions, GraphQL::BOOLEAN_TYPE, null: true,
description: 'Indicates whether there is a solution available for this vulnerability.', description: 'Indicates whether there is a solution available for this vulnerability.',
...@@ -91,7 +91,7 @@ module Types ...@@ -91,7 +91,7 @@ module Types
description: 'The user that dismissed the vulnerability.' description: 'The user that dismissed the vulnerability.'
field :details, [VulnerabilityDetailType], null: false, field :details, [VulnerabilityDetailType], null: false,
description: 'Details of the vulnerability', description: 'Details of the vulnerability.',
resolver: Resolvers::Vulnerabilities::DetailsResolver resolver: Resolvers::Vulnerabilities::DetailsResolver
def confirmed_by def confirmed_by
......
...@@ -7,9 +7,9 @@ module Types ...@@ -7,9 +7,9 @@ module Types
description 'Represents a vulnerable dependency. Used in vulnerability location data' description 'Represents a vulnerable dependency. Used in vulnerability location data'
field :package, ::Types::VulnerablePackageType, null: true, field :package, ::Types::VulnerablePackageType, null: true,
description: 'The package associated with the vulnerable dependency' description: 'The package associated with the vulnerable dependency.'
field :version, GraphQL::STRING_TYPE, null: true, field :version, GraphQL::STRING_TYPE, null: true,
description: 'The version of the vulnerable dependency' description: 'The version of the vulnerable dependency.'
end end
end end
...@@ -7,6 +7,6 @@ module Types ...@@ -7,6 +7,6 @@ module Types
description 'Represents a vulnerable package. Used in vulnerability dependency data' description 'Represents a vulnerable package. Used in vulnerability dependency data'
field :name, GraphQL::STRING_TYPE, null: true, field :name, GraphQL::STRING_TYPE, null: true,
description: 'The name of the vulnerable package' description: 'The name of the vulnerable package.'
end end
end end
...@@ -7,14 +7,14 @@ module Types ...@@ -7,14 +7,14 @@ module Types
description 'Represents vulnerability letter grades with associated projects' description 'Represents vulnerability letter grades with associated projects'
field :grade, Types::VulnerabilityGradeEnum, null: false, field :grade, Types::VulnerabilityGradeEnum, null: false,
description: "Grade based on the highest severity vulnerability present" description: "Grade based on the highest severity vulnerability present."
field :count, GraphQL::INT_TYPE, null: false, field :count, GraphQL::INT_TYPE, null: false,
description: 'Number of projects within this grade', description: 'Number of projects within this grade.',
complexity: 5 complexity: 5
field :projects, Types::ProjectType.connection_type, null: false, field :projects, Types::ProjectType.connection_type, null: false,
description: 'Projects within this grade', description: 'Projects within this grade.',
complexity: 5 complexity: 5
end end
# rubocop: enable Graphql/AuthorizeTypes # rubocop: enable Graphql/AuthorizeTypes
......
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