BigW Consortium Gitlab

Commit 0fa2f148 by Grzegorz Bizon

Merge branch 'kt/bug/fix-revision-and-size-for-container-registry' into 'master'

Add short_revision and use total_size Closes #39203 See merge request gitlab-org/gitlab-ce!14917
parents 1090514a 6ac0a69b
...@@ -38,7 +38,7 @@ export default { ...@@ -38,7 +38,7 @@ export default {
tag: element.name, tag: element.name,
revision: element.revision, revision: element.revision,
shortRevision: element.short_revision, shortRevision: element.short_revision,
size: element.size, size: element.total_size,
layers: element.layers, layers: element.layers,
location: element.location, location: element.location,
createdAt: element.created_at, createdAt: element.created_at,
......
class ContainerTagEntity < Grape::Entity class ContainerTagEntity < Grape::Entity
include RequestAwareEntity include RequestAwareEntity
expose :name, :location, :revision, :total_size, :created_at expose :name, :location, :revision, :short_revision, :total_size, :created_at
expose :destroy_path, if: -> (*) { can_destroy? } do |tag| expose :destroy_path, if: -> (*) { can_destroy? } do |tag|
project_registry_repository_tag_path(project, tag.repository, tag.name, format: :json) project_registry_repository_tag_path(project, tag.repository, tag.name, format: :json)
......
---
title: Fix revision and total size missing for Container Registry
merge_request:
author:
type: fixed
...@@ -14,6 +14,11 @@ ...@@ -14,6 +14,11 @@
"revision": { "revision": {
"type": "string" "type": "string"
}, },
"short_revision": {
"type": "string",
"minLength": 9,
"maxLength": 9
},
"total_size": { "total_size": {
"type": "integer" "type": "integer"
}, },
......
...@@ -26,7 +26,7 @@ export const registryServerResponse = [ ...@@ -26,7 +26,7 @@ export const registryServerResponse = [
name: 'centos7', name: 'centos7',
short_revision: 'b118ab5b0', short_revision: 'b118ab5b0',
revision: 'b118ab5b0e90b7cb5127db31d5321ac14961d097516a8e0e72084b6cdc783b43', revision: 'b118ab5b0e90b7cb5127db31d5321ac14961d097516a8e0e72084b6cdc783b43',
size: 679, total_size: 679,
layers: 19, layers: 19,
location: 'location', location: 'location',
created_at: 1505828744434, created_at: 1505828744434,
...@@ -36,7 +36,7 @@ export const registryServerResponse = [ ...@@ -36,7 +36,7 @@ export const registryServerResponse = [
name: 'centos6', name: 'centos6',
short_revision: 'b118ab5b0', short_revision: 'b118ab5b0',
revision: 'b118ab5b0e90b7cb5127db31d5321ac14961d097516a8e0e72084b6cdc783b43', revision: 'b118ab5b0e90b7cb5127db31d5321ac14961d097516a8e0e72084b6cdc783b43',
size: 679, total_size: 679,
layers: 19, layers: 19,
location: 'location', location: 'location',
created_at: 1505828744434, created_at: 1505828744434,
...@@ -70,7 +70,7 @@ export const parsedRegistryServerResponse = [ ...@@ -70,7 +70,7 @@ export const parsedRegistryServerResponse = [
tag: registryServerResponse[0].name, tag: registryServerResponse[0].name,
revision: registryServerResponse[0].revision, revision: registryServerResponse[0].revision,
shortRevision: registryServerResponse[0].short_revision, shortRevision: registryServerResponse[0].short_revision,
size: registryServerResponse[0].size, size: registryServerResponse[0].total_size,
layers: registryServerResponse[0].layers, layers: registryServerResponse[0].layers,
location: registryServerResponse[0].location, location: registryServerResponse[0].location,
createdAt: registryServerResponse[0].created_at, createdAt: registryServerResponse[0].created_at,
...@@ -81,7 +81,7 @@ export const parsedRegistryServerResponse = [ ...@@ -81,7 +81,7 @@ export const parsedRegistryServerResponse = [
tag: registryServerResponse[1].name, tag: registryServerResponse[1].name,
revision: registryServerResponse[1].revision, revision: registryServerResponse[1].revision,
shortRevision: registryServerResponse[1].short_revision, shortRevision: registryServerResponse[1].short_revision,
size: registryServerResponse[1].size, size: registryServerResponse[1].total_size,
layers: registryServerResponse[1].layers, layers: registryServerResponse[1].layers,
location: registryServerResponse[1].location, location: registryServerResponse[1].location,
createdAt: registryServerResponse[1].created_at, createdAt: registryServerResponse[1].created_at,
......
...@@ -22,7 +22,7 @@ describe ContainerTagEntity do ...@@ -22,7 +22,7 @@ describe ContainerTagEntity do
end end
it 'exposes required informations' do it 'exposes required informations' do
expect(subject).to include(:name, :location, :revision, :total_size, :created_at) expect(subject).to include(:name, :location, :revision, :short_revision, :total_size, :created_at)
end end
context 'when user can manage repositories' do context 'when user can manage repositories' do
......
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