Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ca154ab0
Commit
ca154ab0
authored
Dec 23, 2020
by
Nicolò Maria Mezzopera
Committed by
Heinrich Lee Yu
Dec 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set registry fields to not_nullable
- type - schema - docs
parent
d1fe7c5b
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
78 additions
and
51 deletions
+78
-51
app/graphql/types/container_repository_tag_type.rb
app/graphql/types/container_repository_tag_type.rb
+5
-5
changelogs/unreleased/293845-allow-nullable-digest.yml
changelogs/unreleased/293845-allow-nullable-digest.yml
+5
-0
doc/api/graphql/reference/gitlab_schema.graphql
doc/api/graphql/reference/gitlab_schema.graphql
+5
-5
doc/api/graphql/reference/gitlab_schema.json
doc/api/graphql/reference/gitlab_schema.json
+15
-35
doc/api/graphql/reference/index.md
doc/api/graphql/reference/index.md
+5
-5
spec/features/projects/container_registry_spec.rb
spec/features/projects/container_registry_spec.rb
+16
-0
spec/fixtures/api/schemas/graphql/container_repository_details.json
...res/api/schemas/graphql/container_repository_details.json
+1
-1
spec/requests/api/graphql/container_repository/container_repository_details_spec.rb
...container_repository/container_repository_details_spec.rb
+17
-0
spec/support/shared_contexts/lib/container_registry/tags_shared_context.rb
...ed_contexts/lib/container_registry/tags_shared_context.rb
+9
-0
No files found.
app/graphql/types/container_repository_tag_type.rb
View file @
ca154ab0
...
...
@@ -11,11 +11,11 @@ module Types
field
:name
,
GraphQL
::
STRING_TYPE
,
null:
false
,
description:
'Name of the tag.'
field
:path
,
GraphQL
::
STRING_TYPE
,
null:
false
,
description:
'Path of the tag.'
field
:location
,
GraphQL
::
STRING_TYPE
,
null:
false
,
description:
'URL of the tag.'
field
:digest
,
GraphQL
::
STRING_TYPE
,
null:
fals
e
,
description:
'Digest of the tag.'
field
:revision
,
GraphQL
::
STRING_TYPE
,
null:
fals
e
,
description:
'Revision of the tag.'
field
:short_revision
,
GraphQL
::
STRING_TYPE
,
null:
fals
e
,
description:
'Short revision of the tag.'
field
:total_size
,
GraphQL
::
INT_TYPE
,
null:
fals
e
,
description:
'The size of the tag.'
field
:created_at
,
Types
::
TimeType
,
null:
fals
e
,
description:
'Timestamp when the tag was created.'
field
:digest
,
GraphQL
::
STRING_TYPE
,
null:
tru
e
,
description:
'Digest of the tag.'
field
:revision
,
GraphQL
::
STRING_TYPE
,
null:
tru
e
,
description:
'Revision of the tag.'
field
:short_revision
,
GraphQL
::
STRING_TYPE
,
null:
tru
e
,
description:
'Short revision of the tag.'
field
:total_size
,
GraphQL
::
INT_TYPE
,
null:
tru
e
,
description:
'The size of the tag.'
field
:created_at
,
Types
::
TimeType
,
null:
tru
e
,
description:
'Timestamp when the tag was created.'
field
:can_delete
,
GraphQL
::
BOOLEAN_TYPE
,
null:
false
,
description:
'Can the current user delete this tag.'
def
can_delete
...
...
changelogs/unreleased/293845-allow-nullable-digest.yml
0 → 100644
View file @
ca154ab0
---
title
:
Fix viewing container repositories with tags with corrupted manifest
merge_request
:
50362
author
:
type
:
fixed
doc/api/graphql/reference/gitlab_schema.graphql
View file @
ca154ab0
...
...
@@ -4018,12 +4018,12 @@ type ContainerRepositoryTag {
"""
Timestamp
when
the
tag
was
created
.
"""
createdAt
:
Time
!
createdAt
:
Time
"""
Digest
of
the
tag
.
"""
digest
:
String
!
digest
:
String
"""
URL
of
the
tag
.
...
...
@@ -4043,17 +4043,17 @@ type ContainerRepositoryTag {
"""
Revision
of
the
tag
.
"""
revision
:
String
!
revision
:
String
"""
Short
revision
of
the
tag
.
"""
shortRevision
:
String
!
shortRevision
:
String
"""
The
size
of
the
tag
.
"""
totalSize
:
Int
!
totalSize
:
Int
}
"""
...
...
doc/api/graphql/reference/gitlab_schema.json
View file @
ca154ab0
...
...
@@ -10276,13 +10276,9 @@
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Time",
"ofType": null
}
"kind": "SCALAR",
"name": "Time",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
...
...
@@ -10340,13 +10336,9 @@
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
...
...
@@ -10358,13 +10350,9 @@
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
...
...
@@ -10376,13 +10364,9 @@
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
...
...
@@ -10426,13 +10410,9 @@
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
}
"kind": "SCALAR",
"name": "Int",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
doc/api/graphql/reference/index.md
View file @
ca154ab0
...
...
@@ -633,14 +633,14 @@ A tag from a container repository.
| Field | Type | Description |
| ----- | ---- | ----------- |
|
`canDelete`
| Boolean! | Can the current user delete this tag. |
|
`createdAt`
| Time
!
| Timestamp when the tag was created. |
|
`digest`
| String
!
| Digest of the tag. |
|
`createdAt`
| Time | Timestamp when the tag was created. |
|
`digest`
| String | Digest of the tag. |
|
`location`
| String! | URL of the tag. |
|
`name`
| String! | Name of the tag. |
|
`path`
| String! | Path of the tag. |
|
`revision`
| String
!
| Revision of the tag. |
|
`shortRevision`
| String
!
| Short revision of the tag. |
|
`totalSize`
| Int
!
| The size of the tag. |
|
`revision`
| String | Revision of the tag. |
|
`shortRevision`
| String | Short revision of the tag. |
|
`totalSize`
| Int | The size of the tag. |
### CreateAlertIssuePayload
...
...
spec/features/projects/container_registry_spec.rb
View file @
ca154ab0
...
...
@@ -3,6 +3,8 @@
require
'spec_helper'
RSpec
.
describe
'Container Registry'
,
:js
do
include_context
'container registry tags'
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
...
...
@@ -99,6 +101,20 @@ RSpec.describe 'Container Registry', :js do
expect
(
page
).
to
have_content
'20'
end
end
describe
'with a tag missing digest'
do
before
do
stub_container_registry_tags
(
repository:
%r{my/image}
,
tags:
%w[latest stable]
)
stub_next_container_registry_tags_call
(
:digest
,
nil
)
visit_container_registry_details
'my/image'
end
it
'renders the tags list correctly'
do
expect
(
page
).
to
have_content
(
'latest'
)
expect
(
page
).
to
have_content
(
'stable'
)
expect
(
page
).
to
have_content
(
'Digest: N/A'
)
end
end
end
describe
'image repo details when image has no name'
do
...
...
spec/fixtures/api/schemas/graphql/container_repository_details.json
View file @
ca154ab0
...
...
@@ -11,7 +11,7 @@
"type"
:
"array"
,
"items"
:
{
"type"
:
"object"
,
"required"
:
[
"name"
,
"path"
,
"location"
,
"
digest"
,
"revision"
,
"shortRevision"
,
"totalSize"
,
"createdAt"
,
"
canDelete"
],
"required"
:
[
"name"
,
"path"
,
"location"
,
"canDelete"
],
"properties"
:
{
"name"
:
{
"type"
:
"string"
...
...
spec/requests/api/graphql/container_repository/container_repository_details_spec.rb
View file @
ca154ab0
...
...
@@ -2,6 +2,7 @@
require
'spec_helper'
RSpec
.
describe
'container repository details'
do
include_context
'container registry tags'
using
RSpec
::
Parameterized
::
TableSyntax
include
GraphqlHelpers
...
...
@@ -105,4 +106,20 @@ RSpec.describe 'container repository details' do
expect
(
tags_response
.
size
).
to
eq
(
limit
)
end
end
context
'with tags without a manifest'
do
let
(
:tags_response
)
{
container_repository_details_response
.
dig
(
'tags'
,
'nodes'
)
}
let
(
:errors
)
{
container_repository_details_response
.
dig
(
'errors'
)
}
%i[digest revision short_revision total_size created_at]
.
each
do
|
nilable_field
|
it
"returns a list of tags with a nil
#{
nilable_field
}
"
do
stub_next_container_registry_tags_call
(
nilable_field
,
nil
)
subject
expect
(
tags_response
.
size
).
to
eq
(
tags
.
size
)
expect
(
graphql_errors
).
to
eq
(
nil
)
end
end
end
end
spec/support/shared_contexts/lib/container_registry/tags_shared_context.rb
0 → 100644
View file @
ca154ab0
# frozen_string_literal: true
RSpec
.
shared_context
'container registry tags'
do
def
stub_next_container_registry_tags_call
(
method_name
,
mock_value
)
allow_next_instance_of
(
ContainerRegistry
::
Tag
)
do
|
tag
|
allow
(
tag
).
to
receive
(
method_name
).
and_return
(
mock_value
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment