Skip to content
Snippets Groups Projects
Commit b7dfe2ae authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent 25cb337c
No related branches found
No related tags found
No related merge requests found
Showing
with 99 additions and 75 deletions
Loading
Loading
@@ -9,7 +9,7 @@ module Types
 
expose_permissions Types::PermissionTypes::Note
 
field :id, GraphQL::ID_TYPE, null: false
field :id, GraphQL::ID_TYPE, null: false # rubocop:disable Graphql/Descriptions
 
field :project, Types::ProjectType,
null: true,
Loading
Loading
@@ -37,10 +37,10 @@ module Types
 
markdown_field :body_html, null: true, method: :note
 
field :created_at, Types::TimeType, null: false
field :updated_at, Types::TimeType, null: false
field :created_at, Types::TimeType, null: false # rubocop:disable Graphql/Descriptions
field :updated_at, Types::TimeType, null: false # rubocop:disable Graphql/Descriptions
field :discussion, Types::Notes::DiscussionType, null: true, description: "The discussion this note is a part of"
field :resolvable, GraphQL::BOOLEAN_TYPE, null: false, method: :resolvable?
field :resolvable, GraphQL::BOOLEAN_TYPE, null: false, method: :resolvable? # rubocop:disable Graphql/Descriptions
field :resolved_at, Types::TimeType, null: true, description: "The time the discussion was resolved"
field :position, Types::Notes::DiffPositionType, null: true, description: "The position of this note on a diff"
end
Loading
Loading
Loading
Loading
@@ -23,3 +23,5 @@ module Types
end
end
end
Types::Notes::NoteableType.extend_if_ee('::EE::Types::Notes::NoteableType')
Loading
Loading
@@ -28,7 +28,7 @@ module Types
description: "Whether or not a user can perform `#{name}` on this resource",
null: false)
 
field(**kword_args)
field(**kword_args) # rubocop:disable Graphql/Descriptions
end
 
def self.resolving_keywords?(arguments)
Loading
Loading
Loading
Loading
@@ -12,3 +12,5 @@ module Types
end
end
end
Types::PermissionTypes::Issue.prepend_if_ee('::EE::Types::PermissionTypes::Issue')
Loading
Loading
@@ -20,3 +20,5 @@ module Types
end
end
end
Types::PermissionTypes::Project.prepend_if_ee('EE::Types::PermissionTypes::Project')
Loading
Loading
@@ -6,13 +6,13 @@ module Types
 
authorize :read_statistics
 
field :commit_count, GraphQL::INT_TYPE, null: false
field :commit_count, GraphQL::INT_TYPE, null: false # rubocop:disable Graphql/Descriptions
 
field :storage_size, GraphQL::INT_TYPE, null: false
field :repository_size, GraphQL::INT_TYPE, null: false
field :lfs_objects_size, GraphQL::INT_TYPE, null: false
field :build_artifacts_size, GraphQL::INT_TYPE, null: false
field :packages_size, GraphQL::INT_TYPE, null: false
field :wiki_size, GraphQL::INT_TYPE, null: true
field :storage_size, GraphQL::INT_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :repository_size, GraphQL::INT_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :lfs_objects_size, GraphQL::INT_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :build_artifacts_size, GraphQL::INT_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :packages_size, GraphQL::INT_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :wiki_size, GraphQL::INT_TYPE, null: true # rubocop:disable Graphql/Descriptions
end
end
Loading
Loading
@@ -8,95 +8,95 @@ module Types
 
expose_permissions Types::PermissionTypes::Project
 
field :id, GraphQL::ID_TYPE, null: false
field :id, GraphQL::ID_TYPE, null: false # rubocop:disable Graphql/Descriptions
 
field :full_path, GraphQL::ID_TYPE, null: false
field :path, GraphQL::STRING_TYPE, null: false
field :full_path, GraphQL::ID_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :path, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
 
field :name_with_namespace, GraphQL::STRING_TYPE, null: false
field :name, GraphQL::STRING_TYPE, null: false
field :name_with_namespace, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :name, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
 
field :description, GraphQL::STRING_TYPE, null: true
field :description, GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
markdown_field :description_html, null: true
 
field :tag_list, GraphQL::STRING_TYPE, null: true
field :tag_list, GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
 
field :ssh_url_to_repo, GraphQL::STRING_TYPE, null: true
field :http_url_to_repo, GraphQL::STRING_TYPE, null: true
field :web_url, GraphQL::STRING_TYPE, null: true
field :ssh_url_to_repo, GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :http_url_to_repo, GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :web_url, GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
 
