Commit cdd241d2 authored by Luke Duncalfe's avatar Luke Duncalfe

Merge branch...

Merge branch '216795-add-visibility-and-last-published-information-to-the-image-repository-detail-view' into 'master'

Add project to container_registry graphql type

See merge request gitlab-org/gitlab!49019
parents d63d3e1d af7c5ef5
......@@ -19,9 +19,14 @@ module Types
field :status, Types::ContainerRepositoryStatusEnum, null: true, description: 'Status of the container repository.'
field :tags_count, GraphQL::INT_TYPE, null: false, description: 'Number of tags associated with this image.'
field :can_delete, GraphQL::BOOLEAN_TYPE, null: false, description: 'Can the current user delete the container repository.'
field :project, Types::ProjectType, null: false, description: 'Project of the container registry'
def can_delete
Ability.allowed?(current_user, :update_container_image, object)
end
def project
Gitlab::Graphql::Loaders::BatchModelLoader.new(Project, object.project_id).find
end
end
end
---
title: Add Project to ContainerRepository GraphQL type
merge_request: 49019
author:
type: added
......@@ -3510,6 +3510,11 @@ type ContainerRepository {
"""
path: String!
"""
Project of the container registry
"""
project: Project!
"""
Status of the container repository.
"""
......@@ -3615,6 +3620,11 @@ type ContainerRepositoryDetails {
"""
path: String!
"""
Project of the container registry
"""
project: Project!
"""
Status of the container repository.
"""
......
......@@ -9598,6 +9598,24 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "project",
"description": "Project of the container registry",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "Project",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "status",
"description": "Status of the container repository.",
......@@ -9899,6 +9917,24 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "project",
"description": "Project of the container registry",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "Project",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "status",
"description": "Status of the container repository.",
......@@ -592,6 +592,7 @@ A container repository.
| `location` | String! | URL of the container repository. |
| `name` | String! | Name of the container repository. |
| `path` | String! | Path of the container repository. |
| `project` | Project! | Project of the container registry |
| `status` | ContainerRepositoryStatus | Status of the container repository. |
| `tagsCount` | Int! | Number of tags associated with this image. |
| `updatedAt` | Time! | Timestamp when the container repository was updated. |
......@@ -610,6 +611,7 @@ Details of a container repository.
| `location` | String! | URL of the container repository. |
| `name` | String! | Name of the container repository. |
| `path` | String! | Path of the container repository. |
| `project` | Project! | Project of the container registry |
| `status` | ContainerRepositoryStatus | Status of the container repository. |
| `tags` | ContainerRepositoryTagConnection | Tags of the container repository |
| `tagsCount` | Int! | Number of tags associated with this image. |
......
{
"type": "object",
"required": ["id", "name", "path", "location", "createdAt", "updatedAt", "tagsCount", "canDelete", "expirationPolicyCleanupStatus"],
"required": ["id", "name", "path", "location", "createdAt", "updatedAt", "tagsCount", "canDelete", "expirationPolicyCleanupStatus", "project"],
"properties": {
"id": {
"type": "string"
......@@ -35,6 +35,9 @@
"expirationPolicyCleanupStatus": {
"type": "string",
"enum": ["UNSCHEDULED", "SCHEDULED", "UNFINISHED", "ONGOING"]
},
"project": {
"type": "object"
}
}
}
......@@ -3,7 +3,7 @@
require 'spec_helper'
RSpec.describe GitlabSchema.types['ContainerRepositoryDetails'] do
fields = %i[id name path location created_at updated_at expiration_policy_started_at status tags_count can_delete expiration_policy_cleanup_status tags]
fields = %i[id name path location created_at updated_at expiration_policy_started_at status tags_count can_delete expiration_policy_cleanup_status tags project]
it { expect(described_class.graphql_name).to eq('ContainerRepositoryDetails') }
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
RSpec.describe GitlabSchema.types['ContainerRepository'] do
fields = %i[id name path location created_at updated_at expiration_policy_started_at status tags_count can_delete expiration_policy_cleanup_status]
fields = %i[id name path location created_at updated_at expiration_policy_started_at status tags_count can_delete expiration_policy_cleanup_status project]
it { expect(described_class.graphql_name).to eq('ContainerRepository') }
......
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