Skip to content

Commit 86ce56c

Browse files
committed
Merge remote branch 'origin/master'
Conflicts: changelog.html
2 parents 7c63543 + 8a9260f commit 86ce56c

File tree

18 files changed

+120
-18
lines changed

18 files changed

+120
-18
lines changed

changelog.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@
5555
<!-- Record your changes in the trunk here. -->
5656
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
5757
<ul class=image>
58-
<li class=>
58+
<li class=rfe>
59+
Update center UI improvement. "Install" button is now always visisble.
60+
<li class=bug>
61+
Fixed prematurely re-drawn matrix test result graph.
5962
</ul>
6063
</div><!--=TRUNK-END=-->
6164

core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ THE SOFTWARE.
460460
<dependency>
461461
<groupId>org.jenkins-ci</groupId>
462462
<artifactId>memory-monitor</artifactId>
463-
<version>1.5</version>
463+
<version>1.7</version>
464464
</dependency>
465465
<dependency><!-- StAX implementation. See HUDSON-2547. -->
466466
<groupId>org.codehaus.woodstox</groupId>

core/src/main/java/hudson/EnvVars.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
* case insensitive but case preserving.
5353
*
5454
* <p>
55-
* In Hudson, often we need to build up "environment variable overrides"
55+
* In Jenkins, often we need to build up "environment variable overrides"
5656
* on master, then to execute the process on slaves. This causes a problem
5757
* when working with variables like <tt>PATH</tt>. So to make this work,
5858
* we introduce a special convention <tt>PATH+FOO</tt> &mdash; all entries
@@ -81,7 +81,7 @@ public EnvVars(Map<String,String> m) {
8181
this();
8282
putAll(m);
8383

84-
// because of the backward compatibility, some parts of Hudson passes
84+
// because of the backward compatibility, some parts of Jenkins passes
8585
// EnvVars as Map<String,String> so downcasting is safer.
8686
if (m instanceof EnvVars) {
8787
EnvVars lhs = (EnvVars) m;
@@ -214,7 +214,7 @@ public EnvVars call() {
214214
*
215215
* <p>
216216
* Despite what the name might imply, this is the environment variable
217-
* of the current JVM process. And therefore, it is Hudson master's environment
217+
* of the current JVM process. And therefore, it is Jenkins master's environment
218218
* variables only when you access this from the master.
219219
*
220220
* <p>

core/src/main/java/hudson/model/AbstractBuild.java

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,10 @@ public Result run(BuildListener listener) throws Exception {
452452
try {
453453
workspace = lease.path.getRemote();
454454
node.getFileSystemProvisioner().prepareWorkspace(AbstractBuild.this,lease.path,listener);
455-
455+
456+
for (WorkspaceListener wl : WorkspaceListener.all()) {
457+
wl.beforeUse(AbstractBuild.this, lease.path, listener);
458+
}
456459
preCheckout(launcher,listener);
457460
checkout(listener);
458461

@@ -841,11 +844,23 @@ public EnvVars getEnvironment(TaskListener log) throws IOException, InterruptedE
841844

842845
/**
843846
* During the build, expose the environments contributed by {@link BuildWrapper}s and others.
844-
*
847+
*
848+
* <p>
849+
* Since 1.444, executor thread that's doing the build can access mutable underlying list,
850+
* which allows the caller to add/remove environments. The recommended way of adding
851+
* environment is through {@link BuildWrapper}, but this might be handy for build steps
852+
* who wants to expose additional environment variables to the rest of the build.
853+
*
845854
* @return can be empty list, but never null. Immutable.
846855
* @since 1.437
847856
*/
848857
public EnvironmentList getEnvironments() {
858+
Executor e = Executor.currentExecutor();
859+
if (e!=null && e.getCurrentExecutable()==this) {
860+
if (buildEnvironments==null) buildEnvironments = new ArrayList<Environment>();
861+
return new EnvironmentList(buildEnvironments);
862+
}
863+
849864
return new EnvironmentList(buildEnvironments==null ? Collections.<Environment>emptyList() : ImmutableList.copyOf(buildEnvironments));
850865
}
851866

core/src/main/java/hudson/model/EnvironmentList.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,19 @@ public <T extends Environment> T get(Class<T> type) {
5656
}
5757
return null;
5858
}
59+
60+
@Override
61+
public Environment set(int index, Environment element) {
62+
return base.set(index, element);
63+
}
64+
65+
@Override
66+
public void add(int index, Environment element) {
67+
base.add(index, element);
68+
}
69+
70+
@Override
71+
public Environment remove(int index) {
72+
return base.remove(index);
73+
}
5974
}

core/src/main/java/hudson/model/WorkspaceListener.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import hudson.ExtensionList;
44
import hudson.ExtensionPoint;
5+
import hudson.FilePath;
56

67
public abstract class WorkspaceListener implements ExtensionPoint {
78

@@ -11,6 +12,16 @@ public abstract class WorkspaceListener implements ExtensionPoint {
1112
*/
1213
public void afterDelete(AbstractProject project) {
1314

15+
}
16+
17+
/**
18+
* Called before a build uses a workspace. IE, before any SCM checkout.
19+
* @param r
20+
* @param workspace
21+
* @param listener
22+
*/
23+
public void beforeUse(AbstractBuild b, FilePath workspace, BuildListener listener) {
24+
1425
}
1526

1627
/**

core/src/main/java/hudson/slaves/SlaveComputer.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,14 +310,22 @@ public void setChannel(InputStream in, OutputStream out, TaskListener taskListen
310310
* so the implementation of the listener doesn't need to do that again.
311311
*/
312312
public void setChannel(InputStream in, OutputStream out, OutputStream launchLog, Channel.Listener listener) throws IOException, InterruptedException {
313+
Channel channel = new Channel(nodeName,threadPoolForRemoting, Channel.Mode.NEGOTIATE, in,out, launchLog);
314+
setChannel(channel,launchLog,listener);
315+
}
316+
317+
/**
318+
* Sets up the connection through an exsting channel.
319+
*
320+
* @since 1.444
321+
*/
322+
public void setChannel(Channel channel, OutputStream launchLog, Channel.Listener listener) throws IOException, InterruptedException {
313323
if(this.channel!=null)
314324
throw new IllegalStateException("Already connected");
315325

316326
final TaskListener taskListener = new StreamTaskListener(launchLog);
317327
PrintStream log = taskListener.getLogger();
318328

319-
Channel channel = new Channel(nodeName,threadPoolForRemoting, Channel.Mode.NEGOTIATE,
320-
in,out, launchLog);
321329
channel.addListener(new Channel.Listener() {
322330
@Override
323331
public void onClosed(Channel c, IOException cause) {

core/src/main/java/hudson/tasks/test/TestResultProjectAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public AbstractTestResultAction getLastTestResultAction() {
7777
AbstractBuild<?,?> b=project.getLastBuild();
7878
while(b!=null) {
7979
AbstractTestResultAction a = b.getTestResultAction();
80-
if(a!=null) return a;
80+
if(a!=null && (!b.isBuilding())) return a;
8181
if(b==tb)
8282
// if even the last successful build didn't produce the test result,
8383
// that means we just don't have any tests configured.

core/src/main/java/hudson/taglibs/eclipse.dsld renamed to core/src/main/resources/dsld/eclipse.dsld

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// this is the DSL descriptor to support the creation of groovy views in eclipse
2+
// for more information about the groovy DSL support in eclipse see: http://groovy.codehaus.org/DSL+Descriptors+for+Groovy-Eclipse
13
// fileExtension(...) and fileName(...)
24
(isScript() /*& sourceFolderOfCurrentFile("src/main/resources")*/).accept {
35
provider "Jenkins Groovy View";

core/src/main/resources/hudson/PluginManager/sites.jelly

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ THE SOFTWARE.
3838
<tr style="border-bottom:none">
3939
<td colspan="2">
4040
<p>
41-
This Jenkins is configured to receive updates from the following sourcse:
41+
This Jenkins is configured to receive updates from the following sources:
4242
</p>
4343
</td>
4444
</tr>

0 commit comments

Comments
 (0)