field :star_count, GraphQL::INT_TYPE, null: false
field :forks_count, GraphQL::INT_TYPE, null: false, calls_gitaly: true # 4 times
field :star_count, GraphQL::INT_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :forks_count, GraphQL::INT_TYPE, null: false, calls_gitaly: true # 4 times # rubocop:disable Graphql/Descriptions
 
field :created_at, Types::TimeType, null: true
field :last_activity_at, Types::TimeType, null: true
field :created_at, Types::TimeType, null: true # rubocop:disable Graphql/Descriptions
field :last_activity_at, Types::TimeType, null: true # rubocop:disable Graphql/Descriptions
 
field :archived, GraphQL::BOOLEAN_TYPE, null: true
field :archived, GraphQL::BOOLEAN_TYPE, null: true # rubocop:disable Graphql/Descriptions
 
field :visibility, GraphQL::STRING_TYPE, null: true
field :visibility, GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
 
field :container_registry_enabled, GraphQL::BOOLEAN_TYPE, null: true
field :shared_runners_enabled, GraphQL::BOOLEAN_TYPE, null: true
field :lfs_enabled, GraphQL::BOOLEAN_TYPE, null: true
field :merge_requests_ff_only_enabled, GraphQL::BOOLEAN_TYPE, null: true
field :container_registry_enabled, GraphQL::BOOLEAN_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :shared_runners_enabled, GraphQL::BOOLEAN_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :lfs_enabled, GraphQL::BOOLEAN_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :merge_requests_ff_only_enabled, GraphQL::BOOLEAN_TYPE, null: true # rubocop:disable Graphql/Descriptions
 
field :avatar_url, GraphQL::STRING_TYPE, null: true, calls_gitaly: true, resolve: -> (project, args, ctx) do
field :avatar_url, GraphQL::STRING_TYPE, null: true, calls_gitaly: true, resolve: -> (project, args, ctx) do # rubocop:disable Graphql/Descriptions
project.avatar_url(only_path: false)
end
 
%i[issues merge_requests wiki snippets].each do |feature|
field "#{feature}_enabled", GraphQL::BOOLEAN_TYPE, null: true, resolve: -> (project, args, ctx) do
field "#{feature}_enabled", GraphQL::BOOLEAN_TYPE, null: true, resolve: -> (project, args, ctx) do # rubocop:disable Graphql/Descriptions
project.feature_available?(feature, ctx[:current_user])
end
end
 
field :jobs_enabled, GraphQL::BOOLEAN_TYPE, null: true, resolve: -> (project, args, ctx) do
field :jobs_enabled, GraphQL::BOOLEAN_TYPE, null: true, resolve: -> (project, args, ctx) do # rubocop:disable Graphql/Descriptions
project.feature_available?(:builds, ctx[:current_user])
end
 
field :public_jobs, GraphQL::BOOLEAN_TYPE, method: :public_builds, null: true
field :public_jobs, GraphQL::BOOLEAN_TYPE, method: :public_builds, null: true # rubocop:disable Graphql/Descriptions
 
field :open_issues_count, GraphQL::INT_TYPE, null: true, resolve: -> (project, args, ctx) do
field :open_issues_count, GraphQL::INT_TYPE, null: true, resolve: -> (project, args, ctx) do # rubocop:disable Graphql/Descriptions
project.open_issues_count if project.feature_available?(:issues, ctx[:current_user])
end
 
field :import_status, GraphQL::STRING_TYPE, null: true
field :import_status, GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
 
field :only_allow_merge_if_pipeline_succeeds, GraphQL::BOOLEAN_TYPE, null: true
field :request_access_enabled, GraphQL::BOOLEAN_TYPE, null: true
field :only_allow_merge_if_all_discussions_are_resolved, GraphQL::BOOLEAN_TYPE, null: true
field :printing_merge_request_link_enabled, GraphQL::BOOLEAN_TYPE, null: true
field :only_allow_merge_if_pipeline_succeeds, GraphQL::BOOLEAN_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :request_access_enabled, GraphQL::BOOLEAN_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :only_allow_merge_if_all_discussions_are_resolved, GraphQL::BOOLEAN_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :printing_merge_request_link_enabled, GraphQL::BOOLEAN_TYPE, null: true # rubocop:disable Graphql/Descriptions
 
field :namespace, Types::NamespaceType, null: true
field :group, Types::GroupType, null: true
field :namespace, Types::NamespaceType, null: true # rubocop:disable Graphql/Descriptions
field :group, Types::GroupType, null: true # rubocop:disable Graphql/Descriptions
 
