Commit 0ec8ab44 authored by Siddharth Asthana's avatar Siddharth Asthana

Fix GraphQL/OrderedFields offenses

Changelog: other
parent 79795b40
...@@ -9,10 +9,10 @@ module Types ...@@ -9,10 +9,10 @@ module Types
authorize :read_package 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 :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 :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 :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 end
end end
......
...@@ -7,9 +7,9 @@ module Types ...@@ -7,9 +7,9 @@ module Types
description 'Represents a package dependency link' description 'Represents a package dependency link'
authorize :read_package 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, 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.' field :metadata, Types::Packages::DependencyLinkMetadataType, null: true, description: 'Dependency link metadata.'
# NOTE: This method must be kept in sync with the union # NOTE: This method must be kept in sync with the union
......
...@@ -7,17 +7,17 @@ module Types ...@@ -7,17 +7,17 @@ module Types
description 'Represents a package file' description 'Represents a package file'
authorize :read_package 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 :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 :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_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, field :file_metadata, Types::Packages::FileMetadataType, null: true,
description: 'File metadata.' 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 # NOTE: This method must be kept in sync with the union
# type: `Types::Packages::FileMetadataType`. # type: `Types::Packages::FileMetadataType`.
......
...@@ -7,9 +7,9 @@ module Types ...@@ -7,9 +7,9 @@ module Types
description 'Represents a package tag' description 'Represents a package tag'
authorize :read_package 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 :id, GraphQL::Types::ID, null: false, description: 'ID of the tag.'
field :name, GraphQL::Types::String, null: false, description: 'Name 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.' field :updated_at, Types::TimeType, null: false, description: 'Updated date.'
end end
end end
......
...@@ -13,23 +13,23 @@ module Types ...@@ -13,23 +13,23 @@ module Types
field :id, ::Types::GlobalIDType[::Packages::Package], null: false, field :id, ::Types::GlobalIDType[::Packages::Package], null: false,
description: 'ID of the package.' 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 :created_at, Types::TimeType, null: false, description: 'Date of creation.'
field :updated_at, Types::TimeType, null: false, description: 'Date of most recent update.' field :metadata, Types::Packages::MetadataType, null: true,
field :version, GraphQL::Types::String, null: true, description: 'Version string.' 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 :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, field :pipelines, Types::Ci::PipelineType.connection_type, null: true,
description: 'Pipelines that built the package.', description: 'Pipelines that built the package.',
deprecated: { reason: 'Due to scalability concerns, this field is going to be removed', milestone: '14.6' } deprecated: { reason: 'Due to scalability concerns, this field is going to be removed', milestone: '14.6' }
field :metadata, Types::Packages::MetadataType, null: true, field :project, Types::ProjectType, null: false, description: 'Project where the package is stored.'
description: 'Package metadata.' 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, field :versions, ::Types::Packages::PackageType.connection_type, null: true,
description: 'Other versions of the package.', description: 'Other versions of the package.',
deprecated: { reason: 'This field is now only returned in the PackageDetailsType', milestone: '13.11' } 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 def project
Gitlab::Graphql::Loaders::BatchModelLoader.new(Project, object.project_id).find Gitlab::Graphql::Loaders::BatchModelLoader.new(Project, object.project_id).find
......
...@@ -9,23 +9,23 @@ module Types ...@@ -9,23 +9,23 @@ module Types
field :commit_count, GraphQL::Types::Float, null: false, field :commit_count, GraphQL::Types::Float, null: false,
description: 'Commit count of the project.' 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, field :build_artifacts_size, GraphQL::Types::Float, null: false,
description: 'Build artifacts size of the project in bytes.' 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, field :packages_size, GraphQL::Types::Float, null: false,
description: 'Packages size of the project in bytes.' 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, field :pipeline_artifacts_size, GraphQL::Types::Float, null: true,
description: 'CI Pipeline artifacts size in bytes.' 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, field :uploads_size, GraphQL::Types::Float, null: true,
description: 'Uploads size of the project in bytes.' 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
end end
...@@ -11,21 +11,21 @@ module Types ...@@ -11,21 +11,21 @@ module Types
field :id, GraphQL::Types::ID, null: false, field :id, GraphQL::Types::ID, null: false,
description: 'ID of the project.' 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, field :full_path, GraphQL::Types::ID, null: false,
description: 'Full path of the project.' description: 'Full path of the project.'
field :path, GraphQL::Types::String, null: false, field :path, GraphQL::Types::String, null: false,
description: 'Path of the project.' 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, field :sast_ci_configuration, Types::CiConfiguration::Sast::Type, null: true,
calls_gitaly: true, calls_gitaly: true,
description: 'SAST CI configuration for the project.' 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, field :name, GraphQL::Types::String, null: false,
description: 'Name of the project (without namespace).' 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, field :description, GraphQL::Types::String, null: true,
description: 'Short description of the project.' description: 'Short description of the project.'
...@@ -37,17 +37,17 @@ module Types ...@@ -37,17 +37,17 @@ module Types
field :topics, [GraphQL::Types::String], null: true, field :topics, [GraphQL::Types::String], null: true,
description: 'List of project topics.' 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, field :http_url_to_repo, GraphQL::Types::String, null: true,
description: 'URL to connect to the project via HTTPS.' 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, field :web_url, GraphQL::Types::String, null: true,
description: 'Web URL of the project.' 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 field :forks_count, GraphQL::Types::Int, null: false, calls_gitaly: true, # 4 times
description: 'Number of times the project has been forked.' 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, field :created_at, Types::TimeType, null: true,
description: 'Timestamp of the project creation.' description: 'Timestamp of the project creation.'
...@@ -60,12 +60,12 @@ module Types ...@@ -60,12 +60,12 @@ module Types
field :visibility, GraphQL::Types::String, null: true, field :visibility, GraphQL::Types::String, null: true,
description: 'Visibility of the project.' 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, field :lfs_enabled, GraphQL::Types::Boolean, null: true,
description: 'Indicates if the project has Large File Storage (LFS) enabled.' description: 'Indicates if the project has Large File Storage (LFS) enabled.'
field :merge_requests_ff_only_enabled, GraphQL::Types::Boolean, null: true, 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.' 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, field :service_desk_enabled, GraphQL::Types::Boolean, null: true,
description: 'Indicates if the project has service desk enabled.' description: 'Indicates if the project has service desk enabled.'
...@@ -85,33 +85,33 @@ module Types ...@@ -85,33 +85,33 @@ module Types
field :open_issues_count, GraphQL::Types::Int, null: true, field :open_issues_count, GraphQL::Types::Int, null: true,
description: 'Number of open issues for the project.' 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, field :import_status, GraphQL::Types::String, null: true,
description: 'Status of import background job of the project.' description: 'Status of import background job of the project.'
field :jira_import_status, GraphQL::Types::String, null: true, field :jira_import_status, GraphQL::Types::String, null: true,
description: 'Status of Jira import background job of the project.' 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, 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.' 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, 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.' 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, 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.' 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, field :request_access_enabled, GraphQL::Types::Boolean, null: true,
description: 'Indicates if issues referenced by merge requests and commits within the default branch are closed automatically.' description: 'Indicates if users can request member access to the project.'
field :suggestion_commit_message, GraphQL::Types::String, null: true,
description: 'Commit message used to apply merge request suggestions.'
field :squash_read_only, GraphQL::Types::Boolean, null: false, method: :squash_readonly?, field :squash_read_only, GraphQL::Types::Boolean, null: false, method: :squash_readonly?,
description: 'Indicates if `squashReadOnly` is enabled.' 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, field :group, Types::GroupType, null: true,
description: 'Group of the project.' description: 'Group of the project.'
field :namespace, Types::NamespaceType, null: true,
description: 'Namespace of the project.'
field :statistics, Types::ProjectStatisticsType, field :statistics, Types::ProjectStatisticsType,
null: true, null: true,
......
...@@ -9,11 +9,11 @@ module Types ...@@ -9,11 +9,11 @@ module Types
field :key, GraphQL::Types::String, null: false, field :key, GraphQL::Types::String, null: false,
description: 'Key of the Jira project.' 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, field :project_id, GraphQL::Types::Int, null: false,
description: 'ID of the Jira project.', description: 'ID of the Jira project.',
method: :id method: :id
field :name, GraphQL::Types::String, null: true,
description: 'Name of the Jira project.'
end end
# rubocop:enable Graphql/AuthorizeTypes # rubocop:enable Graphql/AuthorizeTypes
end 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