Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
9af1b899
Commit
9af1b899
authored
Jul 20, 2021
by
Brett Walker
Committed by
Matthias Käppler
Jul 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New cop to enforce using new GraphQL types
instead of old ones
parent
c6282573
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
541 additions
and
0 deletions
+541
-0
.rubocop.yml
.rubocop.yml
+9
-0
.rubocop_manual_todo.yml
.rubocop_manual_todo.yml
+404
-0
rubocop/cop/graphql/old_types.rb
rubocop/cop/graphql/old_types.rb
+44
-0
spec/rubocop/cop/graphql/old_types_spec.rb
spec/rubocop/cop/graphql/old_types_spec.rb
+84
-0
No files found.
.rubocop.yml
View file @
9af1b899
...
...
@@ -442,6 +442,15 @@ Graphql/JSONType:
-
'
spec/**/*.rb'
-
'
ee/spec/**/*.rb'
Graphql/OldTypes
:
Enabled
:
true
Include
:
-
'
app/graphql/**/*'
-
'
ee/app/graphql/**/*'
Exclude
:
-
'
spec/**/*.rb'
-
'
ee/spec/**/*.rb'
RSpec/EnvAssignment
:
Enable
:
true
Include
:
...
...
.rubocop_manual_todo.yml
View file @
9af1b899
...
...
@@ -23,6 +23,410 @@ Graphql/Descriptions:
-
'
ee/app/graphql/types/vulnerability_severity_enum.rb'
-
'
ee/app/graphql/types/vulnerability_state_enum.rb'
# WIP See https://gitlab.com/gitlab-org/gitlab/-/issues/336292
Graphql/OldTypes
:
Exclude
:
-
'
spec/**/*.rb'
-
'
ee/spec/**/*.rb'
-
'
app/graphql/mutations/admin/sidekiq_queues/delete_jobs.rb'
-
'
app/graphql/mutations/alert_management/base.rb'
-
'
app/graphql/mutations/alert_management/http_integration/create.rb'
-
'
app/graphql/mutations/alert_management/http_integration/update.rb'
-
'
app/graphql/mutations/alert_management/prometheus_integration/create.rb'
-
'
app/graphql/mutations/alert_management/prometheus_integration/update.rb'
-
'
app/graphql/mutations/award_emojis/base.rb'
-
'
app/graphql/mutations/award_emojis/toggle.rb'
-
'
app/graphql/mutations/boards/common_mutation_arguments.rb'
-
'
app/graphql/mutations/boards/issues/issue_move_list.rb'
-
'
app/graphql/mutations/boards/lists/base_create.rb'
-
'
app/graphql/mutations/boards/lists/base_update.rb'
-
'
app/graphql/mutations/branches/create.rb'
-
'
app/graphql/mutations/ci/ci_cd_settings_update.rb'
-
'
app/graphql/mutations/ci/job_token_scope/add_project.rb'
-
'
app/graphql/mutations/ci/job_token_scope/remove_project.rb'
-
'
app/graphql/mutations/ci/runner/update.rb'
-
'
app/graphql/mutations/ci/runners_registration_token/reset.rb'
-
'
app/graphql/mutations/commits/create.rb'
-
'
app/graphql/mutations/concerns/mutations/can_mutate_spammable.rb'
-
'
app/graphql/mutations/concerns/mutations/resolves_resource_parent.rb'
-
'
app/graphql/mutations/concerns/mutations/resolves_subscription.rb'
-
'
app/graphql/mutations/container_expiration_policies/update.rb'
-
'
app/graphql/mutations/custom_emoji/create.rb'
-
'
app/graphql/mutations/design_management/base.rb'
-
'
app/graphql/mutations/discussions/toggle_resolve.rb'
-
'
app/graphql/mutations/environments/canary_ingress/update.rb'
-
'
app/graphql/mutations/issues/base.rb'
-
'
app/graphql/mutations/issues/common_mutation_arguments.rb'
-
'
app/graphql/mutations/issues/create.rb'
-
'
app/graphql/mutations/issues/move.rb'
-
'
app/graphql/mutations/issues/set_confidential.rb'
-
'
app/graphql/mutations/issues/set_locked.rb'
-
'
app/graphql/mutations/issues/set_subscription.rb'
-
'
app/graphql/mutations/issues/update.rb'
-
'
app/graphql/mutations/jira_import/import_users.rb'
-
'
app/graphql/mutations/jira_import/start.rb'
-
'
app/graphql/mutations/labels/create.rb'
-
'
app/graphql/mutations/merge_requests/base.rb'
-
'
app/graphql/mutations/merge_requests/create.rb'
-
'
app/graphql/mutations/merge_requests/set_draft.rb'
-
'
app/graphql/mutations/merge_requests/set_locked.rb'
-
'
app/graphql/mutations/merge_requests/set_subscription.rb'
-
'
app/graphql/mutations/merge_requests/set_wip.rb'
-
'
app/graphql/mutations/merge_requests/update.rb'
-
'
app/graphql/mutations/metrics/dashboard/annotations/create.rb'
-
'
app/graphql/mutations/namespace/package_settings/update.rb'
-
'
app/graphql/mutations/notes/create/base.rb'
-
'
app/graphql/mutations/notes/update/image_diff_note.rb'
-
'
app/graphql/mutations/notes/update/note.rb'
-
'
app/graphql/mutations/release_asset_links/create.rb'
-
'
app/graphql/mutations/release_asset_links/update.rb'
-
'
app/graphql/mutations/releases/base.rb'
-
'
app/graphql/mutations/releases/create.rb'
-
'
app/graphql/mutations/releases/delete.rb'
-
'
app/graphql/mutations/releases/update.rb'
-
'
app/graphql/mutations/security/ci_configuration/base_security_analyzer.rb'
-
'
app/graphql/mutations/security/ci_configuration/configure_sast.rb'
-
'
app/graphql/mutations/security/ci_configuration/configure_secret_detection.rb'
-
'
app/graphql/mutations/snippets/create.rb'
-
'
app/graphql/mutations/snippets/update.rb'
-
'
app/graphql/mutations/user_callouts/create.rb'
-
'
app/graphql/resolvers/alert_management/alert_resolver.rb'
-
'
app/graphql/resolvers/alert_management/alert_status_counts_resolver.rb'
-
'
app/graphql/resolvers/blobs_resolver.rb'
-
'
app/graphql/resolvers/ci/config_resolver.rb'
-
'
app/graphql/resolvers/ci/runners_resolver.rb'
-
'
app/graphql/resolvers/ci/template_resolver.rb'
-
'
app/graphql/resolvers/concerns/group_issuable_resolver.rb'
-
'
app/graphql/resolvers/concerns/issue_resolver_arguments.rb'
-
'
app/graphql/resolvers/concerns/resolves_pipelines.rb'
-
'
app/graphql/resolvers/container_repositories_resolver.rb'
-
'
app/graphql/resolvers/design_management/design_resolver.rb'
-
'
app/graphql/resolvers/design_management/version/design_at_version_resolver.rb'
-
'
app/graphql/resolvers/design_management/version_in_collection_resolver.rb'
-
'
app/graphql/resolvers/design_management/versions_resolver.rb'
-
'
app/graphql/resolvers/environments_resolver.rb'
-
'
app/graphql/resolvers/full_path_resolver.rb'
-
'
app/graphql/resolvers/group_labels_resolver.rb'
-
'
app/graphql/resolvers/group_milestones_resolver.rb'
-
'
app/graphql/resolvers/labels_resolver.rb'
-
'
app/graphql/resolvers/members_resolver.rb'
-
'
app/graphql/resolvers/merge_request_resolver.rb'
-
'
app/graphql/resolvers/merge_requests_resolver.rb'
-
'
app/graphql/resolvers/metrics/dashboard_resolver.rb'
-
'
app/graphql/resolvers/milestones_resolver.rb'
-
'
app/graphql/resolvers/namespace_projects_resolver.rb'
-
'
app/graphql/resolvers/packages_base_resolver.rb'
-
'
app/graphql/resolvers/project_milestones_resolver.rb'
-
'
app/graphql/resolvers/project_pipeline_resolver.rb'
-
'
app/graphql/resolvers/projects/jira_projects_resolver.rb'
-
'
app/graphql/resolvers/projects/services_resolver.rb'
-
'
app/graphql/resolvers/projects_resolver.rb'
-
'
app/graphql/resolvers/release_resolver.rb'
-
'
app/graphql/resolvers/repository_branch_names_resolver.rb'
-
'
app/graphql/resolvers/snippets_resolver.rb'
-
'
app/graphql/resolvers/terraform/states_resolver.rb'
-
'
app/graphql/resolvers/tree_resolver.rb'
-
'
app/graphql/resolvers/user_resolver.rb'
-
'
app/graphql/resolvers/user_starred_projects_resolver.rb'
-
'
app/graphql/resolvers/users_resolver.rb'
-
'
app/graphql/types/access_level_type.rb'
-
'
app/graphql/types/admin/analytics/usage_trends/measurement_type.rb'
-
'
app/graphql/types/admin/sidekiq_queues/delete_jobs_response_type.rb'
-
'
app/graphql/types/alert_management/alert_status_counts_type.rb'
-
'
app/graphql/types/alert_management/alert_type.rb'
-
'
app/graphql/types/alert_management/integration_type.rb'
-
'
app/graphql/types/award_emojis/award_emoji_type.rb'
-
'
app/graphql/types/blob_viewer_type.rb'
-
'
app/graphql/types/board_list_type.rb'
-
'
app/graphql/types/board_type.rb'
-
'
app/graphql/types/boards/board_issuable_input_base_type.rb'
-
'
app/graphql/types/boards/board_issue_input_base_type.rb'
-
'
app/graphql/types/boards/board_issue_input_type.rb'
-
'
app/graphql/types/branch_type.rb'
-
'
app/graphql/types/ci/application_setting_type.rb'
-
'
app/graphql/types/ci/build_need_type.rb'
-
'
app/graphql/types/ci/ci_cd_setting_type.rb'
-
'
app/graphql/types/ci/config/config_type.rb'
-
'
app/graphql/types/ci/config/group_type.rb'
-
'
app/graphql/types/ci/config/job_type.rb'
-
'
app/graphql/types/ci/config/need_type.rb'
-
'
app/graphql/types/ci/config/stage_type.rb'
-
'
app/graphql/types/ci/detailed_status_type.rb'
-
'
app/graphql/types/ci/group_type.rb'
-
'
app/graphql/types/ci/job_artifact_type.rb'
-
'
app/graphql/types/ci/job_type.rb'
-
'
app/graphql/types/ci/pipeline_type.rb'
-
'
app/graphql/types/ci/recent_failures_type.rb'
-
'
app/graphql/types/ci/runner_architecture_type.rb'
-
'
app/graphql/types/ci/runner_platform_type.rb'
-
'
app/graphql/types/ci/runner_setup_type.rb'
-
'
app/graphql/types/ci/runner_type.rb'
-
'
app/graphql/types/ci/stage_type.rb'
-
'
app/graphql/types/ci/status_action_type.rb'
-
'
app/graphql/types/ci/template_type.rb'
-
'
app/graphql/types/ci/test_case_type.rb'
-
'
app/graphql/types/ci/test_report_total_type.rb'
-
'
app/graphql/types/ci/test_suite_summary_type.rb'
-
'
app/graphql/types/ci/test_suite_type.rb'
-
'
app/graphql/types/ci_configuration/sast/analyzers_entity_input_type.rb'
-
'
app/graphql/types/ci_configuration/sast/analyzers_entity_type.rb'
-
'
app/graphql/types/ci_configuration/sast/entity_input_type.rb'
-
'
app/graphql/types/ci_configuration/sast/entity_type.rb'
-
'
app/graphql/types/ci_configuration/sast/options_entity_type.rb'
-
'
app/graphql/types/container_expiration_policy_type.rb'
-
'
app/graphql/types/container_repository_tag_type.rb'
-
'
app/graphql/types/container_repository_type.rb'
-
'
app/graphql/types/countable_connection_type.rb'
-
'
app/graphql/types/custom_emoji_type.rb'
-
'
app/graphql/types/design_management/design_fields.rb'
-
'
app/graphql/types/design_management/version_type.rb'
-
'
app/graphql/types/diff_paths_input_type.rb'
-
'
app/graphql/types/diff_refs_type.rb'
-
'
app/graphql/types/diff_stats_summary_type.rb'
-
'
app/graphql/types/diff_stats_type.rb'
-
'
app/graphql/types/environment_type.rb'
-
'
app/graphql/types/error_tracking/sentry_detailed_error_type.rb'
-
'
app/graphql/types/error_tracking/sentry_error_collection_type.rb'
-
'
app/graphql/types/error_tracking/sentry_error_frequency_type.rb'
-
'
app/graphql/types/error_tracking/sentry_error_stack_trace_context_type.rb'
-
'
app/graphql/types/error_tracking/sentry_error_stack_trace_entry_type.rb'
-
'
app/graphql/types/error_tracking/sentry_error_stack_trace_type.rb'
-
'
app/graphql/types/error_tracking/sentry_error_tags_type.rb'
-
'
app/graphql/types/error_tracking/sentry_error_type.rb'
-
'
app/graphql/types/event_type.rb'
-
'
app/graphql/types/evidence_type.rb'
-
'
app/graphql/types/grafana_integration_type.rb'
-
'
app/graphql/types/invitation_interface.rb'
-
'
app/graphql/types/issue_type.rb'
-
'
app/graphql/types/issues/negated_issue_filter_input_type.rb'
-
'
app/graphql/types/jira_import_type.rb'
-
'
app/graphql/types/jira_user_type.rb'
-
'
app/graphql/types/jira_users_mapping_input_type.rb'
-
'
app/graphql/types/label_type.rb'
-
'
app/graphql/types/member_interface.rb'
-
'
app/graphql/types/merge_request_type.rb'
-
'
app/graphql/types/metadata/kas_type.rb'
-
'
app/graphql/types/metadata_type.rb'
-
'
app/graphql/types/metrics/dashboard_type.rb'
-
'
app/graphql/types/metrics/dashboards/annotation_type.rb'
-
'
app/graphql/types/milestone_stats_type.rb'
-
'
app/graphql/types/milestone_type.rb'
-
'
app/graphql/types/namespace/package_settings_type.rb'
-
'
app/graphql/types/namespace_type.rb'
-
'
app/graphql/types/notes/diff_image_position_input_type.rb'
-
'
app/graphql/types/notes/diff_position_base_input_type.rb'
-
'
app/graphql/types/notes/diff_position_input_type.rb'
-
'
app/graphql/types/notes/diff_position_type.rb'
-
'
app/graphql/types/notes/note_type.rb'
-
'
app/graphql/types/notes/update_diff_image_position_input_type.rb'
-
'
app/graphql/types/packages/composer/json_type.rb'
-
'
app/graphql/types/packages/composer/metadatum_type.rb'
-
'
app/graphql/types/packages/conan/file_metadatum_type.rb'
-
'
app/graphql/types/packages/conan/metadatum_type.rb'
-
'
app/graphql/types/packages/maven/metadatum_type.rb'
-
'
app/graphql/types/packages/nuget/metadatum_type.rb'
-
'
app/graphql/types/packages/package_file_type.rb'
-
'
app/graphql/types/packages/package_tag_type.rb'
-
'
app/graphql/types/packages/package_type.rb'
-
'
app/graphql/types/packages/pypi/metadatum_type.rb'
-
'
app/graphql/types/project_type.rb'
-
'
app/graphql/types/projects/service_type.rb'
-
'
app/graphql/types/projects/services/jira_project_type.rb'
-
'
app/graphql/types/prometheus_alert_type.rb'
-
'
app/graphql/types/query_complexity_type.rb'
-
'
app/graphql/types/release_asset_link_shared_input_arguments.rb'
-
'
app/graphql/types/release_asset_link_type.rb'
-
'
app/graphql/types/release_assets_type.rb'
-
'
app/graphql/types/release_links_type.rb'
-
'
app/graphql/types/release_source_type.rb'
-
'
app/graphql/types/release_type.rb'
-
'
app/graphql/types/repository/blob_type.rb'
-
'
app/graphql/types/repository_type.rb'
-
'
app/graphql/types/resolvable_interface.rb'
-
'
app/graphql/types/snippet_type.rb'
-
'
app/graphql/types/snippets/blob_action_input_type.rb'
-
'
app/graphql/types/snippets/blob_type.rb'
-
'
app/graphql/types/task_completion_status.rb'
-
'
app/graphql/types/terraform/state_type.rb'
-
'
app/graphql/types/terraform/state_version_type.rb'
-
'
app/graphql/types/timelog_type.rb'
-
'
app/graphql/types/todo_type.rb'
-
'
app/graphql/types/tree/blob_type.rb'
-
'
app/graphql/types/tree/entry_type.rb'
-
'
app/graphql/types/tree/tree_entry_type.rb'
-
'
app/graphql/types/user_status_type.rb'
-
'
ee/app/graphql/ee/mutations/ci/ci_cd_settings_update.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/boards/board_issue_input_base_type.rb'
-
'
ee/app/graphql/ee/types/issue_connection_type.rb'
-
'
ee/app/graphql/ee/types/issue_type.rb'
-
'
ee/app/graphql/ee/types/issues/negated_issue_filter_input_type.rb'
-
'
ee/app/graphql/ee/types/merge_request_type.rb'
-
'
ee/app/graphql/ee/types/namespace_type.rb'
-
'
ee/app/graphql/ee/types/project_type.rb'
-
'
ee/app/graphql/mutations/app_sec/fuzzing/api/ci_configuration/create.rb'
-
'
ee/app/graphql/mutations/boards/epic_boards/create.rb'
-
'
ee/app/graphql/mutations/boards/epics/create.rb'
-
'
ee/app/graphql/mutations/boards/lists/update_limit_metrics.rb'
-
'
ee/app/graphql/mutations/boards/scoped_issue_board_arguments.rb'
-
'
ee/app/graphql/mutations/boards/update_epic_user_preferences.rb'
-
'
ee/app/graphql/mutations/clusters/agent_tokens/create.rb'
-
'
ee/app/graphql/mutations/clusters/agents/create.rb'
-
'
ee/app/graphql/mutations/compliance_management/frameworks/create.rb'
-
'
ee/app/graphql/mutations/concerns/mutations/shared_epic_arguments.rb'
-
'
ee/app/graphql/mutations/dast/profiles/create.rb'
-
'
ee/app/graphql/mutations/dast/profiles/run.rb'
-
'
ee/app/graphql/mutations/dast/profiles/update.rb'
-
'
ee/app/graphql/mutations/dast_on_demand_scans/create.rb'
-
'
ee/app/graphql/mutations/dast_scanner_profiles/create.rb'
-
'
ee/app/graphql/mutations/dast_scanner_profiles/delete.rb'
-
'
ee/app/graphql/mutations/dast_scanner_profiles/update.rb'
-
'
ee/app/graphql/mutations/dast_site_profiles/create.rb'
-
'
ee/app/graphql/mutations/dast_site_profiles/delete.rb'
-
'
ee/app/graphql/mutations/dast_site_profiles/update.rb'
-
'
ee/app/graphql/mutations/dast_site_tokens/create.rb'
-
'
ee/app/graphql/mutations/dast_site_validations/create.rb'
-
'
ee/app/graphql/mutations/dast_site_validations/revoke.rb'
-
'
ee/app/graphql/mutations/epics/add_issue.rb'
-
'
ee/app/graphql/mutations/epics/base.rb'
-
'
ee/app/graphql/mutations/epics/set_subscription.rb'
-
'
ee/app/graphql/mutations/gitlab_subscriptions/activate.rb'
-
'
ee/app/graphql/mutations/incident_management/escalation_policy/create.rb'
-
'
ee/app/graphql/mutations/incident_management/escalation_policy/update.rb'
-
'
ee/app/graphql/mutations/incident_management/oncall_rotation/create.rb'
-
'
ee/app/graphql/mutations/incident_management/oncall_rotation/destroy.rb'
-
'
ee/app/graphql/mutations/incident_management/oncall_rotation/update.rb'
-
'
ee/app/graphql/mutations/incident_management/oncall_schedule/create.rb'
-
'
ee/app/graphql/mutations/incident_management/oncall_schedule/destroy.rb'
-
'
ee/app/graphql/mutations/incident_management/oncall_schedule/update.rb'
-
'
ee/app/graphql/mutations/issues/common_ee_mutation_arguments.rb'
-
'
ee/app/graphql/mutations/issues/promote_to_epic.rb'
-
'
ee/app/graphql/mutations/issues/set_weight.rb'
-
'
ee/app/graphql/mutations/iterations/cadences/create.rb'
-
'
ee/app/graphql/mutations/iterations/cadences/update.rb'
-
'
ee/app/graphql/mutations/iterations/create.rb'
-
'
ee/app/graphql/mutations/iterations/update.rb'
-
'
ee/app/graphql/mutations/quality_management/test_cases/create.rb'
-
'
ee/app/graphql/mutations/requirements_management/base_requirement.rb'
-
'
ee/app/graphql/mutations/requirements_management/export_requirements.rb'
-
'
ee/app/graphql/mutations/requirements_management/update_requirement.rb'
-
'
ee/app/graphql/mutations/security/ci_configuration/configure_dependency_scanning.rb'
-
'
ee/app/graphql/mutations/security_policy/assign_security_policy_project.rb'
-
'
ee/app/graphql/mutations/security_policy/commit_scan_execution_policy.rb'
-
'
ee/app/graphql/mutations/security_policy/create_security_policy_project.rb'
-
'
ee/app/graphql/mutations/vulnerabilities/dismiss.rb'
-
'
ee/app/graphql/resolvers/alert_management/payload_alert_field_resolver.rb'
-
'
ee/app/graphql/resolvers/clusters/agents_resolver.rb'
-
'
ee/app/graphql/resolvers/concerns/common_requirement_arguments.rb'
-
'
ee/app/graphql/resolvers/epic_ancestors_resolver.rb'
-
'
ee/app/graphql/resolvers/epics_resolver.rb'
-
'
ee/app/graphql/resolvers/geo/geo_node_resolver.rb'
-
'
ee/app/graphql/resolvers/instance_security_dashboard/projects_resolver.rb'
-
'
ee/app/graphql/resolvers/iterations/cadences_resolver.rb'
-
'
ee/app/graphql/resolvers/iterations_resolver.rb'
-
'
ee/app/graphql/resolvers/requirements_management/requirements_resolver.rb'
-
'
ee/app/graphql/resolvers/vulnerabilities_grade_resolver.rb'
-
'
ee/app/graphql/resolvers/vulnerabilities_resolver.rb'
-
'
ee/app/graphql/resolvers/vulnerability_severities_count_resolver.rb'
-
'
ee/app/graphql/types/admin/cloud_licenses/current_license_type.rb'
-
'
ee/app/graphql/types/admin/cloud_licenses/license_type.rb'
-
'
ee/app/graphql/types/alert_management/payload_alert_field_input_type.rb'
-
'
ee/app/graphql/types/alert_management/payload_alert_field_type.rb'
-
'
ee/app/graphql/types/alert_management/payload_alert_mapping_field_type.rb'
-
'
ee/app/graphql/types/analytics/devops_adoption/enabled_namespace_type.rb'
-
'
ee/app/graphql/types/analytics/devops_adoption/snapshot_type.rb'
-
'
ee/app/graphql/types/app_sec/fuzzing/api/scan_profile_type.rb'
-
'
ee/app/graphql/types/boards/board_epic_input_type.rb'
-
'
ee/app/graphql/types/boards/epic_board_type.rb'
-
'
ee/app/graphql/types/boards/epic_list_type.rb'
-
'
ee/app/graphql/types/boards/epic_user_preferences_type.rb'
-
'
ee/app/graphql/types/burnup_chart_daily_totals_type.rb'
-
'
ee/app/graphql/types/ci/code_coverage_activity_type.rb'
-
'
ee/app/graphql/types/ci/code_coverage_summary_type.rb'
-
'
ee/app/graphql/types/ci/code_quality_degradation_type.rb'
-
'
ee/app/graphql/types/clusters/agent_token_type.rb'
-
'
ee/app/graphql/types/clusters/agent_type.rb'
-
'
ee/app/graphql/types/compliance_management/compliance_framework_input_type.rb'
-
'
ee/app/graphql/types/compliance_management/compliance_framework_type.rb'
-
'
ee/app/graphql/types/dast/profile_branch_type.rb'
-
'
ee/app/graphql/types/dast/profile_type.rb'
-
'
ee/app/graphql/types/dast/site_profile_auth_input_type.rb'
-
'
ee/app/graphql/types/dast/site_profile_auth_type.rb'
-
'
ee/app/graphql/types/dast_scanner_profile_type.rb'
-
'
ee/app/graphql/types/dast_site_profile_type.rb'
-
'
ee/app/graphql/types/dast_site_validation_type.rb'
-
'
ee/app/graphql/types/dora_metric_type.rb'
-
'
ee/app/graphql/types/epic_descendant_count_type.rb'
-
'
ee/app/graphql/types/epic_descendant_weight_sum_type.rb'
-
'
ee/app/graphql/types/epic_health_status_type.rb'
-
'
ee/app/graphql/types/epic_issue_type.rb'
-
'
ee/app/graphql/types/epic_type.rb'
-
'
ee/app/graphql/types/epics/negated_epic_filter_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/group_wiki_repository_registry_type.rb'
-
'
ee/app/graphql/types/geo/lfs_object_registry_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/pipeline_artifact_registry_type.rb'
-
'
ee/app/graphql/types/geo/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_release_stats_type.rb'
-
'
ee/app/graphql/types/incident_management/escalation_policy_type.rb'
-
'
ee/app/graphql/types/incident_management/escalation_rule_input_type.rb'
-
'
ee/app/graphql/types/incident_management/escalation_rule_type.rb'
-
'
ee/app/graphql/types/incident_management/oncall_participant_type.rb'
-
'
ee/app/graphql/types/incident_management/oncall_rotation_active_period_input_type.rb'
-
'
ee/app/graphql/types/incident_management/oncall_rotation_active_period_type.rb'
-
'
ee/app/graphql/types/incident_management/oncall_rotation_date_input_type.rb'
-
'
ee/app/graphql/types/incident_management/oncall_rotation_length_input_type.rb'
-
'
ee/app/graphql/types/incident_management/oncall_rotation_type.rb'
-
'
ee/app/graphql/types/incident_management/oncall_schedule_type.rb'
-
'
ee/app/graphql/types/incident_management/oncall_user_input_type.rb'
-
'
ee/app/graphql/types/iteration_type.rb'
-
'
ee/app/graphql/types/iterations/cadence_type.rb'
-
'
ee/app/graphql/types/kas/agent_configuration_type.rb'
-
'
ee/app/graphql/types/metric_image_type.rb'
-
'
ee/app/graphql/types/network_policy_type.rb'
-
'
ee/app/graphql/types/path_lock_type.rb'
-
'
ee/app/graphql/types/push_rules_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/scan_execution_policy_type.rb'
-
'
ee/app/graphql/types/scan_type.rb'
-
'
ee/app/graphql/types/scanned_resource_type.rb'
-
'
ee/app/graphql/types/security_report_summary_section_type.rb'
-
'
ee/app/graphql/types/timebox_metrics_type.rb'
-
'
ee/app/graphql/types/vulnerabilities_count_by_day_type.rb'
-
'
ee/app/graphql/types/vulnerability/issue_link_type.rb'
-
'
ee/app/graphql/types/vulnerability_details/base_type.rb'
-
'
ee/app/graphql/types/vulnerability_details/boolean_type.rb'
-
'
ee/app/graphql/types/vulnerability_details/code_type.rb'
-
'
ee/app/graphql/types/vulnerability_details/commit_type.rb'
-
'
ee/app/graphql/types/vulnerability_details/diff_type.rb'
-
'
ee/app/graphql/types/vulnerability_details/file_location_type.rb'
-
'
ee/app/graphql/types/vulnerability_details/int_type.rb'
-
'
ee/app/graphql/types/vulnerability_details/markdown_type.rb'
-
'
ee/app/graphql/types/vulnerability_details/module_location_type.rb'
-
'
ee/app/graphql/types/vulnerability_details/text_type.rb'
-
'
ee/app/graphql/types/vulnerability_details/url_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: See https://gitlab.com/gitlab-org/gitlab/-/issues/220040
Rails/SaveBang
:
Exclude
:
...
...
rubocop/cop/graphql/old_types.rb
0 → 100644
View file @
9af1b899
# frozen_string_literal: true
# This cop checks for use of older GraphQL types in GraphQL fields
# and arguments.
# GraphQL::ID_TYPE, GraphQL::INT_TYPE, GraphQL::STRING_TYPE, GraphQL::BOOLEAN_TYPE
#
# @example
#
# # bad
# class AwfulClass
# field :some_field, GraphQL::STRING_TYPE
# end
#
# # good
# class GreatClass
# field :some_field, GraphQL::Types::String
# end
module
RuboCop
module
Cop
module
Graphql
class
OldTypes
<
RuboCop
::
Cop
::
Cop
MSG_ID
=
'Avoid using GraphQL::ID_TYPE. Use GraphQL::Types::ID instead'
MSG_INT
=
'Avoid using GraphQL::INT_TYPE. Use GraphQL::Types::Int instead'
MSG_STRING
=
'Avoid using GraphQL::STRING_TYPE. Use GraphQL::Types::String instead'
MSG_BOOLEAN
=
'Avoid using GraphQL::BOOLEAN_TYPE. Use GraphQL::Types::Boolean instead'
def_node_matcher
:has_old_type?
,
<<~
PATTERN
(send nil? {:field :argument}
(sym _)
(const (const nil? :GraphQL) ${:ID_TYPE :INT_TYPE :STRING_TYPE :BOOLEAN_TYPE})
(...)?)
PATTERN
def
on_send
(
node
)
old_constant
=
has_old_type?
(
node
)
return
unless
old_constant
add_offense
(
node
,
location: :expression
,
message:
"
#{
self
.
class
}
::MSG_
#{
old_constant
[
0
..-
6
]
}
"
.
constantize
)
end
end
end
end
end
spec/rubocop/cop/graphql/old_types_spec.rb
0 → 100644
View file @
9af1b899
# frozen_string_literal: true
require
'fast_spec_helper'
require
'rspec-parameterized'
require_relative
'../../../../rubocop/cop/graphql/old_types'
RSpec
.
describe
RuboCop
::
Cop
::
Graphql
::
OldTypes
do
using
RSpec
::
Parameterized
::
TableSyntax
subject
(
:cop
)
{
described_class
.
new
}
where
(
:old_type
,
:message
)
do
'GraphQL::ID_TYPE'
|
'Avoid using GraphQL::ID_TYPE. Use GraphQL::Types::ID instead'
'GraphQL::INT_TYPE'
|
'Avoid using GraphQL::INT_TYPE. Use GraphQL::Types::Int instead'
'GraphQL::STRING_TYPE'
|
'Avoid using GraphQL::STRING_TYPE. Use GraphQL::Types::String instead'
'GraphQL::BOOLEAN_TYPE'
|
'Avoid using GraphQL::BOOLEAN_TYPE. Use GraphQL::Types::Boolean instead'
end
with_them
do
context
'fields'
do
it
'adds an offense when an old type is used'
do
expect_offense
(
<<~
RUBY
)
class MyType
field :some_field,
#{
old_type
}
^^^^^^^^^^^^^^^^^^^
#{
'^'
*
old_type
.
length
}
#{
message
}
end
RUBY
end
it
"adds an offense when an old type is used with other keywords"
do
expect_offense
(
<<~
RUBY
)
class MyType
field :some_field,
#{
old_type
}
, null: true, description: 'My description'
^^^^^^^^^^^^^^^^^^^
#{
'^'
*
old_type
.
length
}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#{
message
}
end
RUBY
end
end
context
'arguments'
do
it
'adds an offense when an old type is used'
do
expect_offense
(
<<~
RUBY
)
class MyType
field :some_arg,
#{
old_type
}
^^^^^^^^^^^^^^^^^
#{
'^'
*
old_type
.
length
}
#{
message
}
end
RUBY
end
it
'adds an offense when an old type is used with other keywords'
do
expect_offense
(
<<~
RUBY
)
class MyType
argument :some_arg,
#{
old_type
}
, null: true, description: 'My description'
^^^^^^^^^^^^^^^^^^^^
#{
'^'
*
old_type
.
length
}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#{
message
}
end
RUBY
end
end
end
it
'does not add an offense for other types in fields'
do
expect_no_offenses
(
<<~
RUBY
.
strip
)
class MyType
field :some_field, GraphQL::Types::JSON
end
RUBY
end
it
'does not add an offense for other types in arguments'
do
expect_no_offenses
(
<<~
RUBY
.
strip
)
class MyType
argument :some_arg, GraphQL::Types::JSON
end
RUBY
end
it
'does not add an offense for uses outside of field or argument'
do
expect_no_offenses
(
<<~
RUBY
.
strip
)
class MyType
foo :some_field, GraphQL::ID_TYPE
end
RUBY
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment