summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2017-10-18 09:02:32 +0000
committerWinnie Hellmann <winnie@gitlab.com>2017-10-18 09:21:48 +0000
commit5b96af98521f583cb9a63270c4060f19095a86ac (patch)
treed73b9da4374dbe25e9166fa0389c815da71efa1a
parentbb1dd1258a328923669e7cbe8e186012a3c25689 (diff)
downloadgitlab-ce-5b96af98521f583cb9a63270c4060f19095a86ac.tar.gz
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 (cherry picked from commit 0fa2f14857ceb5b5b52595555bb2c3e6e930e1f7) 5ee58c1c Add short_revision and use total_size 6d2338c7 Fix failed test 6ac0a69b Fix broken test
-rw-r--r--app/assets/javascripts/registry/stores/mutations.js2
-rw-r--r--app/serializers/container_tag_entity.rb2
-rw-r--r--changelogs/unreleased/kt-bug-fix-revision-and-size-for-container-registry.yml5
-rw-r--r--spec/fixtures/api/schemas/registry/tag.json5
-rw-r--r--spec/javascripts/registry/mock_data.js8
-rw-r--r--spec/serializers/container_tag_entity_spec.rb2
6 files changed, 17 insertions, 7 deletions
diff --git a/app/assets/javascripts/registry/stores/mutations.js b/app/assets/javascripts/registry/stores/mutations.js
index e40382e7afc..208c3c39866 100644
--- a/app/assets/javascripts/registry/stores/mutations.js
+++ b/app/assets/javascripts/registry/stores/mutations.js
@@ -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,
diff --git a/app/serializers/container_tag_entity.rb b/app/serializers/container_tag_entity.rb
index ec1fc349586..26a68c43807 100644
--- a/app/serializers/container_tag_entity.rb
+++ b/app/serializers/container_tag_entity.rb
@@ -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)
diff --git a/changelogs/unreleased/kt-bug-fix-revision-and-size-for-container-registry.yml b/changelogs/unreleased/kt-bug-fix-revision-and-size-for-container-registry.yml
new file mode 100644
index 00000000000..acbb24d16fc
--- /dev/null
+++ b/changelogs/unreleased/kt-bug-fix-revision-and-size-for-container-registry.yml
@@ -0,0 +1,5 @@
+---
+title: Fix revision and total size missing for Container Registry
+merge_request:
+author:
+type: fixed
diff --git a/spec/fixtures/api/schemas/registry/tag.json b/spec/fixtures/api/schemas/registry/tag.json
index 5bc307e0e64..3a2c88791e1 100644
--- a/spec/fixtures/api/schemas/registry/tag.json
+++ b/spec/fixtures/api/schemas/registry/tag.json
@@ -14,6 +14,11 @@
"revision": {
"type": "string"
},
+ "short_revision": {
+ "type": "string",
+ "minLength": 9,
+ "maxLength": 9
+ },
"total_size": {
"type": "integer"
},
diff --git a/spec/javascripts/registry/mock_data.js b/spec/javascripts/registry/mock_data.js
index 18600d00bff..6bffb47be55 100644
--- a/spec/javascripts/registry/mock_data.js
+++ b/spec/javascripts/registry/mock_data.js
@@ -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,
@@ -70,7 +70,7 @@ export const parsedRegistryServerResponse = [
tag: registryServerResponse[0].name,
revision: registryServerResponse[0].revision,
shortRevision: registryServerResponse[0].short_revision,
- size: registryServerResponse[0].size,
+ size: registryServerResponse[0].total_size,
layers: registryServerResponse[0].layers,
location: registryServerResponse[0].location,
createdAt: registryServerResponse[0].created_at,
@@ -81,7 +81,7 @@ export const parsedRegistryServerResponse = [
tag: registryServerResponse[1].name,
revision: registryServerResponse[1].revision,
shortRevision: registryServerResponse[1].short_revision,
- size: registryServerResponse[1].size,
+ size: registryServerResponse[1].total_size,
layers: registryServerResponse[1].layers,
location: registryServerResponse[1].location,
createdAt: registryServerResponse[1].created_at,
diff --git a/spec/serializers/container_tag_entity_spec.rb b/spec/serializers/container_tag_entity_spec.rb
index 6dcc5204516..4beb50c70f8 100644
--- a/spec/serializers/container_tag_entity_spec.rb
+++ b/spec/serializers/container_tag_entity_spec.rb
@@ -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