Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
FIY695
jenkins
提交
5587d13f
J
jenkins
项目概览
FIY695
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jenkins
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5587d13f
编写于
4月 21, 2012
作者:
S
Seiji Sogabe
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[FIXED JENKINS-13524] Validate project naming regex immediately
上级
f338e21b
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
40 addition
and
9 deletion
+40
-9
changelog.html
changelog.html
+5
-0
core/src/main/java/jenkins/model/ProjectNamingStrategy.java
core/src/main/java/jenkins/model/ProjectNamingStrategy.java
+23
-3
core/src/main/resources/jenkins/model/Messages.properties
core/src/main/resources/jenkins/model/Messages.properties
+5
-2
core/src/main/resources/jenkins/model/Messages_ja.properties
core/src/main/resources/jenkins/model/Messages_ja.properties
+5
-2
core/src/main/resources/jenkins/model/ProjectNamingStrategy/PatternProjectNamingStrategy/config.groovy
...NamingStrategy/PatternProjectNamingStrategy/config.groovy
+2
-2
未找到文件。
changelog.html
浏览文件 @
5587d13f
...
...
@@ -64,6 +64,11 @@ Upcoming changes</a>
<li
class=
rfe
>
Convert "Delete this build" buttons into links in the sidepanel.
(
<a
href=
"https://issues.jenkins-ci.org/browse/JENKINS-13387"
>
issue 13387
</a>
)
<li
class=
rfe
>
Validate project naming regex immediately.
(
<a
href=
"https://issues.jenkins-ci.org/browse/JENKINS-13524"
>
issue 13524
</a>
)
</ul>
</div>
<!--=TRUNK-END=-->
...
...
core/src/main/java/jenkins/model/ProjectNamingStrategy.java
浏览文件 @
5587d13f
/*
* The MIT License
*
* Copyright (c) 2012, Dominik Bartholdi
* Copyright (c) 2012, Dominik Bartholdi
, Seiji Sogabe
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
...
...
@@ -26,15 +26,21 @@ package jenkins.model;
import
hudson.DescriptorExtensionList
;
import
hudson.Extension
;
import
hudson.ExtensionPoint
;
import
hudson.Util
;
import
hudson.model.Describable
;
import
hudson.model.Descriptor
;
import
hudson.model.Failure
;
import
hudson.util.FormValidation
;
import
java.io.IOException
;
import
java.io.Serializable
;
import
java.util.regex.Pattern
;
import
java.util.regex.PatternSyntaxException
;
import
javax.servlet.ServletException
;
import
org.apache.commons.lang.StringUtils
;
import
org.kohsuke.stapler.DataBoundConstructor
;
import
org.kohsuke.stapler.QueryParameter
;
/**
* This ExtensionPoint allows to enforce the name of projects/jobs.
...
...
@@ -105,7 +111,7 @@ public abstract class ProjectNamingStrategy implements Describable<ProjectNaming
public
static
final
class
DescriptorImpl
extends
ProjectNamingStrategyDescriptor
{
@Override
public
String
getDisplayName
()
{
return
Messages
.
ProjectNamingStrategy_
DefaultProjectNamingStrategy_DisplayName
();
return
Messages
.
DefaultProjectNamingStrategy_DisplayName
();
}
@Override
...
...
@@ -158,13 +164,27 @@ public abstract class ProjectNamingStrategy implements Describable<ProjectNaming
@Override
public
String
getDisplayName
()
{
return
Messages
.
P
rojectNamingStrategy_P
atternProjectNamingStrategy_DisplayName
();
return
Messages
.
PatternProjectNamingStrategy_DisplayName
();
}
@Override
public
String
getHelpFile
()
{
return
"/help/system-config/patternJobNamingStrategy.html"
;
}
public
FormValidation
doCheckNamePattern
(
@QueryParameter
String
value
)
throws
IOException
,
ServletException
{
String
pattern
=
Util
.
fixEmptyAndTrim
(
value
);
if
(
pattern
==
null
)
{
return
FormValidation
.
error
(
Messages
.
PatternProjectNamingStrategy_NamePatternRequired
());
}
try
{
Pattern
.
compile
(
pattern
);
}
catch
(
PatternSyntaxException
e
)
{
return
FormValidation
.
error
(
Messages
.
PatternProjectNamingStrategy_NamePatternInvalidSyntax
());
}
return
FormValidation
.
ok
();
}
}
}
...
...
core/src/main/resources/jenkins/model/Messages.properties
浏览文件 @
5587d13f
...
...
@@ -59,5 +59,8 @@ CauseOfInterruption.ShortDescription=Aborted by {0}
CLI.shutdown.shortDescription
=
Immediately shuts down Jenkins server
CLI.safe-shutdown.shortDescription
=
Puts Jenkins into the quiet mode, wait for existing builds to be completed, and then shut down Jenkins.
ProjectNamingStrategy.DefaultProjectNamingStrategy.DisplayName
=
Default
ProjectNamingStrategy.PatternProjectNamingStrategy.DisplayName
=
Pattern
DefaultProjectNamingStrategy.DisplayName
=
Default
PatternProjectNamingStrategy.DisplayName
=
Pattern
PatternProjectNamingStrategy.NamePatternRequired
=
Name Pattern is required
PatternProjectNamingStrategy.NamePatternInvalidSyntax
=
regular expression's syntax is invalid.
\ No newline at end of file
core/src/main/resources/jenkins/model/Messages_ja.properties
浏览文件 @
5587d13f
...
...
@@ -53,5 +53,8 @@ CLI.shutdown.shortDescription=Jenkins\u30b5\u30fc\u30d0\u30fc\u3092\u76f4\u3061\
CLI.safe-shutdown.shortDescription
=
\
Jenkins
\u3092\u
7d42
\u
4e86
\u
30e2
\u
30fc
\u
30c9
\u
306b
\u5909\u
66f4
\u3057\u
30d3
\u
30eb
\u
30c9
\u
304c
\u
5b8c
\u
4e86
\u
5f8c
\u
306b
\u3001\u
30b7
\u
30e3
\u
30c3
\u
30c8
\u
30c0
\u
30a6
\u
30f3
\u3057\u
307e
\u3059\u3002
ProjectNamingStrategy.DefaultProjectNamingStrategy.DisplayName
=
\u
30c7
\u
30d5
\u
30a9
\u
30eb
\u
30c8
ProjectNamingStrategy.PatternProjectNamingStrategy.DisplayName
=
\u
30d1
\u
30bf
\u
30fc
\u
30f3
DefaultProjectNamingStrategy.DisplayName
=
\u
30c7
\u
30d5
\u
30a9
\u
30eb
\u
30c8
PatternProjectNamingStrategy.DisplayName
=
\u
30d1
\u
30bf
\u
30fc
\u
30f3
PatternProjectNamingStrategy.NamePatternRequired
=
\u
30d1
\u
30bf
\u
30fc
\u
30f3
\u
306f
\u
5fc5
\u9808\u3067\u3059\u3002
PatternProjectNamingStrategy.NamePatternInvalidSyntax
=
\u
6b63
\u
898f
\u8868\u
73fe
\u
306b
\u
8aa4
\u
308a
\u
304c
\u3042\u
308a
\u
307e
\u3059\u3002
\ No newline at end of file
core/src/main/resources/jenkins/model/ProjectNamingStrategy/PatternProjectNamingStrategy/config.groovy
浏览文件 @
5587d13f
...
...
@@ -3,8 +3,8 @@ package jenkins.model.ProjectNamingStrategy.PatternProjectNamingStrategy;
def
f
=
namespace
(
lib
.
FormTagLib
)
f
.
entry
(
title:
_
(
"namePattern"
))
{
f
.
textbox
(
name:
"namePattern"
,
value:
h
.
defaulted
(
instance
?.
namePattern
,
descriptor
.
DEFAULT_PATTERN
),
class
:"
fixed
-
width
"
)
f
.
entry
(
title:
_
(
"namePattern"
)
,
field:
"namePattern"
)
{
f
.
textbox
(
value:
h
.
defaulted
(
instance
?.
namePattern
,
descriptor
.
DEFAULT_PATTERN
),
class
:"
fixed
-
width
"
)
}
f
.
entry
(
title:
_
(
"forceExistingJobs"
),
field:
"forceExistingJobs"
)
{
f
.
checkbox
(
name:
"forceExistingJobs"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录