field :statistics, Types::ProjectStatisticsType,
field :statistics, Types::ProjectStatisticsType, # rubocop:disable Graphql/Descriptions
null: true,
resolve: -> (obj, _args, _ctx) { Gitlab::Graphql::Loaders::BatchProjectStatisticsLoader.new(obj.id).find }
 
field :repository, Types::RepositoryType, null: true
field :repository, Types::RepositoryType, null: true # rubocop:disable Graphql/Descriptions
 
field :merge_requests,
field :merge_requests, # rubocop:disable Graphql/Descriptions
Types::MergeRequestType.connection_type,
null: true,
resolver: Resolvers::MergeRequestsResolver
 
field :merge_request,
field :merge_request, # rubocop:disable Graphql/Descriptions
Types::MergeRequestType,
null: true,
resolver: Resolvers::MergeRequestsResolver.single
 
field :issues,
field :issues, # rubocop:disable Graphql/Descriptions
Types::IssueType.connection_type,
null: true,
resolver: Resolvers::IssuesResolver
 
field :issue,
field :issue, # rubocop:disable Graphql/Descriptions
Types::IssueType,
null: true,
resolver: Resolvers::IssuesResolver.single
 
field :pipelines,
field :pipelines, # rubocop:disable Graphql/Descriptions
Types::Ci::PipelineType.connection_type,
null: true,
resolver: Resolvers::ProjectPipelinesResolver
Loading
Loading
Loading
Loading
@@ -24,6 +24,6 @@ module Types
resolver: Resolvers::MetadataResolver,
description: 'Metadata about GitLab'
 
field :echo, GraphQL::STRING_TYPE, null: false, resolver: Resolvers::EchoResolver
field :echo, GraphQL::STRING_TYPE, null: false, resolver: Resolvers::EchoResolver # rubocop:disable Graphql/Descriptions
end
end
Loading
Loading
@@ -6,9 +6,9 @@ module Types
 
authorize :download_code
 
field :root_ref, GraphQL::STRING_TYPE, null: true, calls_gitaly: true
field :empty, GraphQL::BOOLEAN_TYPE, null: false, method: :empty?, calls_gitaly: true
field :exists, GraphQL::BOOLEAN_TYPE, null: false, method: :exists?
field :tree, Types::Tree::TreeType, null: true, resolver: Resolvers::TreeResolver, calls_gitaly: true
field :root_ref, GraphQL::STRING_TYPE, null: true, calls_gitaly: true # rubocop:disable Graphql/Descriptions
field :empty, GraphQL::BOOLEAN_TYPE, null: false, method: :empty?, calls_gitaly: true # rubocop:disable Graphql/Descriptions
field :exists, GraphQL::BOOLEAN_TYPE, null: false, method: :exists? # rubocop:disable Graphql/Descriptions
field :tree, Types::Tree::TreeType, null: true, resolver: Resolvers::TreeResolver, calls_gitaly: true # rubocop:disable Graphql/Descriptions
end
end
Loading
Loading
@@ -8,8 +8,8 @@ module Types
graphql_name 'TaskCompletionStatus'
description 'Completion status of tasks'
 
field :count, GraphQL::INT_TYPE, null: false
field :completed_count, GraphQL::INT_TYPE, null: false
field :count, GraphQL::INT_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :completed_count, GraphQL::INT_TYPE, null: false # rubocop:disable Graphql/Descriptions
end
# rubocop: enable Graphql/AuthorizeTypes
end
Loading
Loading
@@ -10,8 +10,8 @@ module Types
 
graphql_name 'Blob'
 
field :web_url, GraphQL::STRING_TYPE, null: true
field :lfs_oid, GraphQL::STRING_TYPE, null: true, resolve: -> (blob, args, ctx) do
field :web_url, GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :lfs_oid, GraphQL::STRING_TYPE, null: true, resolve: -> (blob, args, ctx) do # rubocop:disable Graphql/Descriptions
Gitlab::Graphql::Loaders::BatchLfsOidLoader.new(blob.repository, blob.id).find
end
# rubocop: enable Graphql/AuthorizeTypes
Loading
Loading
Loading
Loading
@@ -4,11 +4,11 @@ module Types
module EntryType
include Types::BaseInterface
 
