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
81404673
Commit
81404673
authored
Apr 20, 2020
by
Matthias Kaeppler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix null dereference in project_import_status
parent
0f58b134
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
lib/api/entities/project_import_status.rb
lib/api/entities/project_import_status.rb
+1
-1
spec/lib/api/entities/project_import_status_spec.rb
spec/lib/api/entities/project_import_status_spec.rb
+11
-0
No files found.
lib/api/entities/project_import_status.rb
View file @
81404673
...
@@ -9,7 +9,7 @@ module API
...
@@ -9,7 +9,7 @@ module API
end
end
expose
:failed_relations
,
using:
Entities
::
ProjectImportFailedRelation
do
|
project
,
_options
|
expose
:failed_relations
,
using:
Entities
::
ProjectImportFailedRelation
do
|
project
,
_options
|
project
.
import_state
.
relation_hard_failures
(
limit:
100
)
project
.
import_state
&
.
relation_hard_failures
(
limit:
100
)
||
[]
end
end
# TODO: Use `expose_nil` once we upgrade the grape-entity gem
# TODO: Use `expose_nil` once we upgrade the grape-entity gem
...
...
spec/lib/api/entities/project_import_status_spec.rb
View file @
81404673
...
@@ -8,6 +8,17 @@ describe API::Entities::ProjectImportStatus do
...
@@ -8,6 +8,17 @@ describe API::Entities::ProjectImportStatus do
let
(
:correlation_id
)
{
'cid'
}
let
(
:correlation_id
)
{
'cid'
}
context
'when no import state exists'
do
let
(
:entity
)
{
described_class
.
new
(
build
(
:project
))
}
it
'includes basic fields and no failures'
do
expect
(
subject
[
:import_status
]).
to
eq
(
'none'
)
expect
(
subject
[
:correlation_id
]).
to
be_nil
expect
(
subject
[
:import_error
]).
to
be_nil
expect
(
subject
[
:failed_relations
]).
to
eq
([])
end
end
context
'when import has not finished yet'
do
context
'when import has not finished yet'
do
let
(
:project
)
{
create
(
:project
,
:import_scheduled
,
import_correlation_id:
correlation_id
)
}
let
(
:project
)
{
create
(
:project
,
:import_scheduled
,
import_correlation_id:
correlation_id
)
}
let
(
:entity
)
{
described_class
.
new
(
project
)
}
let
(
:entity
)
{
described_class
.
new
(
project
)
}
...
...
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