Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
cfd839d6
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,体验更适合开发者的 AI 搜索 >>
提交
cfd839d6
编写于
2月 15, 2017
作者:
L
Lin Jen-Shin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix tests and disallow 0 to make it consistent with .gitlab-ci.yml
上级
602f3b84
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
17 addition
and
4 deletion
+17
-4
app/models/application_setting.rb
app/models/application_setting.rb
+9
-3
lib/api/entities.rb
lib/api/entities.rb
+1
-0
lib/api/settings.rb
lib/api/settings.rb
+1
-1
spec/models/application_setting_spec.rb
spec/models/application_setting_spec.rb
+6
-0
未找到文件。
app/models/application_setting.rb
浏览文件 @
cfd839d6
...
...
@@ -306,9 +306,15 @@ class ApplicationSetting < ActiveRecord::Base
end
def
check_default_artifacts_expire_in
ChronicDuration
.
parse
(
default_artifacts_expire_in
)
if
default_artifacts_expire_in
return
true
unless
default_artifacts_expire_in
if
ChronicDuration
.
parse
(
default_artifacts_expire_in
).
nil?
errors
.
add
(
:default_artifacts_expire_in
,
"can't be 0. Leave it blank for unlimited"
)
false
else
true
end
rescue
ChronicDuration
::
DurationParseError
=>
e
errors
.
add
(
:default_artifacts_expire_in
,
":
#{
e
.
message
}
"
)
false
...
...
lib/api/entities.rb
浏览文件 @
cfd839d6
...
...
@@ -559,6 +559,7 @@ module API
expose
:default_project_visibility
expose
:default_snippet_visibility
expose
:default_group_visibility
expose
:default_artifacts_expire_in
expose
:domain_whitelist
expose
:domain_blacklist_enabled
expose
:domain_blacklist
...
...
lib/api/settings.rb
浏览文件 @
cfd839d6
...
...
@@ -57,7 +57,7 @@ module API
requires
:shared_runners_text
,
type:
String
,
desc:
'Shared runners text '
end
optional
:max_artifacts_size
,
type:
Integer
,
desc:
"Set the maximum file size for each job's artifacts"
optional
:default_artifacts_expire_in
,
type:
Integer
,
desc:
"Set the default expiration time for each job's artifacts"
optional
:default_artifacts_expire_in
,
type:
String
,
desc:
"Set the default expiration time for each job's artifacts"
optional
:max_pages_size
,
type:
Integer
,
desc:
'Maximum size of pages in MB'
optional
:container_registry_token_expire_delay
,
type:
Integer
,
desc:
'Authorization token duration (minutes)'
optional
:metrics_enabled
,
type:
Boolean
,
desc:
'Enable the InfluxDB metrics'
...
...
spec/models/application_setting_spec.rb
浏览文件 @
cfd839d6
...
...
@@ -36,6 +36,12 @@ describe ApplicationSetting, models: true do
expect
(
setting
).
to
be_invalid
end
it
'does not allow 0'
do
setting
.
update
(
default_artifacts_expire_in:
'0'
)
expect
(
setting
).
to
be_invalid
end
it
'sets the value if it is valid'
do
setting
.
update
(
default_artifacts_expire_in:
'30 days'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录