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
Jérome Perrin
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
Hide 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
)
-
css_classes
=
"ci-status ci-
#{
status
.
group
}
"
-
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
)
=
status
.
text
-
else
%span
{
class:
"ci-status ci-#{status}"
}
%span
{
class:
css_classes
}
=
custom_icon
(
status
.
icon
)
=
status
.
text
lib/gitlab/ci/status/build/play.rb
View file @
1b313e8d
...
...
@@ -17,6 +17,10 @@ module Gitlab
'icon_status_manual'
end
def
group
'manual'
end
def
has_action?
can?
(
user
,
:update_build
,
subject
)
end
...
...
lib/gitlab/ci/status/build/stop.rb
View file @
1b313e8d
...
...
@@ -17,6 +17,10 @@ module Gitlab
'icon_status_manual'
end
def
group
'manual'
end
def
has_action?
can?
(
user
,
:update_build
,
subject
)
end
...
...
lib/gitlab/ci/status/core.rb
View file @
1b313e8d
...
...
@@ -22,14 +22,7 @@ module Gitlab
raise
NotImplementedError
end
# Deprecation warning: this method is here because we need to maintain
# 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
def
group
self
.
class
.
name
.
demodulize
.
downcase
.
underscore
end
...
...
spec/lib/gitlab/ci/status/build/cancelable_spec.rb
View file @
1b313e8d
...
...
@@ -32,6 +32,14 @@ describe Gitlab::Ci::Status::Build::Cancelable do
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
let
(
:user
)
{
create
(
:user
)
}
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
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_manual'
}
end
describe
'#group'
do
it
{
expect
(
subject
.
group
).
to
eq
'manual'
}
end
describe
'action details'
do
let
(
:user
)
{
create
(
:user
)
}
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
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
let
(
:user
)
{
create
(
:user
)
}
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
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_manual'
}
end
describe
'#group'
do
it
{
expect
(
subject
.
group
).
to
eq
'manual'
}
end
describe
'action details'
do
let
(
:user
)
{
create
(
:user
)
}
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
describe
'#icon'
do
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_canceled'
}
end
describe
'#group'
do
it
{
expect
(
subject
.
group
).
to
eq
'canceled'
}
end
end
spec/lib/gitlab/ci/status/created_spec.rb
View file @
1b313e8d
...
...
@@ -16,4 +16,8 @@ describe Gitlab::Ci::Status::Created do
describe
'#icon'
do
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_created'
}
end
describe
'#group'
do
it
{
expect
(
subject
.
group
).
to
eq
'created'
}
end
end
spec/lib/gitlab/ci/status/failed_spec.rb
View file @
1b313e8d
...
...
@@ -16,4 +16,8 @@ describe Gitlab::Ci::Status::Failed do
describe
'#icon'
do
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_failed'
}
end
describe
'#group'
do
it
{
expect
(
subject
.
group
).
to
eq
'failed'
}
end
end
spec/lib/gitlab/ci/status/pending_spec.rb
View file @
1b313e8d
...
...
@@ -16,4 +16,8 @@ describe Gitlab::Ci::Status::Pending do
describe
'#icon'
do
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_pending'
}
end
describe
'#group'
do
it
{
expect
(
subject
.
group
).
to
eq
'pending'
}
end
end
spec/lib/gitlab/ci/status/running_spec.rb
View file @
1b313e8d
...
...
@@ -16,4 +16,8 @@ describe Gitlab::Ci::Status::Running do
describe
'#icon'
do
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_running'
}
end
describe
'#group'
do
it
{
expect
(
subject
.
group
).
to
eq
'running'
}
end
end
spec/lib/gitlab/ci/status/skipped_spec.rb
View file @
1b313e8d
...
...
@@ -16,4 +16,8 @@ describe Gitlab::Ci::Status::Skipped do
describe
'#icon'
do
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_skipped'
}
end
describe
'#group'
do
it
{
expect
(
subject
.
group
).
to
eq
'skipped'
}
end
end
spec/lib/gitlab/ci/status/success_spec.rb
View file @
1b313e8d
...
...
@@ -16,4 +16,8 @@ describe Gitlab::Ci::Status::Success do
describe
'#icon'
do
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_success'
}
end
describe
'#group'
do
it
{
expect
(
subject
.
group
).
to
eq
'success'
}
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