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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
2ea25cbc
Commit
2ea25cbc
authored
Apr 10, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert adding `Empty` extended status to avoid N+1 queries
parent
199e31eb
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
59 deletions
+5
-59
lib/gitlab/ci/status/build/common.rb
lib/gitlab/ci/status/build/common.rb
+2
-1
lib/gitlab/ci/status/build/empty.rb
lib/gitlab/ci/status/build/empty.rb
+0
-21
lib/gitlab/ci/status/build/factory.rb
lib/gitlab/ci/status/build/factory.rb
+1
-2
spec/lib/gitlab/ci/status/build/empty_spec.rb
spec/lib/gitlab/ci/status/build/empty_spec.rb
+0
-31
spec/lib/gitlab/ci/status/build/factory_spec.rb
spec/lib/gitlab/ci/status/build/factory_spec.rb
+2
-4
No files found.
lib/gitlab/ci/status/build/common.rb
View file @
2ea25cbc
...
@@ -6,7 +6,8 @@ module Gitlab
...
@@ -6,7 +6,8 @@ module Gitlab
def
illustration
def
illustration
{
{
image:
'illustrations/skipped-job_empty.svg'
,
image:
'illustrations/skipped-job_empty.svg'
,
size:
'svg-430'
size:
'svg-430'
,
title:
_
(
'This job does not have a trace.'
),
}
}
end
end
...
...
lib/gitlab/ci/status/build/empty.rb
deleted
100644 → 0
View file @
199e31eb
module
Gitlab
module
Ci
module
Status
module
Build
class
Empty
<
Status
::
Extended
def
illustration
{
image:
'illustrations/skipped-job_empty.svg'
,
size:
'svg-430'
,
title:
_
(
'This job does not have a trace.'
)
}
end
def
self
.
matches?
(
build
,
user
)
!
build
.
has_trace?
end
end
end
end
end
end
lib/gitlab/ci/status/build/factory.rb
View file @
2ea25cbc
...
@@ -9,8 +9,7 @@ module Gitlab
...
@@ -9,8 +9,7 @@ module Gitlab
Status
::
Build
::
Canceled
,
Status
::
Build
::
Canceled
,
Status
::
Build
::
Created
,
Status
::
Build
::
Created
,
Status
::
Build
::
Pending
,
Status
::
Build
::
Pending
,
Status
::
Build
::
Skipped
,
Status
::
Build
::
Skipped
],
Status
::
Build
::
Empty
],
[
Status
::
Build
::
Cancelable
,
[
Status
::
Build
::
Cancelable
,
Status
::
Build
::
Retryable
],
Status
::
Build
::
Retryable
],
[
Status
::
Build
::
Failed
],
[
Status
::
Build
::
Failed
],
...
...
spec/lib/gitlab/ci/status/build/empty_spec.rb
deleted
100644 → 0
View file @
199e31eb
require
'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Build
::
Empty
do
let
(
:build
)
{
create
(
:ci_build
,
:running
)
}
let
(
:status
)
{
double
(
'core status'
)
}
let
(
:user
)
{
double
(
'user'
)
}
subject
{
described_class
.
new
(
status
)
}
describe
'#illustration'
do
it
'provides an empty state illustration'
do
expect
(
subject
.
illustration
).
not_to
be_empty
end
end
describe
'.matches?'
do
subject
{
described_class
.
matches?
(
build
,
user
)
}
context
'when a build has trace'
do
let
(
:build
)
{
create
(
:ci_build
,
:trace_artifact
)
}
it
{
is_expected
.
to
be_falsy
}
end
context
'with a build that has not been retried'
do
let
(
:build
)
{
create
(
:ci_build
,
:running
)
}
it
{
is_expected
.
to
be_truthy
}
end
end
end
spec/lib/gitlab/ci/status/build/factory_spec.rb
View file @
2ea25cbc
...
@@ -75,8 +75,7 @@ describe Gitlab::Ci::Status::Build::Factory do
...
@@ -75,8 +75,7 @@ describe Gitlab::Ci::Status::Build::Factory do
it
'matches correct extended statuses'
do
it
'matches correct extended statuses'
do
expect
(
factory
.
extended_statuses
)
expect
(
factory
.
extended_statuses
)
.
to
eq
[
Gitlab
::
Ci
::
Status
::
Build
::
Empty
,
.
to
eq
[
Gitlab
::
Ci
::
Status
::
Build
::
Retryable
,
Gitlab
::
Ci
::
Status
::
Build
::
Retryable
,
Gitlab
::
Ci
::
Status
::
Build
::
Failed
]
Gitlab
::
Ci
::
Status
::
Build
::
Failed
]
end
end
...
@@ -162,8 +161,7 @@ describe Gitlab::Ci::Status::Build::Factory do
...
@@ -162,8 +161,7 @@ describe Gitlab::Ci::Status::Build::Factory do
it
'matches correct extended statuses'
do
it
'matches correct extended statuses'
do
expect
(
factory
.
extended_statuses
)
expect
(
factory
.
extended_statuses
)
.
to
eq
[
Gitlab
::
Ci
::
Status
::
Build
::
Empty
,
.
to
eq
[
Gitlab
::
Ci
::
Status
::
Build
::
Cancelable
]
Gitlab
::
Ci
::
Status
::
Build
::
Cancelable
]
end
end
it
'fabricates a canceable build status'
do
it
'fabricates a canceable build status'
do
...
...
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