Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
LinuxSuRen
jenkins
提交
48fc05d2
J
jenkins
项目概览
LinuxSuRen
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
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,发现更多精彩内容 >>
提交
48fc05d2
编写于
3月 05, 2012
作者:
K
Kohsuke Kawaguchi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed a bug in executor/queue filtering for matrix projects.
上级
4f6f058e
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
74 addition
and
45 deletion
+74
-45
changelog.html
changelog.html
+3
-0
core/src/main/java/hudson/matrix/MatrixProject.java
core/src/main/java/hudson/matrix/MatrixProject.java
+13
-1
core/src/main/java/hudson/model/AbstractProject.java
core/src/main/java/hudson/model/AbstractProject.java
+15
-0
core/src/main/java/hudson/model/View.java
core/src/main/java/hudson/model/View.java
+43
-44
未找到文件。
changelog.html
浏览文件 @
48fc05d2
...
...
@@ -55,6 +55,9 @@ Upcoming changes</a>
<!-- Record your changes in the trunk here. -->
<div
id=
"trunk"
style=
"display:none"
>
<!--=TRUNK-BEGIN=-->
<ul
class=
image
>
<li
class=
bug
>
Fixed a bug in executor/queue filtering for matrix projects.
(
<a
href=
"https://github.com/jenkinsci/jenkins/pull/394"
>
pull 394
</a>
)
<li
class=
bug
>
Some of the context menu items have wrong links
(
<a
href=
"https://issues.jenkins-ci.org/browse/JENKINS-12945"
>
issue 12945
</a>
)
...
...
core/src/main/java/hudson/matrix/MatrixProject.java
浏览文件 @
48fc05d2
...
...
@@ -161,6 +161,18 @@ public class MatrixProject extends AbstractProject<MatrixProject,MatrixBuild> im
return
sorter
;
}
/**
* {@link MatrixProject} is relevant with all the labels its configurations are relevant.
*/
@Override
public
Set
<
Label
>
getRelevantLabels
()
{
Set
<
Label
>
r
=
new
HashSet
<
Label
>();
r
.
add
(
getAssignedLabel
());
for
(
MatrixConfiguration
c
:
getActiveConfigurations
())
r
.
add
(
c
.
getAssignedLabel
());
return
super
.
getRelevantLabels
();
}
public
void
setSorter
(
MatrixConfigurationSorter
sorter
)
throws
IOException
{
this
.
sorter
=
sorter
;
save
();
...
...
core/src/main/java/hudson/model/AbstractProject.java
浏览文件 @
48fc05d2
...
...
@@ -314,6 +314,21 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
return
Jenkins
.
getInstance
().
getLabel
(
assignedNode
);
}
/**
* Set of labels relevant to this job.
*
* This method is used to determine what slaves are relevant to jobs, for example by {@link View}s.
* It does not affect the scheduling. This information is informational and the best-effort basis.
*
* @since 1.456
* @return
* Minimally it should contain {@link #getAssignedLabel()}. The set can contain null element
* to correspond to the null return value from {@link #getAssignedLabel()}.
*/
public
Set
<
Label
>
getRelevantLabels
()
{
return
Collections
.
singleton
(
getAssignedLabel
());
}
/**
* Gets the textual representation of the assigned label as it was entered by the user.
*/
...
...
core/src/main/java/hudson/model/View.java
浏览文件 @
48fc05d2
...
...
@@ -373,24 +373,17 @@ public abstract class View extends AbstractModelObject implements AccessControll
List
<
Computer
>
result
=
new
ArrayList
<
Computer
>();
boolean
roam
=
false
;
HashSet
<
Label
>
labels
=
new
HashSet
<
Label
>();
for
(
Item
item:
getItems
())
{
if
(
item
instanceof
AbstractProject
<?,?>)
{
AbstractProject
<?,?>
p
=
(
AbstractProject
<?,
?>)
item
;
Label
l
=
p
.
getAssignedLabel
();
if
(
l
!=
null
)
{
labels
.
add
(
l
);
}
else
{
roam
=
true
;
}
for
(
Item
item
:
getItems
())
{
if
(
item
instanceof
AbstractProject
<?,
?>)
{
labels
.
addAll
(((
AbstractProject
<?,
?>)
item
).
getRelevantLabels
());
}
}
for
(
Computer
c
:
computers
)
{
for
(
Computer
c
:
computers
)
{
Node
n
=
c
.
getNode
();
if
(
n
!=
null
)
{
if
(
roam
&&
n
.
getMode
()
==
Mode
.
NORMAL
||
!
Collections
.
disjoint
(
n
.
getAssignedLabels
(),
labels
))
{
if
(
labels
.
contains
(
null
)
&&
n
.
getMode
()
==
Mode
.
NORMAL
||
!
Collections
.
disjoint
(
n
.
getAssignedLabels
(),
labels
))
{
result
.
add
(
c
);
}
}
...
...
@@ -406,9 +399,15 @@ public abstract class View extends AbstractModelObject implements AccessControll
Collection
<
TopLevelItem
>
items
=
getItems
();
List
<
Queue
.
Item
>
result
=
new
ArrayList
<
Queue
.
Item
>();
for
(
Queue
.
Item
qi
:
Jenkins
.
getInstance
().
getQueue
().
getItems
())
{
for
(
Queue
.
Item
qi
:
Jenkins
.
getInstance
().
getQueue
().
getItems
())
{
if
(
items
.
contains
(
qi
.
task
))
{
result
.
add
(
qi
);
}
else
if
(
qi
.
task
instanceof
AbstractProject
<?,
?>)
{
AbstractProject
<?,?>
project
=
(
AbstractProject
<?,
?>)
qi
.
task
;
if
(
items
.
contains
(
project
.
getRootProject
()))
{
result
.
add
(
qi
);
}
}
}
return
result
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录