Class: Types::ContainerRegistry::ContainerRepositoryType
- Inherits:
-
BaseObject
- Object
- GraphQL::Schema::Object
- BaseObject
- Types::ContainerRegistry::ContainerRepositoryType
- Defined in:
- app/graphql/types/container_registry/container_repository_type.rb
Direct Known Subclasses
Constant Summary
Constants included from Gitlab::Graphql::Authorize::AuthorizeResource
Gitlab::Graphql::Authorize::AuthorizeResource::ConfigurationError, Gitlab::Graphql::Authorize::AuthorizeResource::RESOURCE_ACCESS_ERROR
Instance Method Summary collapse
-
#migration_state ⇒ Object
The migration has now completed and we are cleaning up the migration db columns.
- #project ⇒ Object
- #protection_rule_exists ⇒ Object
- #tags_count ⇒ Object
Methods included from Gitlab::Graphql::Authorize::AuthorizeResource
#authorize!, #authorized_find!, #authorized_resource?, #find_object, #raise_resource_not_available_error!
Methods inherited from BaseObject
accepts, assignable?, authorization, authorization_scopes, authorize, authorized?, #current_user, #id
Methods included from Gitlab::Graphql::Present
Instance Method Details
#migration_state ⇒ Object
The migration has now completed and we are cleaning up the migration db columns. For backward compatibility, we are keeping this field accessible. This field will be removed in 18.0.
67 68 69 |
# File 'app/graphql/types/container_registry/container_repository_type.rb', line 67 def migration_state '' end |
#project ⇒ Object
51 52 53 |
# File 'app/graphql/types/container_registry/container_repository_type.rb', line 51 def project Gitlab::Graphql::Loaders::BatchModelLoader.new(Project, object.project_id).find end |
#protection_rule_exists ⇒ Object
71 72 73 74 75 76 77 78 79 |
# File 'app/graphql/types/container_registry/container_repository_type.rb', line 71 def protection_rule_exists return false if Feature.disabled?(:container_registry_protected_containers, object.project.root_ancestor) BatchLoader::GraphQL.for(object.path).batch do |repository_paths, loader| ::ContainerRegistry::Protection::Rule .for_push_exists_for_multiple_containers(repository_paths: repository_paths, project_id: object.project_id) .each { |row| loader.call(row['repository_path'], row['protected']) } end end |
#tags_count ⇒ Object
55 56 57 58 59 60 61 62 |
# File 'app/graphql/types/container_registry/container_repository_type.rb', line 55 def object. rescue Faraday::Error raise_resource_not_available_error!( 'We are having trouble connecting to the Container Registry. ' \ 'If this error persists, please review the troubleshooting documentation.' ) end |