Add short_revision and use total_size

This commit is contained in:
Kamil Trzcinski 2017-10-17 16:58:28 +02:00
parent 57d331d751
commit 5ee58c1c06
6 changed files with 15 additions and 5 deletions

View file

@ -38,7 +38,7 @@ export default {
tag: element.name,
revision: element.revision,
shortRevision: element.short_revision,
size: element.size,
size: element.total_size,
layers: element.layers,
location: element.location,
createdAt: element.created_at,

View file

@ -1,7 +1,7 @@
class ContainerTagEntity < Grape::Entity
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|
project_registry_repository_tag_path(project, tag.repository, tag.name, format: :json)

View file

@ -0,0 +1,5 @@
---
title: Fix revision and total size missing for Container Registry
merge_request:
author:
type: fixed

View file

@ -14,6 +14,11 @@
"revision": {
"type": "string"
},
"short_revision": {
"type": "string",
"minLength": 8,
"maxLength": 8
},
"total_size": {
"type": "integer"
},

View file

@ -26,7 +26,7 @@ export const registryServerResponse = [
name: 'centos7',
short_revision: 'b118ab5b0',
revision: 'b118ab5b0e90b7cb5127db31d5321ac14961d097516a8e0e72084b6cdc783b43',
size: 679,
total_size: 679,
layers: 19,
location: 'location',
created_at: 1505828744434,
@ -36,7 +36,7 @@ export const registryServerResponse = [
name: 'centos6',
short_revision: 'b118ab5b0',
revision: 'b118ab5b0e90b7cb5127db31d5321ac14961d097516a8e0e72084b6cdc783b43',
size: 679,
total_size: 679,
layers: 19,
location: 'location',
created_at: 1505828744434,

View file

@ -22,7 +22,7 @@ describe ContainerTagEntity do
end
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
context 'when user can manage repositories' do