field :id, GraphQL::ID_TYPE, null: false
field :name, GraphQL::STRING_TYPE, null: false
field :type, Tree::TypeEnum, null: false
field :path, GraphQL::STRING_TYPE, null: false
field :flat_path, GraphQL::STRING_TYPE, null: false
field :id, GraphQL::ID_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :name, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :type, Tree::TypeEnum, null: false # rubocop:disable Graphql/Descriptions
field :path, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :flat_path, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
end
end
end
Loading
Loading
@@ -8,8 +8,8 @@ module Types
 
graphql_name 'Submodule'
 
field :web_url, type: GraphQL::STRING_TYPE, null: true
field :tree_url, type: GraphQL::STRING_TYPE, null: true
field :web_url, type: GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :tree_url, type: GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
end
# rubocop: enable Graphql/AuthorizeTypes
end
Loading
Loading
Loading
Loading
@@ -11,7 +11,7 @@ module Types
graphql_name 'TreeEntry'
description 'Represents a directory'
 
field :web_url, GraphQL::STRING_TYPE, null: true
field :web_url, GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
end
# rubocop: enable Graphql/AuthorizeTypes
end
Loading
Loading
Loading
Loading
@@ -7,19 +7,21 @@ module Types
graphql_name 'Tree'
 
# Complexity 10 as it triggers a Gitaly call on each render
field :last_commit, Types::CommitType, null: true, complexity: 10, calls_gitaly: true, resolve: -> (tree, args, ctx) do
field :last_commit, Types::CommitType, null: true, complexity: 10, calls_gitaly: true, resolve: -> (tree, args, ctx) do # rubocop:disable Graphql/Descriptions
tree.repository.last_commit_for_path(tree.sha, tree.path)
end
 
field :trees, Types::Tree::TreeEntryType.connection_type, null: false, resolve: -> (obj, args, ctx) do
field :trees, Types::Tree::TreeEntryType.connection_type, null: false, resolve: -> (obj, args, ctx) do # rubocop:disable Graphql/Descriptions
Gitlab::Graphql::Representation::TreeEntry.decorate(obj.trees, obj.repository)
end
 
# rubocop:disable Graphql/Descriptions
field :submodules, Types::Tree::SubmoduleType.connection_type, null: false, calls_gitaly: true, resolve: -> (obj, args, ctx) do
Gitlab::Graphql::Representation::SubmoduleTreeEntry.decorate(obj.submodules, obj)
end
# rubocop:enable Graphql/Descriptions
 
field :blobs, Types::Tree::BlobType.connection_type, null: false, calls_gitaly: true, resolve: -> (obj, args, ctx) do
field :blobs, Types::Tree::BlobType.connection_type, null: false, calls_gitaly: true, resolve: -> (obj, args, ctx) do # rubocop:disable Graphql/Descriptions
Gitlab::Graphql::Representation::TreeEntry.decorate(obj.blobs, obj.repository)
end
# rubocop: enable Graphql/AuthorizeTypes
Loading
Loading
Loading
Loading
@@ -8,9 +8,9 @@ module Types
 
present_using UserPresenter
 
field :name, GraphQL::STRING_TYPE, null: false
field :username, GraphQL::STRING_TYPE, null: false
field :avatar_url, GraphQL::STRING_TYPE, null: false
field :web_url, GraphQL::STRING_TYPE, null: false
field :name, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :username, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :avatar_url, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :web_url, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
end
end
Loading
Loading
@@ -78,3 +78,5 @@ module AppearancesHelper
style.join
end
end
AppearancesHelper.prepend_if_ee('EE::AppearancesHelper')
Loading
Loading
@@ -325,3 +325,5 @@ module ApplicationHelper
::Appearance.current
end
end
ApplicationHelper.prepend_if_ee('EE::ApplicationHelper')
Loading
Loading
@@ -309,3 +309,9 @@ module ApplicationSettingsHelper
can?(current_user, :read_cluster, Clusters::Instance.new)
end
end
ApplicationSettingsHelper.prepend_if_ee('EE::ApplicationSettingsHelper') # rubocop: disable Cop/InjectEnterpriseEditionModule
# The methods in `EE::ApplicationSettingsHelper` should be available as both
# instance and class methods.
ApplicationSettingsHelper.extend_if_ee('EE::ApplicationSettingsHelper')
Loading
Loading
@@ -110,3 +110,9 @@ module AuthHelper
 
extend self
end
AuthHelper.prepend_if_ee('EE::AuthHelper') # rubocop: disable Cop/InjectEnterpriseEditionModule
# The methods added in EE should be available as both class and instance
# methods, just like the methods provided by `AuthHelper` itself.
AuthHelper.extend_if_ee('EE::AuthHelper')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment