Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
da8b72d4
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(gitcode.net)2024年7月9日维护升级公告
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
da8b72d4
编写于
5月 06, 2016
作者:
G
Grzegorz Bizon
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Extend runner options that are configurable via API
上级
7b607cf4
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
5 deletion
+13
-5
lib/api/entities.rb
lib/api/entities.rb
+1
-0
lib/api/runners.rb
lib/api/runners.rb
+1
-1
spec/requests/api/runners_spec.rb
spec/requests/api/runners_spec.rb
+11
-4
未找到文件。
lib/api/entities.rb
浏览文件 @
da8b72d4
...
...
@@ -408,6 +408,7 @@ module API
class
RunnerDetails
<
Runner
expose
:tag_list
expose
:run_untagged
expose
:version
,
:revision
,
:platform
,
:architecture
expose
:contacted_at
expose
:token
,
if:
lambda
{
|
runner
,
options
|
options
[
:current_user
].
is_admin?
||
!
runner
.
is_shared?
}
...
...
lib/api/runners.rb
浏览文件 @
da8b72d4
...
...
@@ -49,7 +49,7 @@ module API
runner
=
get_runner
(
params
[
:id
])
authenticate_update_runner!
(
runner
)
attrs
=
attributes_for_keys
[
:description
,
:active
,
:tag_list
]
attrs
=
attributes_for_keys
[
:description
,
:active
,
:tag_list
,
:run_untagged
]
if
runner
.
update
(
attrs
)
present
runner
,
with:
Entities
::
RunnerDetails
,
current_user:
current_user
else
...
...
spec/requests/api/runners_spec.rb
浏览文件 @
da8b72d4
...
...
@@ -184,21 +184,24 @@ describe API::Runners, api: true do
description
=
shared_runner
.
description
active
=
shared_runner
.
active
put
api
(
"/runners/
#{
shared_runner
.
id
}
"
,
admin
),
description:
"
#{
description
}
_updated"
,
active:
!
active
,
tag_list:
[
'ruby2.1'
,
'pgsql'
,
'mysql'
]
update_runner
(
shared_runner
.
id
,
admin
,
description:
"
#{
description
}
_updated"
,
active:
!
active
,
tag_list:
[
'ruby2.1'
,
'pgsql'
,
'mysql'
],
run_untagged:
'false'
)
shared_runner
.
reload
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
shared_runner
.
description
).
to
eq
(
"
#{
description
}
_updated"
)
expect
(
shared_runner
.
active
).
to
eq
(
!
active
)
expect
(
shared_runner
.
tag_list
).
to
include
(
'ruby2.1'
,
'pgsql'
,
'mysql'
)
expect
(
shared_runner
.
run_untagged?
).
to
be
false
end
end
context
'when runner is not shared'
do
it
'should update runner'
do
description
=
specific_runner
.
description
put
api
(
"/runners/
#{
specific_runner
.
id
}
"
,
admin
),
description:
'test'
update_runner
(
specific_runner
.
id
,
admin
,
description:
'test'
)
specific_runner
.
reload
expect
(
response
.
status
).
to
eq
(
200
)
...
...
@@ -208,10 +211,14 @@ describe API::Runners, api: true do
end
it
'should return 404 if runner does not exists'
do
put
api
(
'/runners/9999'
,
admin
),
description:
'test'
update_runner
(
9999
,
admin
,
description:
'test'
)
expect
(
response
.
status
).
to
eq
(
404
)
end
def
update_runner
(
id
,
user
,
args
)
put
api
(
"/runners/
#{
id
}
"
,
user
),
args
end
end
context
'authorized user'
do
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录