Commit 790ba9fa authored by Igor Drozdov's avatar Igor Drozdov

Merge branch '292426-fix-graphql-descriptions-rubocop-offenses-4' into 'master'

Fix Graphql/Descriptions EE resolver offenses

See merge request gitlab-org/gitlab!51550
parents 1bf93ec5 fe98f111
...@@ -881,8 +881,6 @@ Graphql/Descriptions: ...@@ -881,8 +881,6 @@ Graphql/Descriptions:
- 'app/graphql/types/tree/tree_type.rb' - 'app/graphql/types/tree/tree_type.rb'
- 'app/graphql/types/user_status_type.rb' - 'app/graphql/types/user_status_type.rb'
- 'app/graphql/types/user_type.rb' - 'app/graphql/types/user_type.rb'
- 'ee/app/graphql/ee/resolvers/issues_resolver.rb'
- 'ee/app/graphql/ee/resolvers/namespace_projects_resolver.rb'
- 'ee/app/graphql/ee/types/board_list_type.rb' - 'ee/app/graphql/ee/types/board_list_type.rb'
- 'ee/app/graphql/ee/types/board_type.rb' - 'ee/app/graphql/ee/types/board_type.rb'
- 'ee/app/graphql/ee/types/boards/board_issue_input_base_type.rb' - 'ee/app/graphql/ee/types/boards/board_issue_input_base_type.rb'
...@@ -894,23 +892,6 @@ Graphql/Descriptions: ...@@ -894,23 +892,6 @@ Graphql/Descriptions:
- 'ee/app/graphql/ee/types/namespace_type.rb' - 'ee/app/graphql/ee/types/namespace_type.rb'
- 'ee/app/graphql/ee/types/project_type.rb' - 'ee/app/graphql/ee/types/project_type.rb'
- 'ee/app/graphql/ee/types/query_type.rb' - 'ee/app/graphql/ee/types/query_type.rb'
- 'ee/app/graphql/resolvers/board_groupings/epics_resolver.rb'
- 'ee/app/graphql/resolvers/boards/epic_boards_resolver.rb'
- 'ee/app/graphql/resolvers/ci/code_coverage_activities_resolver.rb'
- 'ee/app/graphql/resolvers/clusters/agents_resolver.rb'
- 'ee/app/graphql/resolvers/dast_site_profile_resolver.rb'
- 'ee/app/graphql/resolvers/dast_site_validation_resolver.rb'
- 'ee/app/graphql/resolvers/epics_resolver.rb'
- 'ee/app/graphql/resolvers/geo/registries_resolver.rb'
- 'ee/app/graphql/resolvers/requirements_management/requirements_resolver.rb'
- 'ee/app/graphql/resolvers/requirements_management/test_reports_resolver.rb'
- 'ee/app/graphql/resolvers/timelog_resolver.rb'
- 'ee/app/graphql/resolvers/vulnerabilities/issue_links_resolver.rb'
- 'ee/app/graphql/resolvers/vulnerabilities_count_per_day_resolver.rb'
- 'ee/app/graphql/resolvers/vulnerabilities_grade_resolver.rb'
- 'ee/app/graphql/resolvers/vulnerabilities_history_resolver.rb'
- 'ee/app/graphql/resolvers/vulnerabilities_resolver.rb'
- 'ee/app/graphql/resolvers/vulnerability_severities_count_resolver.rb'
- 'ee/app/graphql/types/admin/analytics/devops_adoption/segment_type.rb' - 'ee/app/graphql/types/admin/analytics/devops_adoption/segment_type.rb'
- 'ee/app/graphql/types/admin/analytics/devops_adoption/snapshot_type.rb' - 'ee/app/graphql/types/admin/analytics/devops_adoption/snapshot_type.rb'
- 'ee/app/graphql/types/boards/board_epic_type.rb' - 'ee/app/graphql/types/boards/board_epic_type.rb'
......
...@@ -9,11 +9,11 @@ module EE ...@@ -9,11 +9,11 @@ module EE
prepended do prepended do
argument :iteration_id, ::GraphQL::ID_TYPE.to_list_type, argument :iteration_id, ::GraphQL::ID_TYPE.to_list_type,
required: false, required: false,
description: 'Iterations applied to the issue' description: 'Iterations applied to the issue.'
argument :epic_id, GraphQL::STRING_TYPE, argument :epic_id, GraphQL::STRING_TYPE,
required: false, required: false,
description: 'ID of an epic associated with the issues, "none" and "any" values are supported' description: 'ID of an epic associated with the issues, "none" and "any" values are supported.'
end end
private private
......
...@@ -9,7 +9,7 @@ module EE ...@@ -9,7 +9,7 @@ module EE
argument :has_vulnerabilities, GraphQL::BOOLEAN_TYPE, argument :has_vulnerabilities, GraphQL::BOOLEAN_TYPE,
required: false, required: false,
default_value: false, default_value: false,
description: 'Returns only the projects which have vulnerabilities' description: 'Returns only the projects which have vulnerabilities.'
end end
def resolve(include_subgroups:, search:, sort:, has_vulnerabilities: false) def resolve(include_subgroups:, search:, sort:, has_vulnerabilities: false)
......
...@@ -9,7 +9,7 @@ module Resolvers ...@@ -9,7 +9,7 @@ module Resolvers
argument :issue_filters, Types::Boards::BoardIssueInputType, argument :issue_filters, Types::Boards::BoardIssueInputType,
required: false, required: false,
description: 'Filters applied when selecting issues on the board' description: 'Filters applied when selecting issues on the board.'
type Types::Boards::BoardEpicType, null: true type Types::Boards::BoardEpicType, null: true
......
...@@ -10,7 +10,7 @@ module Resolvers ...@@ -10,7 +10,7 @@ module Resolvers
when_single do when_single do
argument :id, ::Types::GlobalIDType[::Boards::EpicBoard], argument :id, ::Types::GlobalIDType[::Boards::EpicBoard],
required: true, required: true,
description: 'Find an epic board by ID' description: 'Find an epic board by ID.'
end end
alias_method :group, :object alias_method :group, :object
......
...@@ -7,7 +7,7 @@ module Resolvers ...@@ -7,7 +7,7 @@ module Resolvers
argument :start_date, Types::DateType, argument :start_date, Types::DateType,
required: true, required: true,
description: 'First day for which to fetch code coverage activity (maximum time window is set to 90 days)' description: 'First day for which to fetch code coverage activity (maximum time window is set to 90 days).'
alias_method :group, :object alias_method :group, :object
......
...@@ -12,7 +12,7 @@ module Resolvers ...@@ -12,7 +12,7 @@ module Resolvers
when_single do when_single do
argument :name, GraphQL::STRING_TYPE, argument :name, GraphQL::STRING_TYPE,
required: true, required: true,
description: 'Name of the cluster agent' description: 'Name of the cluster agent.'
end end
alias_method :project, :object alias_method :project, :object
......
...@@ -8,7 +8,7 @@ module Resolvers ...@@ -8,7 +8,7 @@ module Resolvers
when_single do when_single do
argument :id, ::Types::GlobalIDType[::DastSiteProfile], required: true, argument :id, ::Types::GlobalIDType[::DastSiteProfile], required: true,
description: "ID of the site profile" description: "ID of the site profile."
end end
def resolve(**args) def resolve(**args)
......
...@@ -7,7 +7,7 @@ module Resolvers ...@@ -7,7 +7,7 @@ module Resolvers
type Types::DastSiteValidationType.connection_type, null: true type Types::DastSiteValidationType.connection_type, null: true
argument :normalized_target_urls, [GraphQL::STRING_TYPE], required: false, argument :normalized_target_urls, [GraphQL::STRING_TYPE], required: false,
description: 'Normalized URL of the target to be scanned' description: 'Normalized URL of the target to be scanned.'
def resolve(**args) def resolve(**args)
return DastSiteValidation.none unless allowed? return DastSiteValidation.none unless allowed?
......
...@@ -7,48 +7,48 @@ module Resolvers ...@@ -7,48 +7,48 @@ module Resolvers
argument :iid, GraphQL::ID_TYPE, argument :iid, GraphQL::ID_TYPE,
required: false, required: false,
description: 'IID of the epic, e.g., "1"' description: 'IID of the epic, e.g., "1".'
argument :iids, [GraphQL::ID_TYPE], argument :iids, [GraphQL::ID_TYPE],
required: false, required: false,
description: 'List of IIDs of epics, e.g., [1, 2]' description: 'List of IIDs of epics, e.g., [1, 2].'
argument :state, Types::EpicStateEnum, argument :state, Types::EpicStateEnum,
required: false, required: false,
description: 'Filter epics by state' description: 'Filter epics by state.'
argument :search, GraphQL::STRING_TYPE, argument :search, GraphQL::STRING_TYPE,
required: false, required: false,
description: 'Search query for epic title or description' description: 'Search query for epic title or description.'
argument :sort, Types::EpicSortEnum, argument :sort, Types::EpicSortEnum,
required: false, required: false,
description: 'List epics by sort order' description: 'List epics by sort order.'
argument :author_username, GraphQL::STRING_TYPE, argument :author_username, GraphQL::STRING_TYPE,
required: false, required: false,
description: 'Filter epics by author' description: 'Filter epics by author.'
argument :label_name, [GraphQL::STRING_TYPE], argument :label_name, [GraphQL::STRING_TYPE],
required: false, required: false,
description: 'Filter epics by labels' description: 'Filter epics by labels.'
argument :milestone_title, GraphQL::STRING_TYPE, argument :milestone_title, GraphQL::STRING_TYPE,
required: false, required: false,
description: "Filter epics by milestone title, computed from epic's issues" description: "Filter epics by milestone title, computed from epic's issues."
argument :iid_starts_with, GraphQL::STRING_TYPE, argument :iid_starts_with, GraphQL::STRING_TYPE,
required: false, required: false,
description: 'Filter epics by IID for autocomplete' description: 'Filter epics by IID for autocomplete.'
argument :include_descendant_groups, GraphQL::BOOLEAN_TYPE, argument :include_descendant_groups, GraphQL::BOOLEAN_TYPE,
required: false, required: false,
description: 'Include epics from descendant groups', description: 'Include epics from descendant groups.',
default_value: true default_value: true
argument :confidential, GraphQL::BOOLEAN_TYPE, argument :confidential, GraphQL::BOOLEAN_TYPE,
required: false, required: false,
description: 'Filter epics by given confidentiality' description: 'Filter epics by given confidentiality.'
type Types::EpicType, null: true type Types::EpicType, null: true
......
...@@ -17,7 +17,7 @@ module Resolvers ...@@ -17,7 +17,7 @@ module Resolvers
argument :ids, argument :ids,
[GraphQL::ID_TYPE], [GraphQL::ID_TYPE],
required: false, required: false,
description: 'Filters registries by their ID' description: 'Filters registries by their ID.'
def resolve(ids: nil) def resolve(ids: nil)
return registry_class.none unless geo_node_is_current? return registry_class.none unless geo_node_is_current?
......
...@@ -10,11 +10,11 @@ module Resolvers ...@@ -10,11 +10,11 @@ module Resolvers
argument :iid, GraphQL::ID_TYPE, argument :iid, GraphQL::ID_TYPE,
required: false, required: false,
description: 'IID of the requirement, e.g., "1"' description: 'IID of the requirement, e.g., "1".'
argument :iids, [GraphQL::ID_TYPE], argument :iids, [GraphQL::ID_TYPE],
required: false, required: false,
description: 'List of IIDs of requirements, e.g., [1, 2]' description: 'List of IIDs of requirements, e.g., [1, 2].'
def resolve_with_lookahead(**args) def resolve_with_lookahead(**args)
# The project could have been loaded in batch by `BatchLoader`. # The project could have been loaded in batch by `BatchLoader`.
......
...@@ -5,7 +5,7 @@ module Resolvers ...@@ -5,7 +5,7 @@ module Resolvers
class TestReportsResolver < BaseResolver class TestReportsResolver < BaseResolver
argument :sort, Types::SortEnum, argument :sort, Types::SortEnum,
required: false, required: false,
description: 'List test reports by sort order' description: 'List test reports by sort order.'
type Types::RequirementsManagement::TestReportType, null: true type Types::RequirementsManagement::TestReportType, null: true
......
...@@ -8,19 +8,19 @@ module Resolvers ...@@ -8,19 +8,19 @@ module Resolvers
argument :start_date, Types::TimeType, argument :start_date, Types::TimeType,
required: false, required: false,
description: 'List time logs within a date range where the logged date is equal to or after startDate' description: 'List time logs within a date range where the logged date is equal to or after startDate.'
argument :end_date, Types::TimeType, argument :end_date, Types::TimeType,
required: false, required: false,
description: 'List time logs within a date range where the logged date is equal to or before endDate' description: 'List time logs within a date range where the logged date is equal to or before endDate.'
argument :start_time, Types::TimeType, argument :start_time, Types::TimeType,
required: false, required: false,
description: 'List time-logs within a time range where the logged time is equal to or after startTime' description: 'List time-logs within a time range where the logged time is equal to or after startTime.'
argument :end_time, Types::TimeType, argument :end_time, Types::TimeType,
required: false, required: false,
description: 'List time-logs within a time range where the logged time is equal to or before endTime' description: 'List time-logs within a time range where the logged time is equal to or before endTime.'
def resolve_with_lookahead(**args) def resolve_with_lookahead(**args)
return Timelog.none unless timelogs_available_for_user? return Timelog.none unless timelogs_available_for_user?
......
...@@ -7,7 +7,7 @@ module Resolvers ...@@ -7,7 +7,7 @@ module Resolvers
argument :link_type, Types::Vulnerability::IssueLinkTypeEnum, argument :link_type, Types::Vulnerability::IssueLinkTypeEnum,
required: false, required: false,
description: 'Filter issue links by link type' description: 'Filter issue links by link type.'
delegate :issue_links, :created_issue_links, to: :object, private: true delegate :issue_links, :created_issue_links, to: :object, private: true
......
...@@ -5,10 +5,10 @@ module Resolvers ...@@ -5,10 +5,10 @@ module Resolvers
type Types::VulnerabilitiesCountByDayType, null: true type Types::VulnerabilitiesCountByDayType, null: true
argument :start_date, GraphQL::Types::ISO8601Date, required: true, argument :start_date, GraphQL::Types::ISO8601Date, required: true,
description: 'First day for which to fetch vulnerability history' description: 'First day for which to fetch vulnerability history.'
argument :end_date, GraphQL::Types::ISO8601Date, required: true, argument :end_date, GraphQL::Types::ISO8601Date, required: true,
description: 'Last day for which to fetch vulnerability history' description: 'Last day for which to fetch vulnerability history.'
def resolve(**args) def resolve(**args)
return [] unless vulnerable return [] unless vulnerable
......
...@@ -7,7 +7,7 @@ module Resolvers ...@@ -7,7 +7,7 @@ module Resolvers
argument :include_subgroups, GraphQL::BOOLEAN_TYPE, argument :include_subgroups, GraphQL::BOOLEAN_TYPE,
required: false, required: false,
default_value: false, default_value: false,
description: 'Include grades belonging to subgroups' description: 'Include grades belonging to subgroups.'
def resolve(**args) def resolve(**args)
::Gitlab::Graphql::Aggregations::VulnerabilityStatistics::LazyAggregate ::Gitlab::Graphql::Aggregations::VulnerabilityStatistics::LazyAggregate
......
...@@ -9,10 +9,10 @@ module Resolvers ...@@ -9,10 +9,10 @@ module Resolvers
type Types::VulnerabilitiesCountByDayAndSeverityType, null: true type Types::VulnerabilitiesCountByDayAndSeverityType, null: true
argument :start_date, GraphQL::Types::ISO8601Date, required: true, argument :start_date, GraphQL::Types::ISO8601Date, required: true,
description: 'First day for which to fetch vulnerability history' description: 'First day for which to fetch vulnerability history.'
argument :end_date, GraphQL::Types::ISO8601Date, required: true, argument :end_date, GraphQL::Types::ISO8601Date, required: true,
description: 'Last day for which to fetch vulnerability history' description: 'Last day for which to fetch vulnerability history.'
def resolve(**args) def resolve(**args)
return [] unless vulnerable return [] unless vulnerable
......
...@@ -8,36 +8,36 @@ module Resolvers ...@@ -8,36 +8,36 @@ module Resolvers
argument :project_id, [GraphQL::ID_TYPE], argument :project_id, [GraphQL::ID_TYPE],
required: false, required: false,
description: 'Filter vulnerabilities by project' description: 'Filter vulnerabilities by project.'
argument :report_type, [Types::VulnerabilityReportTypeEnum], argument :report_type, [Types::VulnerabilityReportTypeEnum],
required: false, required: false,
description: 'Filter vulnerabilities by report type' description: 'Filter vulnerabilities by report type.'
argument :severity, [Types::VulnerabilitySeverityEnum], argument :severity, [Types::VulnerabilitySeverityEnum],
required: false, required: false,
description: 'Filter vulnerabilities by severity' description: 'Filter vulnerabilities by severity.'
argument :state, [Types::VulnerabilityStateEnum], argument :state, [Types::VulnerabilityStateEnum],
required: false, required: false,
description: 'Filter vulnerabilities by state' description: 'Filter vulnerabilities by state.'
argument :scanner, [GraphQL::STRING_TYPE], argument :scanner, [GraphQL::STRING_TYPE],
required: false, required: false,
description: 'Filter vulnerabilities by VulnerabilityScanner.externalId' description: 'Filter vulnerabilities by VulnerabilityScanner.externalId.'
argument :sort, Types::VulnerabilitySortEnum, argument :sort, Types::VulnerabilitySortEnum,
required: false, required: false,
default_value: 'severity_desc', default_value: 'severity_desc',
description: 'List vulnerabilities by sort order' description: 'List vulnerabilities by sort order.'
argument :has_resolution, GraphQL::BOOLEAN_TYPE, argument :has_resolution, GraphQL::BOOLEAN_TYPE,
required: false, required: false,
description: 'Returns only the vulnerabilities which have been resolved on default branch' description: 'Returns only the vulnerabilities which have been resolved on default branch.'
argument :has_issues, GraphQL::BOOLEAN_TYPE, argument :has_issues, GraphQL::BOOLEAN_TYPE,
required: false, required: false,
description: 'Returns only the vulnerabilities which have linked issues' description: 'Returns only the vulnerabilities which have linked issues.'
def resolve(**args) def resolve(**args)
return Vulnerability.none unless vulnerable return Vulnerability.none unless vulnerable
......
...@@ -8,23 +8,23 @@ module Resolvers ...@@ -8,23 +8,23 @@ module Resolvers
argument :project_id, [GraphQL::ID_TYPE], argument :project_id, [GraphQL::ID_TYPE],
required: false, required: false,
description: 'Filter vulnerabilities by project' description: 'Filter vulnerabilities by project.'
argument :report_type, [Types::VulnerabilityReportTypeEnum], argument :report_type, [Types::VulnerabilityReportTypeEnum],
required: false, required: false,
description: 'Filter vulnerabilities by report type' description: 'Filter vulnerabilities by report type.'
argument :severity, [Types::VulnerabilitySeverityEnum], argument :severity, [Types::VulnerabilitySeverityEnum],
required: false, required: false,
description: 'Filter vulnerabilities by severity' description: 'Filter vulnerabilities by severity.'
argument :state, [Types::VulnerabilityStateEnum], argument :state, [Types::VulnerabilityStateEnum],
required: false, required: false,
description: 'Filter vulnerabilities by state' description: 'Filter vulnerabilities by state.'
argument :scanner, [GraphQL::STRING_TYPE], argument :scanner, [GraphQL::STRING_TYPE],
required: false, required: false,
description: 'Filter vulnerabilities by scanner' description: 'Filter vulnerabilities by scanner.'
def resolve(**args) def resolve(**args)
return Vulnerability.none unless vulnerable return Vulnerability.none unless vulnerable
......
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