Commit 8db1f160 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'issue_346033_1/4' into 'master'

Fix GraphQL/OrderedFields offenses

See merge request gitlab-org/gitlab!81466
parents f15e8c67 0ec8ab44
......@@ -9,10 +9,10 @@ module Types
authorize :read_package
field :icon_url, GraphQL::Types::String, null: true, description: 'Icon URL of the Nuget package.'
field :id, ::Types::GlobalIDType[::Packages::Nuget::Metadatum], null: false, description: 'ID of the metadatum.'
field :license_url, GraphQL::Types::String, null: true, description: 'License URL of the Nuget package.'
field :project_url, GraphQL::Types::String, null: true, description: 'Project URL of the Nuget package.'
field :icon_url, GraphQL::Types::String, null: true, description: 'Icon URL of the Nuget package.'
end
end
end
......
......@@ -7,9 +7,9 @@ module Types
description 'Represents a package dependency link'
authorize :read_package
field :id, ::Types::GlobalIDType[::Packages::DependencyLink], null: false, description: 'ID of the dependency link.'
field :dependency_type, Types::Packages::PackageDependencyTypeEnum, null: false, description: 'Dependency type.'
field :dependency, Types::Packages::PackageDependencyType, null: true, description: 'Dependency.'
field :dependency_type, Types::Packages::PackageDependencyTypeEnum, null: false, description: 'Dependency type.'
field :id, ::Types::GlobalIDType[::Packages::DependencyLink], null: false, description: 'ID of the dependency link.'
field :metadata, Types::Packages::DependencyLinkMetadataType, null: true, description: 'Dependency link metadata.'
# NOTE: This method must be kept in sync with the union
......
......@@ -7,17 +7,17 @@ module Types
description 'Represents a package file'
authorize :read_package
field :id, ::Types::GlobalIDType[::Packages::PackageFile], null: false, description: 'ID of the file.'
field :created_at, Types::TimeType, null: false, description: 'Created date.'
field :updated_at, Types::TimeType, null: false, description: 'Updated date.'
field :size, GraphQL::Types::String, null: false, description: 'Size of the package file.'
field :file_name, GraphQL::Types::String, null: false, description: 'Name of the package file.'
field :download_path, GraphQL::Types::String, null: false, description: 'Download path of the package file.'
field :file_md5, GraphQL::Types::String, null: true, description: 'Md5 of the package file.'
field :file_sha1, GraphQL::Types::String, null: true, description: 'Sha1 of the package file.'
field :file_sha256, GraphQL::Types::String, null: true, description: 'Sha256 of the package file.'
field :file_metadata, Types::Packages::FileMetadataType, null: true,
description: 'File metadata.'
field :file_name, GraphQL::Types::String, null: false, description: 'Name of the package file.'
field :file_sha1, GraphQL::Types::String, null: true, description: 'Sha1 of the package file.'
field :file_sha256, GraphQL::Types::String, null: true, description: 'Sha256 of the package file.'
field :id, ::Types::GlobalIDType[::Packages::PackageFile], null: false, description: 'ID of the file.'
field :size, GraphQL::Types::String, null: false, description: 'Size of the package file.'
field :updated_at, Types::TimeType, null: false, description: 'Updated date.'
# NOTE: This method must be kept in sync with the union
# type: `Types::Packages::FileMetadataType`.
......
......@@ -7,9 +7,9 @@ module Types
description 'Represents a package tag'
authorize :read_package
field :created_at, Types::TimeType, null: false, description: 'Created date.'
field :id, GraphQL::Types::ID, null: false, description: 'ID of the tag.'
field :name, GraphQL::Types::String, null: false, description: 'Name of the tag.'
field :created_at, Types::TimeType, null: false, description: 'Created date.'
field :updated_at, Types::TimeType, null: false, description: 'Updated date.'
end
end
......
......@@ -13,23 +13,23 @@ module Types
field :id, ::Types::GlobalIDType[::Packages::Package], null: false,
description: 'ID of the package.'
field :name, GraphQL::Types::String, null: false, description: 'Name of the package.'
field :can_destroy, GraphQL::Types::Boolean, null: false, description: 'Whether the user can destroy the package.'
field :created_at, Types::TimeType, null: false, description: 'Date of creation.'
field :updated_at, Types::TimeType, null: false, description: 'Date of most recent update.'
field :version, GraphQL::Types::String, null: true, description: 'Version string.'
field :metadata, Types::Packages::MetadataType, null: true,
description: 'Package metadata.'
field :name, GraphQL::Types::String, null: false, description: 'Name of the package.'
field :package_type, Types::Packages::PackageTypeEnum, null: false, description: 'Package type.'
field :tags, Types::Packages::PackageTagType.connection_type, null: true, description: 'Package tags.'
field :project, Types::ProjectType, null: false, description: 'Project where the package is stored.'
field :pipelines, Types::Ci::PipelineType.connection_type, null: true,
description: 'Pipelines that built the package.',
deprecated: { reason: 'Due to scalability concerns, this field is going to be removed', milestone: '14.6' }
field :metadata, Types::Packages::MetadataType, null: true,
description: 'Package metadata.'
field :project, Types::ProjectType, null: false, description: 'Project where the package is stored.'
field :status, Types::Packages::PackageStatusEnum, null: false, description: 'Package status.'
field :tags, Types::Packages::PackageTagType.connection_type, null: true, description: 'Package tags.'
field :updated_at, Types::TimeType, null: false, description: 'Date of most recent update.'
field :version, GraphQL::Types::String, null: true, description: 'Version string.'
field :versions, ::Types::Packages::PackageType.connection_type, null: true,
description: 'Other versions of the package.',
deprecated: { reason: 'This field is now only returned in the PackageDetailsType', milestone: '13.11' }
field :status, Types::Packages::PackageStatusEnum, null: false, description: 'Package status.'
field :can_destroy, GraphQL::Types::Boolean, null: false, description: 'Whether the user can destroy the package.'
def project
Gitlab::Graphql::Loaders::BatchModelLoader.new(Project, object.project_id).find
......
......@@ -9,23 +9,23 @@ module Types
field :commit_count, GraphQL::Types::Float, null: false,
description: 'Commit count of the project.'
field :storage_size, GraphQL::Types::Float, null: false,
description: 'Storage size of the project in bytes.'
field :repository_size, GraphQL::Types::Float, null: false,
description: 'Repository size of the project in bytes.'
field :lfs_objects_size, GraphQL::Types::Float, null: false,
description: 'Large File Storage (LFS) object size of the project in bytes.'
field :build_artifacts_size, GraphQL::Types::Float, null: false,
description: 'Build artifacts size of the project in bytes.'
field :lfs_objects_size, GraphQL::Types::Float, null: false,
description: 'Large File Storage (LFS) object size of the project in bytes.'
field :packages_size, GraphQL::Types::Float, null: false,
description: 'Packages size of the project in bytes.'
field :wiki_size, GraphQL::Types::Float, null: true,
description: 'Wiki size of the project in bytes.'
field :snippets_size, GraphQL::Types::Float, null: true,
description: 'Snippets size of the project in bytes.'
field :pipeline_artifacts_size, GraphQL::Types::Float, null: true,
description: 'CI Pipeline artifacts size in bytes.'
field :repository_size, GraphQL::Types::Float, null: false,
description: 'Repository size of the project in bytes.'
field :snippets_size, GraphQL::Types::Float, null: true,
description: 'Snippets size of the project in bytes.'
field :storage_size, GraphQL::Types::Float, null: false,
description: 'Storage size of the project in bytes.'
field :uploads_size, GraphQL::Types::Float, null: true,
description: 'Uploads size of the project in bytes.'
field :wiki_size, GraphQL::Types::Float, null: true,
description: 'Wiki size of the project in bytes.'
end
end
......@@ -11,21 +11,21 @@ module Types
field :id, GraphQL::Types::ID, null: false,
description: 'ID of the project.'
field :ci_config_path_or_default, GraphQL::Types::String, null: false,
description: 'Path of the CI configuration file.'
field :full_path, GraphQL::Types::ID, null: false,
description: 'Full path of the project.'
field :path, GraphQL::Types::String, null: false,
description: 'Path of the project.'
field :ci_config_path_or_default, GraphQL::Types::String, null: false,
description: 'Path of the CI configuration file.'
field :sast_ci_configuration, Types::CiConfiguration::Sast::Type, null: true,
calls_gitaly: true,
description: 'SAST CI configuration for the project.'
field :name_with_namespace, GraphQL::Types::String, null: false,
description: 'Full name of the project with its namespace.'
field :name, GraphQL::Types::String, null: false,
description: 'Name of the project (without namespace).'
field :name_with_namespace, GraphQL::Types::String, null: false,
description: 'Full name of the project with its namespace.'
field :description, GraphQL::Types::String, null: true,
description: 'Short description of the project.'
......@@ -37,17 +37,17 @@ module Types
field :topics, [GraphQL::Types::String], null: true,
description: 'List of project topics.'
field :ssh_url_to_repo, GraphQL::Types::String, null: true,
description: 'URL to connect to the project via SSH.'
field :http_url_to_repo, GraphQL::Types::String, null: true,
description: 'URL to connect to the project via HTTPS.'
field :ssh_url_to_repo, GraphQL::Types::String, null: true,
description: 'URL to connect to the project via SSH.'
field :web_url, GraphQL::Types::String, null: true,
description: 'Web URL of the project.'
field :star_count, GraphQL::Types::Int, null: false,
description: 'Number of times the project has been starred.'
field :forks_count, GraphQL::Types::Int, null: false, calls_gitaly: true, # 4 times
description: 'Number of times the project has been forked.'
field :star_count, GraphQL::Types::Int, null: false,
description: 'Number of times the project has been starred.'
field :created_at, Types::TimeType, null: true,
description: 'Timestamp of the project creation.'
......@@ -60,12 +60,12 @@ module Types
field :visibility, GraphQL::Types::String, null: true,
description: 'Visibility of the project.'
field :shared_runners_enabled, GraphQL::Types::Boolean, null: true,
description: 'Indicates if shared runners are enabled for the project.'
field :lfs_enabled, GraphQL::Types::Boolean, null: true,
description: 'Indicates if the project has Large File Storage (LFS) enabled.'
field :merge_requests_ff_only_enabled, GraphQL::Types::Boolean, null: true,
description: 'Indicates if no merge commits should be created and all merges should instead be fast-forwarded, which means that merging is only allowed if the branch could be fast-forwarded.'
field :shared_runners_enabled, GraphQL::Types::Boolean, null: true,
description: 'Indicates if shared runners are enabled for the project.'
field :service_desk_enabled, GraphQL::Types::Boolean, null: true,
description: 'Indicates if the project has service desk enabled.'
......@@ -85,33 +85,33 @@ module Types
field :open_issues_count, GraphQL::Types::Int, null: true,
description: 'Number of open issues for the project.'
field :allow_merge_on_skipped_pipeline, GraphQL::Types::Boolean, null: true,
description: 'If `only_allow_merge_if_pipeline_succeeds` is true, indicates if merge requests of the project can also be merged with skipped jobs.'
field :autoclose_referenced_issues, GraphQL::Types::Boolean, null: true,
description: 'Indicates if issues referenced by merge requests and commits within the default branch are closed automatically.'
field :import_status, GraphQL::Types::String, null: true,
description: 'Status of import background job of the project.'
field :jira_import_status, GraphQL::Types::String, null: true,
description: 'Status of Jira import background job of the project.'
field :only_allow_merge_if_pipeline_succeeds, GraphQL::Types::Boolean, null: true,
description: 'Indicates if merge requests of the project can only be merged with successful jobs.'
field :allow_merge_on_skipped_pipeline, GraphQL::Types::Boolean, null: true,
description: 'If `only_allow_merge_if_pipeline_succeeds` is true, indicates if merge requests of the project can also be merged with skipped jobs.'
field :request_access_enabled, GraphQL::Types::Boolean, null: true,
description: 'Indicates if users can request member access to the project.'
field :only_allow_merge_if_all_discussions_are_resolved, GraphQL::Types::Boolean, null: true,
description: 'Indicates if merge requests of the project can only be merged when all the discussions are resolved.'
field :only_allow_merge_if_pipeline_succeeds, GraphQL::Types::Boolean, null: true,
description: 'Indicates if merge requests of the project can only be merged with successful jobs.'
field :printing_merge_request_link_enabled, GraphQL::Types::Boolean, null: true,
description: 'Indicates if a link to create or view a merge request should display after a push to Git repositories of the project from the command line.'
field :remove_source_branch_after_merge, GraphQL::Types::Boolean, null: true,
description: 'Indicates if `Delete source branch` option should be enabled by default for all new merge requests of the project.'
field :autoclose_referenced_issues, GraphQL::Types::Boolean, null: true,
description: 'Indicates if issues referenced by merge requests and commits within the default branch are closed automatically.'
field :suggestion_commit_message, GraphQL::Types::String, null: true,
description: 'Commit message used to apply merge request suggestions.'
field :request_access_enabled, GraphQL::Types::Boolean, null: true,
description: 'Indicates if users can request member access to the project.'
field :squash_read_only, GraphQL::Types::Boolean, null: false, method: :squash_readonly?,
description: 'Indicates if `squashReadOnly` is enabled.'
field :suggestion_commit_message, GraphQL::Types::String, null: true,
description: 'Commit message used to apply merge request suggestions.'
field :namespace, Types::NamespaceType, null: true,
description: 'Namespace of the project.'
field :group, Types::GroupType, null: true,
description: 'Group of the project.'
field :namespace, Types::NamespaceType, null: true,
description: 'Namespace of the project.'
field :statistics, Types::ProjectStatisticsType,
null: true,
......
......@@ -9,11 +9,11 @@ module Types
field :key, GraphQL::Types::String, null: false,
description: 'Key of the Jira project.'
field :name, GraphQL::Types::String, null: true,
description: 'Name of the Jira project.'
field :project_id, GraphQL::Types::Int, null: false,
description: 'ID of the Jira project.',
method: :id
field :name, GraphQL::Types::String, null: true,
description: 'Name of the Jira project.'
end
# rubocop:enable Graphql/AuthorizeTypes
end
......
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