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
1b313e8d
Commit
1b313e8d
authored
Dec 15, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make CI/CD detailed status group concept explicit
parent
b1120fc3
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
64 additions
and
10 deletions
+64
-10
app/views/ci/status/_badge.html.haml
app/views/ci/status/_badge.html.haml
+3
-2
lib/gitlab/ci/status/build/play.rb
lib/gitlab/ci/status/build/play.rb
+4
-0
lib/gitlab/ci/status/build/stop.rb
lib/gitlab/ci/status/build/stop.rb
+4
-0
lib/gitlab/ci/status/core.rb
lib/gitlab/ci/status/core.rb
+1
-8
spec/lib/gitlab/ci/status/build/cancelable_spec.rb
spec/lib/gitlab/ci/status/build/cancelable_spec.rb
+8
-0
spec/lib/gitlab/ci/status/build/play_spec.rb
spec/lib/gitlab/ci/status/build/play_spec.rb
+4
-0
spec/lib/gitlab/ci/status/build/retryable_spec.rb
spec/lib/gitlab/ci/status/build/retryable_spec.rb
+8
-0
spec/lib/gitlab/ci/status/build/stop_spec.rb
spec/lib/gitlab/ci/status/build/stop_spec.rb
+4
-0
spec/lib/gitlab/ci/status/canceled_spec.rb
spec/lib/gitlab/ci/status/canceled_spec.rb
+4
-0
spec/lib/gitlab/ci/status/created_spec.rb
spec/lib/gitlab/ci/status/created_spec.rb
+4
-0
spec/lib/gitlab/ci/status/failed_spec.rb
spec/lib/gitlab/ci/status/failed_spec.rb
+4
-0
spec/lib/gitlab/ci/status/pending_spec.rb
spec/lib/gitlab/ci/status/pending_spec.rb
+4
-0
spec/lib/gitlab/ci/status/running_spec.rb
spec/lib/gitlab/ci/status/running_spec.rb
+4
-0
spec/lib/gitlab/ci/status/skipped_spec.rb
spec/lib/gitlab/ci/status/skipped_spec.rb
+4
-0
spec/lib/gitlab/ci/status/success_spec.rb
spec/lib/gitlab/ci/status/success_spec.rb
+4
-0
No files found.
app/views/ci/status/_badge.html.haml
View file @
1b313e8d
-
status
=
local_assigns
.
fetch
(
:status
)
-
status
=
local_assigns
.
fetch
(
:status
)
-
css_classes
=
"ci-status ci-
#{
status
.
group
}
"
-
if
status
.
has_details?
-
if
status
.
has_details?
=
link_to
status
.
details_path
,
class:
"ci-status ci-
#{
status
}
"
do
=
link_to
status
.
details_path
,
class:
css_classes
do
=
custom_icon
(
status
.
icon
)
=
custom_icon
(
status
.
icon
)
=
status
.
text
=
status
.
text
-
else
-
else
%span
{
class:
"ci-status ci-#{status}"
}
%span
{
class:
css_classes
}
=
custom_icon
(
status
.
icon
)
=
custom_icon
(
status
.
icon
)
=
status
.
text
=
status
.
text
lib/gitlab/ci/status/build/play.rb
View file @
1b313e8d
...
@@ -17,6 +17,10 @@ module Gitlab
...
@@ -17,6 +17,10 @@ module Gitlab
'icon_status_manual'
'icon_status_manual'
end
end
def
group
'manual'
end
def
has_action?
def
has_action?
can?
(
user
,
:update_build
,
subject
)
can?
(
user
,
:update_build
,
subject
)
end
end
...
...
lib/gitlab/ci/status/build/stop.rb
View file @
1b313e8d
...
@@ -17,6 +17,10 @@ module Gitlab
...
@@ -17,6 +17,10 @@ module Gitlab
'icon_status_manual'
'icon_status_manual'
end
end
def
group
'manual'
end
def
has_action?
def
has_action?
can?
(
user
,
:update_build
,
subject
)
can?
(
user
,
:update_build
,
subject
)
end
end
...
...
lib/gitlab/ci/status/core.rb
View file @
1b313e8d
...
@@ -22,14 +22,7 @@ module Gitlab
...
@@ -22,14 +22,7 @@ module Gitlab
raise
NotImplementedError
raise
NotImplementedError
end
end
# Deprecation warning: this method is here because we need to maintain
def
group
# backwards compatibility with legacy statuses. We often do something
# like "ci-status ci-status-#{status}" to set CSS class.
#
# `to_s` method should be renamed to `group` at some point, after
# phasing legacy satuses out.
#
def
to_s
self
.
class
.
name
.
demodulize
.
downcase
.
underscore
self
.
class
.
name
.
demodulize
.
downcase
.
underscore
end
end
...
...
spec/lib/gitlab/ci/status/build/cancelable_spec.rb
View file @
1b313e8d
...
@@ -32,6 +32,14 @@ describe Gitlab::Ci::Status::Build::Cancelable do
...
@@ -32,6 +32,14 @@ describe Gitlab::Ci::Status::Build::Cancelable do
end
end
end
end
describe
'#group'
do
it
'does not override status group'
do
expect
(
status
).
to
receive
(
:group
)
subject
.
group
end
end
describe
'action details'
do
describe
'action details'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:build
)
{
create
(
:ci_build
)
}
let
(
:build
)
{
create
(
:ci_build
)
}
...
...
spec/lib/gitlab/ci/status/build/play_spec.rb
View file @
1b313e8d
...
@@ -18,6 +18,10 @@ describe Gitlab::Ci::Status::Build::Play do
...
@@ -18,6 +18,10 @@ describe Gitlab::Ci::Status::Build::Play do
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_manual'
}
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_manual'
}
end
end
describe
'#group'
do
it
{
expect
(
subject
.
group
).
to
eq
'manual'
}
end
describe
'action details'
do
describe
'action details'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:build
)
{
create
(
:ci_build
)
}
let
(
:build
)
{
create
(
:ci_build
)
}
...
...
spec/lib/gitlab/ci/status/build/retryable_spec.rb
View file @
1b313e8d
...
@@ -32,6 +32,14 @@ describe Gitlab::Ci::Status::Build::Retryable do
...
@@ -32,6 +32,14 @@ describe Gitlab::Ci::Status::Build::Retryable do
end
end
end
end
describe
'#group'
do
it
'does not override status group'
do
expect
(
status
).
to
receive
(
:group
)
subject
.
group
end
end
describe
'action details'
do
describe
'action details'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:build
)
{
create
(
:ci_build
)
}
let
(
:build
)
{
create
(
:ci_build
)
}
...
...
spec/lib/gitlab/ci/status/build/stop_spec.rb
View file @
1b313e8d
...
@@ -20,6 +20,10 @@ describe Gitlab::Ci::Status::Build::Stop do
...
@@ -20,6 +20,10 @@ describe Gitlab::Ci::Status::Build::Stop do
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_manual'
}
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_manual'
}
end
end
describe
'#group'
do
it
{
expect
(
subject
.
group
).
to
eq
'manual'
}
end
describe
'action details'
do
describe
'action details'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:build
)
{
create
(
:ci_build
)
}
let
(
:build
)
{
create
(
:ci_build
)
}
...
...
spec/lib/gitlab/ci/status/canceled_spec.rb
View file @
1b313e8d
...
@@ -16,4 +16,8 @@ describe Gitlab::Ci::Status::Canceled do
...
@@ -16,4 +16,8 @@ describe Gitlab::Ci::Status::Canceled do
describe
'#icon'
do
describe
'#icon'
do
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_canceled'
}
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_canceled'
}
end
end
describe
'#group'
do
it
{
expect
(
subject
.
group
).
to
eq
'canceled'
}
end
end
end
spec/lib/gitlab/ci/status/created_spec.rb
View file @
1b313e8d
...
@@ -16,4 +16,8 @@ describe Gitlab::Ci::Status::Created do
...
@@ -16,4 +16,8 @@ describe Gitlab::Ci::Status::Created do
describe
'#icon'
do
describe
'#icon'
do
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_created'
}
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_created'
}
end
end
describe
'#group'
do
it
{
expect
(
subject
.
group
).
to
eq
'created'
}
end
end
end
spec/lib/gitlab/ci/status/failed_spec.rb
View file @
1b313e8d
...
@@ -16,4 +16,8 @@ describe Gitlab::Ci::Status::Failed do
...
@@ -16,4 +16,8 @@ describe Gitlab::Ci::Status::Failed do
describe
'#icon'
do
describe
'#icon'
do
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_failed'
}
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_failed'
}
end
end
describe
'#group'
do
it
{
expect
(
subject
.
group
).
to
eq
'failed'
}
end
end
end
spec/lib/gitlab/ci/status/pending_spec.rb
View file @
1b313e8d
...
@@ -16,4 +16,8 @@ describe Gitlab::Ci::Status::Pending do
...
@@ -16,4 +16,8 @@ describe Gitlab::Ci::Status::Pending do
describe
'#icon'
do
describe
'#icon'
do
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_pending'
}
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_pending'
}
end
end
describe
'#group'
do
it
{
expect
(
subject
.
group
).
to
eq
'pending'
}
end
end
end
spec/lib/gitlab/ci/status/running_spec.rb
View file @
1b313e8d
...
@@ -16,4 +16,8 @@ describe Gitlab::Ci::Status::Running do
...
@@ -16,4 +16,8 @@ describe Gitlab::Ci::Status::Running do
describe
'#icon'
do
describe
'#icon'
do
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_running'
}
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_running'
}
end
end
describe
'#group'
do
it
{
expect
(
subject
.
group
).
to
eq
'running'
}
end
end
end
spec/lib/gitlab/ci/status/skipped_spec.rb
View file @
1b313e8d
...
@@ -16,4 +16,8 @@ describe Gitlab::Ci::Status::Skipped do
...
@@ -16,4 +16,8 @@ describe Gitlab::Ci::Status::Skipped do
describe
'#icon'
do
describe
'#icon'
do
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_skipped'
}
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_skipped'
}
end
end
describe
'#group'
do
it
{
expect
(
subject
.
group
).
to
eq
'skipped'
}
end
end
end
spec/lib/gitlab/ci/status/success_spec.rb
View file @
1b313e8d
...
@@ -16,4 +16,8 @@ describe Gitlab::Ci::Status::Success do
...
@@ -16,4 +16,8 @@ describe Gitlab::Ci::Status::Success do
describe
'#icon'
do
describe
'#icon'
do
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_success'
}
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_success'
}
end
end
describe
'#group'
do
it
{
expect
(
subject
.
group
).
to
eq
'success'
}
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