Commit 5ee31276 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'issue_346033_1/7' into 'master'

Fix GraphQL/OrderedFields offenses

See merge request gitlab-org/gitlab!81471
parents ee1afaf1 a39986e8
......@@ -22,14 +22,6 @@ GraphQL/OrderedFields:
- 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_type.rb
- app/graphql/types/evidence_type.rb
- app/graphql/types/grafana_integration_type.rb
- app/graphql/types/issue_type.rb
- app/graphql/types/jira_import_type.rb
- app/graphql/types/jira_user_type.rb
- app/graphql/types/label_type.rb
- app/graphql/types/merge_request_type.rb
- app/graphql/types/metadata/kas_type.rb
- app/graphql/types/metadata_type.rb
......
......@@ -8,12 +8,12 @@ module Types
authorize :read_sentry_issue
field :issue_id, GraphQL::Types::String,
null: false,
description: 'ID of the Sentry error.'
field :date_received, GraphQL::Types::String,
null: false,
description: 'Time the stack trace was received by Sentry.'
field :issue_id, GraphQL::Types::String,
null: false,
description: 'ID of the Sentry error.'
field :stack_trace_entries, [Types::ErrorTracking::SentryErrorStackTraceEntryType],
null: false,
description: 'Stack trace entries for the Sentry error.'
......
......@@ -9,49 +9,34 @@ module Types
present_using SentryErrorPresenter
field :id, GraphQL::Types::ID,
null: false,
description: 'ID (global ID) of the error.'
field :sentry_id, GraphQL::Types::String,
method: :id,
null: false,
description: 'ID (Sentry ID) of the error.'
field :first_seen, Types::TimeType,
null: false,
description: 'Timestamp when the error was first seen.'
field :last_seen, Types::TimeType,
null: false,
description: 'Timestamp when the error was last seen.'
field :title, GraphQL::Types::String,
null: false,
description: 'Title of the error.'
field :type, GraphQL::Types::String,
null: false,
description: 'Type of the error.'
field :user_count, GraphQL::Types::Int,
null: false,
description: 'Count of users affected by the error.'
field :count, GraphQL::Types::Int,
null: false,
description: 'Count of occurrences.'
field :message, GraphQL::Types::String,
null: true,
description: 'Sentry metadata message of the error.'
field :culprit, GraphQL::Types::String,
null: false,
description: 'Culprit of the error.'
field :external_url, GraphQL::Types::String,
null: false,
description: 'External URL of the error.'
field :short_id, GraphQL::Types::String,
null: false,
description: 'Short ID (Sentry ID) of the error.'
field :status, Types::ErrorTracking::SentryErrorStatusEnum,
field :first_seen, Types::TimeType,
null: false,
description: 'Status of the error.'
description: 'Timestamp when the error was first seen.'
field :frequency, [Types::ErrorTracking::SentryErrorFrequencyType],
null: false,
description: 'Last 24hr stats of the error.'
field :id, GraphQL::Types::ID,
null: false,
description: 'ID (global ID) of the error.'
field :last_seen, Types::TimeType,
null: false,
description: 'Timestamp when the error was last seen.'
field :message, GraphQL::Types::String,
null: true,
description: 'Sentry metadata message of the error.'
field :sentry_id, GraphQL::Types::String,
method: :id,
null: false,
description: 'ID (Sentry ID) of the error.'
field :sentry_project_id, GraphQL::Types::ID,
method: :project_id,
null: false,
......@@ -64,6 +49,21 @@ module Types
method: :project_slug,
null: false,
description: 'Slug of the project affected by the error.'
field :short_id, GraphQL::Types::String,
null: false,
description: 'Short ID (Sentry ID) of the error.'
field :status, Types::ErrorTracking::SentryErrorStatusEnum,
null: false,
description: 'Status of the error.'
field :title, GraphQL::Types::String,
null: false,
description: 'Title of the error.'
field :type, GraphQL::Types::String,
null: false,
description: 'Type of the error.'
field :user_count, GraphQL::Types::Int,
null: false,
description: 'Count of users affected by the error.'
end
# rubocop: enable Graphql/AuthorizeTypes
end
......
......@@ -9,13 +9,13 @@ module Types
present_using Releases::EvidencePresenter
field :collected_at, Types::TimeType, null: true,
description: 'Timestamp when the evidence was collected.'
field :filepath, GraphQL::Types::String, null: true,
description: 'URL from where the evidence can be downloaded.'
field :id, GraphQL::Types::ID, null: false,
description: 'ID of the evidence.'
field :sha, GraphQL::Types::String, null: true,
description: 'SHA1 ID of the evidence hash.'
field :filepath, GraphQL::Types::String, null: true,
description: 'URL from where the evidence can be downloaded.'
field :collected_at, Types::TimeType, null: true,
description: 'Timestamp when the evidence was collected.'
end
end
......@@ -6,14 +6,14 @@ module Types
authorize :admin_operations
field :id, GraphQL::Types::ID, null: false,
description: 'Internal ID of the Grafana integration.'
field :grafana_url, GraphQL::Types::String, null: false,
description: 'URL for the Grafana host for the Grafana integration.'
field :enabled, GraphQL::Types::Boolean, null: false,
description: 'Indicates whether Grafana integration is enabled.'
field :created_at, Types::TimeType, null: false,
description: 'Timestamp of the issue\'s creation.'
field :enabled, GraphQL::Types::Boolean, null: false,
description: 'Indicates whether Grafana integration is enabled.'
field :grafana_url, GraphQL::Types::String, null: false,
description: 'URL for the Grafana host for the Grafana integration.'
field :id, GraphQL::Types::ID, null: false,
description: 'Internal ID of the Grafana integration.'
field :updated_at, Types::TimeType, null: false,
description: 'Timestamp of the issue\'s last activity.'
end
......
......@@ -15,16 +15,16 @@ module Types
present_using IssuePresenter
field :description, GraphQL::Types::String, null: true,
description: 'Description of the issue.'
field :id, GraphQL::Types::ID, null: false,
description: "ID of the issue."
field :iid, GraphQL::Types::ID, null: false,
description: "Internal ID of the issue."
field :title, GraphQL::Types::String, null: false,
description: 'Title of the issue.'
field :description, GraphQL::Types::String, null: true,
description: 'Description of the issue.'
field :state, IssueStateEnum, null: false,
description: 'State of the issue.'
field :title, GraphQL::Types::String, null: false,
description: 'Title of the issue.'
field :reference, GraphQL::Types::String, null: false,
description: 'Internal reference of the issue. Returned in shortened format by default.',
......@@ -47,52 +47,52 @@ module Types
field :milestone, Types::MilestoneType, null: true,
description: 'Milestone of the issue.'
field :due_date, Types::TimeType, null: true,
description: 'Due date of the issue.'
field :confidential, GraphQL::Types::Boolean, null: false,
description: 'Indicates the issue is confidential.'
field :discussion_locked, GraphQL::Types::Boolean, null: false,
description: 'Indicates discussion is locked on the issue.'
field :due_date, Types::TimeType, null: true,
description: 'Due date of the issue.'
field :hidden, GraphQL::Types::Boolean, null: true, resolver_method: :hidden?,
description: 'Indicates the issue is hidden because the author has been banned. ' \
'Will always return `null` if `ban_user_feature_flag` feature flag is disabled.'
field :discussion_locked, GraphQL::Types::Boolean, null: false,
description: 'Indicates discussion is locked on the issue.'
field :upvotes, GraphQL::Types::Int, null: false,
description: 'Number of upvotes the issue has received.'
field :downvotes, GraphQL::Types::Int, null: false,
description: 'Number of downvotes the issue has received.'
field :merge_requests_count, GraphQL::Types::Int, null: false,
description: 'Number of merge requests that close the issue on merge.',
resolver: Resolvers::MergeRequestsCountResolver
field :user_notes_count, GraphQL::Types::Int, null: false,
description: 'Number of user notes of the issue.',
resolver: Resolvers::UserNotesCountResolver
field :relative_position, GraphQL::Types::Int, null: true,
description: 'Relative position of the issue (used for positioning in epic tree and issue boards).'
field :upvotes, GraphQL::Types::Int, null: false,
description: 'Number of upvotes the issue has received.'
field :user_discussions_count, GraphQL::Types::Int, null: false,
description: 'Number of user discussions in the issue.',
resolver: Resolvers::UserDiscussionsCountResolver
field :user_notes_count, GraphQL::Types::Int, null: false,
description: 'Number of user notes of the issue.',
resolver: Resolvers::UserNotesCountResolver
field :web_path, GraphQL::Types::String, null: false, method: :issue_path,
description: 'Web path of the issue.'
field :web_url, GraphQL::Types::String, null: false,
description: 'Web URL of the issue.'
field :relative_position, GraphQL::Types::Int, null: true,
description: 'Relative position of the issue (used for positioning in epic tree and issue boards).'
field :participants, Types::UserType.connection_type, null: true, complexity: 5,
description: 'List of participants in the issue.',
resolver: Resolvers::Users::ParticipantsResolver
field :emails_disabled, GraphQL::Types::Boolean, null: false,
method: :project_emails_disabled?,
description: 'Indicates if a project has email notifications disabled: `true` if email notifications are disabled.'
field :human_time_estimate, GraphQL::Types::String, null: true,
description: 'Human-readable time estimate of the issue.'
field :human_total_time_spent, GraphQL::Types::String, null: true,
description: 'Human-readable total time reported as spent on the issue.'
field :participants, Types::UserType.connection_type, null: true, complexity: 5,
description: 'List of participants in the issue.',
resolver: Resolvers::Users::ParticipantsResolver
field :subscribed, GraphQL::Types::Boolean, method: :subscribed?, null: false, complexity: 5,
description: 'Indicates the currently logged in user is subscribed to the issue.'
field :time_estimate, GraphQL::Types::Int, null: false,
description: 'Time estimate of the issue.'
field :total_time_spent, GraphQL::Types::Int, null: false,
description: 'Total time reported as spent on the issue.'
field :human_time_estimate, GraphQL::Types::String, null: true,
description: 'Human-readable time estimate of the issue.'
field :human_total_time_spent, GraphQL::Types::String, null: true,
description: 'Human-readable total time reported as spent on the issue.'
field :closed_at, Types::TimeType, null: true,
description: 'Timestamp of when the issue was closed.'
......
......@@ -8,16 +8,16 @@ module Types
field :created_at, Types::TimeType, null: true,
description: 'Timestamp of when the Jira import was created.'
field :failed_to_import_count, GraphQL::Types::Int, null: false,
description: 'Count of issues that failed to import.'
field :imported_issues_count, GraphQL::Types::Int, null: false,
description: 'Count of issues that were successfully imported.'
field :jira_project_key, GraphQL::Types::String, null: false,
description: 'Project key for the imported Jira project.'
field :scheduled_at, Types::TimeType, null: true,
description: 'Timestamp of when the Jira import was scheduled.'
field :scheduled_by, Types::UserType, null: true,
description: 'User that started the Jira import.'
field :jira_project_key, GraphQL::Types::String, null: false,
description: 'Project key for the imported Jira project.'
field :imported_issues_count, GraphQL::Types::Int, null: false,
description: 'Count of issues that were successfully imported.'
field :failed_to_import_count, GraphQL::Types::Int, null: false,
description: 'Count of issues that failed to import.'
field :total_issue_count, GraphQL::Types::Int, null: false,
description: 'Total count of issues that were attempted to import.'
end
......
......@@ -6,18 +6,18 @@ module Types
class JiraUserType < BaseObject
graphql_name 'JiraUser'
field :gitlab_id, GraphQL::Types::Int, null: true,
description: 'ID of the matched GitLab user.'
field :gitlab_name, GraphQL::Types::String, null: true,
description: 'Name of the matched GitLab user.'
field :gitlab_username, GraphQL::Types::String, null: true,
description: 'Username of the matched GitLab user.'
field :jira_account_id, GraphQL::Types::String, null: false,
description: 'Account ID of the Jira user.'
field :jira_display_name, GraphQL::Types::String, null: false,
description: 'Display name of the Jira user.'
field :jira_email, GraphQL::Types::String, null: true,
description: 'Email of the Jira user, returned only for users with public emails.'
field :gitlab_id, GraphQL::Types::Int, null: true,
description: 'ID of the matched GitLab user.'
field :gitlab_username, GraphQL::Types::String, null: true,
description: 'Username of the matched GitLab user.'
field :gitlab_name, GraphQL::Types::String, null: true,
description: 'Name of the matched GitLab user.'
end
# rubocop: enable Graphql/AuthorizeTypes
end
......@@ -8,18 +8,18 @@ module Types
authorize :read_label
field :id, GraphQL::Types::ID, null: false,
description: 'Label ID.'
field :description, GraphQL::Types::String, null: true,
description: 'Description of the label (Markdown rendered as HTML for caching).'
field :title, GraphQL::Types::String, null: false,
description: 'Content of the label.'
field :color, GraphQL::Types::String, null: false,
description: 'Background color of the label.'
field :text_color, GraphQL::Types::String, null: false,
description: 'Text color of the label.'
field :created_at, Types::TimeType, null: false,
description: 'When this label was created.'
field :description, GraphQL::Types::String, null: true,
description: 'Description of the label (Markdown rendered as HTML for caching).'
field :id, GraphQL::Types::ID, null: false,
description: 'Label ID.'
field :text_color, GraphQL::Types::String, null: false,
description: 'Text color of the label.'
field :title, GraphQL::Types::String, null: false,
description: 'Content of the label.'
field :updated_at, Types::TimeType, null: false,
description: 'When this label was last updated.'
......
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