Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
33c9d6e4
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
33c9d6e4
编写于
10月 13, 2015
作者:
K
Kamil Trzcinski
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix retry and cancel for build
上级
82da19ce
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
27 addition
and
15 deletion
+27
-15
app/models/ci/build.rb
app/models/ci/build.rb
+2
-2
app/views/projects/commit/ci.html.haml
app/views/projects/commit/ci.html.haml
+13
-9
app/views/projects/commit_statuses/_commit_status.html.haml
app/views/projects/commit_statuses/_commit_status.html.haml
+3
-3
spec/features/commits_spec.rb
spec/features/commits_spec.rb
+9
-1
未找到文件。
app/models/ci/build.rb
浏览文件 @
33c9d6e4
...
...
@@ -220,14 +220,14 @@ module Ci
def
cancel_url
if
active?
Gitlab
::
Application
.
routes
.
url_helpers
.
cancel_namespace_project_build_path
(
gl_project
.
namespace
,
gl_project
,
self
,
return_to:
request
.
original_url
)
cancel_namespace_project_build_path
(
gl_project
.
namespace
,
gl_project
,
self
)
end
end
def
retry_url
if
commands
.
present?
Gitlab
::
Application
.
routes
.
url_helpers
.
cancel_namespace_project_build_path
(
gl_project
.
namespace
,
gl_project
,
self
,
return_to:
request
.
original_url
)
retry_namespace_project_build_path
(
gl_project
.
namespace
,
gl_project
,
self
)
end
end
...
...
app/views/projects/commit/ci.html.haml
浏览文件 @
33c9d6e4
...
...
@@ -3,11 +3,6 @@
=
render
"commit_box"
=
render
"ci_menu"
-
if
@ci_project
&&
current_user
&&
can?
(
current_user
,
:manage_builds
,
@project
)
.pull-right
-
if
@ci_commit
.
builds
.
running_or_pending
.
any?
=
link_to
"Cancel"
,
cancel_builds_namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
.
sha
),
class:
'btn btn-sm btn-danger'
-
if
@ci_commit
.
yaml_errors
.
present?
.bs-callout.bs-callout-danger
...
...
@@ -22,11 +17,18 @@
.gray-content-block.second-block
Latest builds
-
if
@ci_commit
.
duration
>
0
%small
.pull-right
.pull-right
-
if
@ci_commit
.
duration
>
0
%i
.fa.fa-time
#{
time_interval_in_words
@ci_commit
.
duration
}
-
if
@ci_project
&&
current_user
&&
can?
(
current_user
,
:manage_builds
,
@project
)
-
if
@ci_commit
.
builds
.
running_or_pending
.
any?
=
link_to
"Cancel all"
,
cancel_builds_namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
.
sha
),
class:
'btn btn-xs btn-danger'
%table
.table.builds
%thead
%tr
...
...
@@ -41,7 +43,8 @@
%th
Coverage
%th
-
@ci_commit
.
refs
.
each
do
|
ref
|
=
render
partial:
"projects/commit_statuses/commit_status"
,
collection:
@ci_commit
.
statuses
.
for_ref
(
ref
).
latest
.
ordered
,
coverage:
@ci_project
.
try
(
:coverage_enabled?
),
controls:
true
=
render
partial:
"projects/commit_statuses/commit_status"
,
collection:
@ci_commit
.
statuses
.
for_ref
(
ref
).
latest
.
ordered
,
locals:
{
coverage:
@ci_project
.
try
(
:coverage_enabled?
),
allow_retry:
true
}
-
if
@ci_commit
.
retried
.
any?
.gray-content-block.second-block
...
...
@@ -60,4 +63,5 @@
-
if
@ci_project
&&
@ci_project
.
coverage_enabled?
%th
Coverage
%th
=
render
partial:
"projects/commit_statuses/commit_status"
,
collection:
@ci_commit
.
retried
,
coverage:
@ci_project
.
try
(
:coverage_enabled?
)
=
render
partial:
"projects/commit_statuses/commit_status"
,
collection:
@ci_commit
.
retried
,
locals:
{
coverage:
@ci_project
.
try
(
:coverage_enabled?
)
}
app/views/projects/commit_statuses/_commit_status.html.haml
浏览文件 @
33c9d6e4
...
...
@@ -41,11 +41,11 @@
#{
commit_status
.
coverage
}
%
%td
-
if
defined?
(
controls
)
&&
controls
&&
current_user
&&
can?
(
current_user
,
:manage_builds
,
gl_project
)
.pull-right
.pull-right
-
if
current_user
&&
can?
(
current_user
,
:manage_builds
,
commit_status
.
gl_project
)
-
if
commit_status
.
cancel_url
=
link_to
commit_status
.
cancel_url
,
title:
'Cancel'
do
%i
.fa.fa-remove.cred
-
elsif
commit_status
.
retry_url
-
elsif
defined?
(
allow_retry
)
&&
allow_retry
&&
commit_status
.
retry_url
=
link_to
commit_status
.
retry_url
,
method: :post
,
title:
'Retry'
do
%i
.fa.fa-repeat
spec/features/commits_spec.rb
浏览文件 @
33c9d6e4
...
...
@@ -29,8 +29,16 @@ describe "Commits" do
it
{
expect
(
page
).
to
have_content
@commit
.
git_author_name
}
end
describe
"Cancel
commit
"
do
describe
"Cancel
all builds
"
do
it
"cancels commit"
do
visit
ci_status_path
(
@commit
)
click_on
"Cancel all"
expect
(
page
).
to
have_content
"canceled"
end
end
describe
"Cancel build"
do
it
"cancels build"
do
visit
ci_status_path
(
@commit
)
click_on
"Cancel"
expect
(
page
).
to
have_content
"canceled"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录