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
Tatuya Kamada
gitlab-ce
Commits
567dc62b
Commit
567dc62b
authored
Dec 30, 2015
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show 'All' tab by default in the builds page
parent
b9ec1aae
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
107 additions
and
71 deletions
+107
-71
CHANGELOG
CHANGELOG
+2
-0
app/controllers/admin/builds_controller.rb
app/controllers/admin/builds_controller.rb
+3
-3
app/controllers/projects/builds_controller.rb
app/controllers/projects/builds_controller.rb
+3
-3
app/views/admin/builds/index.html.haml
app/views/admin/builds/index.html.haml
+5
-5
app/views/projects/builds/index.html.haml
app/views/projects/builds/index.html.haml
+6
-6
spec/features/admin/admin_builds_spec.rb
spec/features/admin/admin_builds_spec.rb
+74
-45
spec/features/builds_spec.rb
spec/features/builds_spec.rb
+14
-9
No files found.
CHANGELOG
View file @
567dc62b
...
@@ -14,6 +14,8 @@ v 8.4.0 (unreleased)
...
@@ -14,6 +14,8 @@ v 8.4.0 (unreleased)
- Revert back upvote and downvote button to the issue and MR pages
- Revert back upvote and downvote button to the issue and MR pages
- Swap position of Assignee and Author selector on Issuables (Zeger-Jan van de Weg)
- Swap position of Assignee and Author selector on Issuables (Zeger-Jan van de Weg)
- Fix version check image in Safari
- Fix version check image in Safari
- Enable "Add key" button when user fills in a proper key (Stan Hu)
- Show 'All' tab by default in the builds page
v 8.3.3 (unreleased)
v 8.3.3 (unreleased)
- Fix project transfer e-mail sending incorrect paths in e-mail notification (Stan Hu)
- Fix project transfer e-mail sending incorrect paths in e-mail notification (Stan Hu)
...
...
app/controllers/admin/builds_controller.rb
View file @
567dc62b
...
@@ -5,12 +5,12 @@ class Admin::BuildsController < Admin::ApplicationController
...
@@ -5,12 +5,12 @@ class Admin::BuildsController < Admin::ApplicationController
@builds
=
@all_builds
.
order
(
'created_at DESC'
)
@builds
=
@all_builds
.
order
(
'created_at DESC'
)
@builds
=
@builds
=
case
@scope
case
@scope
when
'
all
'
when
'
running
'
@builds
@builds
.
running_or_pending
.
reverse_order
when
'finished'
when
'finished'
@builds
.
finished
@builds
.
finished
else
else
@builds
.
running_or_pending
.
reverse_order
@builds
end
end
@builds
=
@builds
.
page
(
params
[
:page
]).
per
(
30
)
@builds
=
@builds
.
page
(
params
[
:page
]).
per
(
30
)
end
end
...
...
app/controllers/projects/builds_controller.rb
View file @
567dc62b
...
@@ -12,12 +12,12 @@ class Projects::BuildsController < Projects::ApplicationController
...
@@ -12,12 +12,12 @@ class Projects::BuildsController < Projects::ApplicationController
@builds
=
@all_builds
.
order
(
'created_at DESC'
)
@builds
=
@all_builds
.
order
(
'created_at DESC'
)
@builds
=
@builds
=
case
@scope
case
@scope
when
'
all
'
when
'
running
'
@builds
@builds
.
running_or_pending
.
reverse_order
when
'finished'
when
'finished'
@builds
.
finished
@builds
.
finished
else
else
@builds
.
running_or_pending
.
reverse_order
@builds
end
end
@builds
=
@builds
.
page
(
params
[
:page
]).
per
(
30
)
@builds
=
@builds
.
page
(
params
[
:page
]).
per
(
30
)
end
end
...
...
app/views/admin/builds/index.html.haml
View file @
567dc62b
...
@@ -7,6 +7,11 @@
...
@@ -7,6 +7,11 @@
%ul
.center-top-menu
%ul
.center-top-menu
%li
{
class:
(
'active'
if
@scope
.
nil?
)}
%li
{
class:
(
'active'
if
@scope
.
nil?
)}
=
link_to
admin_builds_path
do
=
link_to
admin_builds_path
do
All
%span
.badge.js-totalbuilds-count
=
@all_builds
.
count
(
:id
)
%li
{
class:
(
'active'
if
@scope
==
'running'
)}
=
link_to
admin_builds_path
(
scope: :running
)
do
Running
Running
%span
.badge.js-running-count
=
number_with_delimiter
(
@all_builds
.
running_or_pending
.
count
(
:id
))
%span
.badge.js-running-count
=
number_with_delimiter
(
@all_builds
.
running_or_pending
.
count
(
:id
))
...
@@ -15,11 +20,6 @@
...
@@ -15,11 +20,6 @@
Finished
Finished
%span
.badge.js-running-count
=
number_with_delimiter
(
@all_builds
.
finished
.
count
(
:id
))
%span
.badge.js-running-count
=
number_with_delimiter
(
@all_builds
.
finished
.
count
(
:id
))
%li
{
class:
(
'active'
if
@scope
==
'all'
)}
=
link_to
admin_builds_path
(
scope: :all
)
do
All
%span
.badge.js-totalbuilds-count
=
number_with_delimiter
(
@all_builds
.
count
(
:id
))
.gray-content-block
.gray-content-block
#{
(
@scope
||
'running'
).
capitalize
}
builds
#{
(
@scope
||
'running'
).
capitalize
}
builds
...
...
app/views/projects/builds/index.html.haml
View file @
567dc62b
...
@@ -11,6 +11,12 @@
...
@@ -11,6 +11,12 @@
%ul
.center-top-menu
%ul
.center-top-menu
%li
{
class:
(
'active'
if
@scope
.
nil?
)}
%li
{
class:
(
'active'
if
@scope
.
nil?
)}
=
link_to
project_builds_path
(
@project
)
do
=
link_to
project_builds_path
(
@project
)
do
All
%span
.badge.js-totalbuilds-count
=
number_with_delimiter
(
@all_builds
.
count
(
:id
))
%li
{
class:
(
'active'
if
@scope
==
'running'
)}
=
link_to
project_builds_path
(
@project
,
scope: :running
)
do
Running
Running
%span
.badge.js-running-count
%span
.badge.js-running-count
=
number_with_delimiter
(
@all_builds
.
running_or_pending
.
count
(
:id
))
=
number_with_delimiter
(
@all_builds
.
running_or_pending
.
count
(
:id
))
...
@@ -21,12 +27,6 @@
...
@@ -21,12 +27,6 @@
%span
.badge.js-running-count
%span
.badge.js-running-count
=
number_with_delimiter
(
@all_builds
.
finished
.
count
(
:id
))
=
number_with_delimiter
(
@all_builds
.
finished
.
count
(
:id
))
%li
{
class:
(
'active'
if
@scope
==
'all'
)}
=
link_to
project_builds_path
(
@project
,
scope: :all
)
do
All
%span
.badge.js-totalbuilds-count
=
number_with_delimiter
(
@all_builds
.
count
(
:id
))
.gray-content-block
.gray-content-block
#{
(
@scope
||
'running'
).
capitalize
}
builds from this project
#{
(
@scope
||
'running'
).
capitalize
}
builds from this project
...
...
spec/features/admin/admin_builds_spec.rb
View file @
567dc62b
require
'spec_helper'
require
'spec_helper'
describe
"Admin Builds"
do
describe
'Admin Builds'
do
let
(
:commit
)
{
FactoryGirl
.
create
:ci_commit
}
let
(
:build
)
{
FactoryGirl
.
create
:ci_build
,
commit:
commit
}
before
do
before
do
login_as
:admin
login_as
:admin
end
end
describe
"GET /admin/builds"
do
describe
'GET /admin/builds'
do
before
do
let
(
:commit
)
{
create
(
:ci_commit
)
}
build
context
'All tab'
do
context
'when have builds'
do
it
'shows all builds'
do
create
(
:ci_build
,
commit:
commit
,
status: :pending
)
create
(
:ci_build
,
commit:
commit
,
status: :running
)
create
(
:ci_build
,
commit:
commit
,
status: :success
)
create
(
:ci_build
,
commit:
commit
,
status: :failed
)
visit
admin_builds_path
visit
admin_builds_path
end
it
{
expect
(
page
).
to
have_content
"Running"
}
expect
(
page
).
to
have_selector
(
'.project-issuable-filter li.active'
,
text:
'All'
)
it
{
expect
(
page
).
to
have_content
build
.
short_sha
}
expect
(
page
.
all
(
'.build-link'
).
size
).
to
eq
(
4
)
expect
(
page
).
to
have_link
'Cancel all'
end
end
end
describe
"Tabs"
do
context
'when have no builds'
do
it
"shows all builds"
do
it
'shows a message'
do
FactoryGirl
.
create
:ci_build
,
commit:
commit
,
status:
"pending"
FactoryGirl
.
create
:ci_build
,
commit:
commit
,
status:
"running"
FactoryGirl
.
create
:ci_build
,
commit:
commit
,
status:
"success"
FactoryGirl
.
create
:ci_build
,
commit:
commit
,
status:
"failed"
visit
admin_builds_path
visit
admin_builds_path
within
".center-top-menu"
do
expect
(
page
).
to
have_selector
(
'.project-issuable-filter li.active'
,
text:
'All'
)
click_on
"All"
expect
(
page
).
to
have_content
'No builds to show'
expect
(
page
).
not_to
have_link
'Cancel all'
end
end
end
expect
(
page
.
all
(
".build-link"
).
size
).
to
eq
(
4
)
end
end
it
"shows finished builds"
do
context
'Running tab'
do
build
=
FactoryGirl
.
create
:ci_build
,
commit:
commit
,
status:
"pending"
context
'when have running builds'
do
build1
=
FactoryGirl
.
create
:ci_build
,
commit:
commit
,
status:
"running"
it
'shows running builds'
do
build2
=
FactoryGirl
.
create
:ci_build
,
commit:
commit
,
status:
"success"
build1
=
create
(
:ci_build
,
commit:
commit
,
status: :pending
)
build2
=
create
(
:ci_build
,
commit:
commit
,
status: :success
)
build3
=
create
(
:ci_build
,
commit:
commit
,
status: :failed
)
visit
admin_builds_path
visit
admin_builds_path
(
scope: :running
)
within
".center-top-menu"
do
expect
(
page
).
to
have_selector
(
'.project-issuable-filter li.active'
,
text:
'Running'
)
click_on
"Finished"
expect
(
page
.
find
(
'.build-link'
)).
to
have_content
(
build1
.
id
)
expect
(
page
.
find
(
'.build-link'
)).
not_to
have_content
(
build2
.
id
)
expect
(
page
.
find
(
'.build-link'
)).
not_to
have_content
(
build3
.
id
)
expect
(
page
).
to
have_link
'Cancel all'
end
end
end
expect
(
page
.
find
(
".build-link"
)).
not_to
have_content
(
build
.
id
)
context
'when have no builds running'
do
expect
(
page
.
find
(
".build-link"
)).
not_to
have_content
(
build1
.
id
)
it
'shows a message'
do
expect
(
page
.
find
(
".build-link"
)).
to
have_content
(
build2
.
id
)
create
(
:ci_build
,
commit:
commit
,
status: :success
)
visit
admin_builds_path
(
scope: :running
)
expect
(
page
).
to
have_selector
(
'.project-issuable-filter li.active'
,
text:
'Running'
)
expect
(
page
).
to
have_content
'No builds to show'
expect
(
page
).
not_to
have_link
'Cancel all'
end
end
end
end
it
"shows running builds"
do
context
'Finished tab'
do
build
=
FactoryGirl
.
create
:ci_build
,
commit:
commit
,
status:
"pending"
context
'when have finished builds'
do
build2
=
FactoryGirl
.
create
:ci_build
,
commit:
commit
,
status:
"success"
it
'shows finished builds'
do
build3
=
FactoryGirl
.
create
:ci_build
,
commit:
commit
,
status:
"failed"
build1
=
create
(
:ci_build
,
commit:
commit
,
status: :pending
)
build2
=
create
(
:ci_build
,
commit:
commit
,
status: :running
)
build3
=
create
(
:ci_build
,
commit:
commit
,
status: :success
)
visit
admin_builds_path
visit
admin_builds_path
(
scope: :finished
)
within
".center-top-menu"
do
expect
(
page
).
to
have_selector
(
'.project-issuable-filter li.active'
,
text:
'Finished'
)
click_on
"Running"
expect
(
page
.
find
(
'.build-link'
)).
not_to
have_content
(
build1
.
id
)
expect
(
page
.
find
(
'.build-link'
)).
not_to
have_content
(
build2
.
id
)
expect
(
page
.
find
(
'.build-link'
)).
to
have_content
(
build3
.
id
)
expect
(
page
).
to
have_link
'Cancel all'
end
end
end
context
'when have no builds finished'
do
it
'shows a message'
do
create
(
:ci_build
,
commit:
commit
,
status: :running
)
visit
admin_builds_path
(
scope: :finished
)
expect
(
page
.
find
(
".build-link"
)).
to
have_content
(
build
.
id
)
expect
(
page
).
to
have_selector
(
'.project-issuable-filter li.active'
,
text:
'Finished'
)
expect
(
page
.
find
(
".build-link"
)).
not_to
have_content
(
build2
.
id
)
expect
(
page
).
to
have_content
'No builds to show'
expect
(
page
.
find
(
".build-link"
)).
not_to
have_content
(
build3
.
id
)
expect
(
page
).
to
have_link
'Cancel all'
end
end
end
end
end
end
end
end
spec/features/builds_spec.rb
View file @
567dc62b
...
@@ -15,11 +15,11 @@ describe "Builds" do
...
@@ -15,11 +15,11 @@ describe "Builds" do
context
"Running scope"
do
context
"Running scope"
do
before
do
before
do
@build
.
run!
@build
.
run!
visit
namespace_project_builds_path
(
@project
.
namespace
,
@project
)
visit
namespace_project_builds_path
(
@project
.
namespace
,
@project
,
scope: :running
)
end
end
it
{
expect
(
page
).
to
have_
content
'Running'
}
it
{
expect
(
page
).
to
have_
selector
(
'.project-issuable-filter li.active'
,
text:
'Running'
)
}
it
{
expect
(
page
).
to
have_
content
'Cancel running'
}
it
{
expect
(
page
).
to
have_
link
'Cancel running'
}
it
{
expect
(
page
).
to
have_content
@build
.
short_sha
}
it
{
expect
(
page
).
to
have_content
@build
.
short_sha
}
it
{
expect
(
page
).
to
have_content
@build
.
ref
}
it
{
expect
(
page
).
to
have_content
@build
.
ref
}
it
{
expect
(
page
).
to
have_content
@build
.
name
}
it
{
expect
(
page
).
to
have_content
@build
.
name
}
...
@@ -31,21 +31,22 @@ describe "Builds" do
...
@@ -31,21 +31,22 @@ describe "Builds" do
visit
namespace_project_builds_path
(
@project
.
namespace
,
@project
,
scope: :finished
)
visit
namespace_project_builds_path
(
@project
.
namespace
,
@project
,
scope: :finished
)
end
end
it
{
expect
(
page
).
to
have_selector
(
'.project-issuable-filter li.active'
,
text:
'Finished'
)
}
it
{
expect
(
page
).
to
have_content
'No builds to show'
}
it
{
expect
(
page
).
to
have_content
'No builds to show'
}
it
{
expect
(
page
).
to
have_
content
'Cancel running'
}
it
{
expect
(
page
).
to
have_
link
'Cancel running'
}
end
end
context
"All builds"
do
context
"All builds"
do
before
do
before
do
@project
.
builds
.
running_or_pending
.
each
(
&
:success
)
@project
.
builds
.
running_or_pending
.
each
(
&
:success
)
visit
namespace_project_builds_path
(
@project
.
namespace
,
@project
,
scope: :all
)
visit
namespace_project_builds_path
(
@project
.
namespace
,
@project
)
end
end
it
{
expect
(
page
).
to
have_
content
'All'
}
it
{
expect
(
page
).
to
have_
selector
(
'.project-issuable-filter li.active'
,
text:
'All'
)
}
it
{
expect
(
page
).
to
have_content
@build
.
short_sha
}
it
{
expect
(
page
).
to
have_content
@build
.
short_sha
}
it
{
expect
(
page
).
to
have_content
@build
.
ref
}
it
{
expect
(
page
).
to
have_content
@build
.
ref
}
it
{
expect
(
page
).
to
have_content
@build
.
name
}
it
{
expect
(
page
).
to
have_content
@build
.
name
}
it
{
expect
(
page
).
to_not
have_
content
'Cancel running'
}
it
{
expect
(
page
).
to_not
have_
link
'Cancel running'
}
end
end
end
end
...
@@ -56,8 +57,12 @@ describe "Builds" do
...
@@ -56,8 +57,12 @@ describe "Builds" do
click_link
"Cancel running"
click_link
"Cancel running"
end
end
it
{
expect
(
page
).
to
have_content
'No builds to show'
}
it
{
expect
(
page
).
to
have_selector
(
'.project-issuable-filter li.active'
,
text:
'All'
)
}
it
{
expect
(
page
).
to_not
have_content
'Cancel running'
}
it
{
expect
(
page
).
to
have_content
'canceled'
}
it
{
expect
(
page
).
to
have_content
@build
.
short_sha
}
it
{
expect
(
page
).
to
have_content
@build
.
ref
}
it
{
expect
(
page
).
to
have_content
@build
.
name
}
it
{
expect
(
page
).
to_not
have_link
'Cancel running'
}
end
end
describe
"GET /:project/builds/:id"
do
describe
"GET /:project/builds/:id"
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