Skip to content
Permalink
Browse files
Merge branch 'master' into plugin-manager-dependants
* master:
  Update the changelog by new merges:
  [FIXED JENKINS-30569] HistoryWidget: fix JS syntax error
  [FIXED JENKINS-29014] render API link conditional on getApi() presence
  [JENKINS-21720] JS alert preventig to leave a configuration page even without formulary changes
  add ctags file 'tags' to .gitignore
  [maven-release-plugin] prepare release jenkins-1.632
  [FIXED JENKINS-29888] Handling all exceptions returned by logRotator
  [JENKINS-30742] Fixed possible NPE in AbstractProject.resolveForCLI()
  • Loading branch information
tfennelly committed Oct 6, 2015
2 parents a8e83c3 + a79e2f1 commit 95ca3da67d217c90d31819ec92e521e2072acd5a
@@ -17,6 +17,9 @@ build
# vim
*~

# ctags
tags

# OS X
.DS_Store

@@ -54,6 +54,25 @@

<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<li class="bug">
Properly handle <code>RuntimeException</code>s in run retention policy handler calls.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-29888">issue 29888</a>)
<li class="bug">
Prevent <code>NullPointerException</code> in CLI if Jenkins cannot find the specified job
or a job with the nearest name.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-30742">issue 30742</a>)
<li class="bug">
Do not show <i>REST API</i> link for pages, which have no API handlers.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-29014">issue 29014</a>)
<li class="bug">
JS alert preventing to leave a configuration page without changes.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-21720">issue 21720</a>)
<li class="bug">
JS error triggered by collapsing build history widget.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-30569">issue 30569</a>)
</div><!--=TRUNK-END=-->

<h3><a name=v1.632>What's new in 1.632</a> (2015/10/05)</h3>
<ul class=image>
<li class="bug">
Optimize TagCloud size calculation.
@@ -74,7 +93,7 @@
Sidepanel controls with confirmation (<code>lib/layout/task</code>) did not assign the proper CSS style.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-30787">issue 30787</a>)
</ul>
</div><!--=TRUNK-END=-->

<h3><a name=v1.631>What's new in 1.631</a> (2015/09/27)</h3>
<ul class=image>
<li class=rfe>
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>pom</artifactId>
<version>1.632-SNAPSHOT</version>
<version>1.632</version>
</parent>

<artifactId>cli</artifactId>
@@ -29,7 +29,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>pom</artifactId>
<version>1.632-SNAPSHOT</version>
<version>1.632</version>
</parent>

<artifactId>jenkins-core</artifactId>
@@ -2248,8 +2248,11 @@ public int compare(Integer o1, Integer o2) {
public static AbstractProject resolveForCLI(
@Argument(required=true,metaVar="NAME",usage="Job name") String name) throws CmdLineException {
AbstractProject item = Jenkins.getInstance().getItemByFullName(name, AbstractProject.class);
if (item==null)
throw new CmdLineException(null,Messages.AbstractItem_NoSuchJobExists(name,AbstractProject.findNearest(name).getFullName()));
if (item==null) {
AbstractProject project = AbstractProject.findNearest(name);
throw new CmdLineException(null, project == null ? Messages.AbstractItem_NoSuchJobExistsWithoutSuggestion(name)
: Messages.AbstractItem_NoSuchJobExists(name, project.getFullName()));
}
return item;
}

@@ -1803,11 +1803,9 @@ protected final void execute(@Nonnull RunExecution job) {

try {
getParent().logRotate();
} catch (IOException e) {
LOGGER.log(Level.SEVERE, "Failed to rotate log",e);
} catch (InterruptedException e) {
LOGGER.log(Level.SEVERE, "Failed to rotate log",e);
}
} catch (Exception e) {
LOGGER.log(Level.SEVERE, "Failed to rotate log",e);
}
} finally {
onEndBuilding();
}
@@ -101,7 +101,9 @@ THE SOFTWARE.
</tr>
</j:if>
</l:pane>
<script defer="true">
updateBuildHistory("${it.baseUrl}/buildHistory/ajax",${it.nextBuildNumberToFetch});
</script>
<j:if test="!empty(it.nextBuildNumberToFetch)">
<script defer="true">
updateBuildHistory("${it.baseUrl}/buildHistory/ajax", ${it.nextBuildNumberToFetch});
</script>
</j:if>
</j:jelly>
@@ -33,9 +33,6 @@
}

function initConfirm() {
// Timeout is needed since some events get sent on page load for some reason.
// Shouldn't hurt anything for this to only start monitoring events after a few millis;.
setTimeout(function() {
var configForm = document.getElementsByName("config");
if (configForm.length > 0) {
configForm = configForm[0]
@@ -78,7 +75,6 @@
for ( var i = 0; i < inputs.length; i++) {
$(inputs[i]).on('input', confirm);
}
}, 100);
}

window.onbeforeunload = confirmExit;
@@ -41,6 +41,19 @@ function updateListBox(listBox,url,config) {
}

Behaviour.specify("SELECT.select", 'select', 1000, function(e) {

function hasChanged(selectEl, originalValue) {
var firstValue = selectEl.options[0].value;
var selectedValue = selectEl.value;
if (originalValue == "" && selectedValue == firstValue) {
// There was no value pre-selected but after the call to updateListBox the first value is selected by
// default. This must not be considered a change.
return false;
} else {
return originalValue != selectedValue;
}
};

// controls that this SELECT box depends on
refillOnChange(e,function(params) {
var value = e.value;
@@ -60,7 +73,9 @@ Behaviour.specify("SELECT.select", 'select', 1000, function(e) {
fireEvent(e,"filled"); // let other interested parties know that the items have changed

// if the update changed the current selection, others listening to this control needs to be notified.
if (e.value!=value) fireEvent(e,"change");
if (hasChanged(e, value)) {
fireEvent(e,"change");
}
}
});
});
@@ -254,7 +254,9 @@ ${h.initPageVariables(context)}
<div class="col-md-6" id="footer"></div>
<div class="col-md-18">
<span class="page_generated">${%Page generated}: <i:formatDate value="${h.getCurrentTime()}" type="both" dateStyle="medium" timeStyle="medium"/></span>
<span class="rest_api"><a href="api/">REST API</a></span>
<j:if test="${!empty(it.api)}">
<span class="rest_api"><a href="api/">REST API</a></span>
</j:if>
<span class="jenkins_ver"><a href="${h.getFooterURL()}">Jenkins ver. ${h.version}</a></span>
<j:if test="${extensionsAvailable}">
<j:forEach var="pd" items="${h.pageDecorators}">
@@ -12,7 +12,7 @@
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<name>Jenkins plugin POM</name>
<version>1.632-SNAPSHOT</version>
<version>1.632</version>
<packaging>pom</packaging>

<!--
@@ -23,7 +23,7 @@
<connection>scm:svn:https://svn.jenkins-ci.org/trunk/hudson/plugins/</connection>
<developerConnection>scm:svn:https://svn.jenkins-ci.org/trunk/hudson/plugins/</developerConnection>
<url>https://svn.jenkins-ci.org/trunk/hudson/plugins/</url>
<tag>HEAD</tag>
<tag>jenkins-1.632</tag>
</scm>

<issueManagement>
@@ -59,19 +59,19 @@
<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-war</artifactId>
<type>war</type>
<version>1.632-SNAPSHOT</version>
<version>1.632</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-core</artifactId>
<version>1.632-SNAPSHOT</version>
<version>1.632</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-test-harness</artifactId>
<version>1.632-SNAPSHOT</version>
<version>1.632</version>
<scope>test</scope>
</dependency>
<!--
@@ -33,7 +33,7 @@ THE SOFTWARE.

<groupId>org.jenkins-ci.main</groupId>
<artifactId>pom</artifactId>
<version>1.632-SNAPSHOT</version>
<version>1.632</version>
<packaging>pom</packaging>

<name>Jenkins main module</name>
@@ -59,7 +59,7 @@ THE SOFTWARE.
<connection>scm:git:git://github.com/jenkinsci/jenkins.git</connection>
<developerConnection>scm:git:ssh://git@github.com/jenkinsci/jenkins.git</developerConnection>
<url>https://github.com/jenkinsci/jenkins</url>
<tag>HEAD</tag>
<tag>jenkins-1.632</tag>
</scm>

<distributionManagement>
@@ -28,7 +28,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>pom</artifactId>
<version>1.632-SNAPSHOT</version>
<version>1.632</version>
</parent>

<artifactId>jenkins-test-harness</artifactId>
@@ -47,7 +47,8 @@ import hudson.triggers.Trigger
import hudson.triggers.TriggerDescriptor;
import hudson.util.StreamTaskListener;
import hudson.util.OneShotEvent
import jenkins.model.Jenkins;
import jenkins.model.Jenkins
import org.junit.Assert;
import org.jvnet.hudson.test.HudsonTestCase
import org.jvnet.hudson.test.Issue;
import org.jvnet.hudson.test.TestExtension;
@@ -56,6 +57,7 @@ import org.jvnet.hudson.test.recipes.PresetData.DataSet
import org.apache.commons.io.FileUtils;
import org.junit.Assume;
import org.jvnet.hudson.test.MockFolder
import org.kohsuke.args4j.CmdLineException

/**
* @author Kohsuke Kawaguchi
@@ -588,6 +590,25 @@ public class AbstractProjectTest extends HudsonTestCase {
assert project.triggers().size() == 1
}

@Issue("JENKINS-30742")
public void testResolveForCLI() {
try {
AbstractProject not_found = AbstractProject.resolveForCLI("never_created");
fail("Exception should occur before!");
} catch (CmdLineException e) {
assert e.getMessage().contentEquals("No such job \u2018never_created\u2019 exists.");
}

AbstractProject project = jenkins.createProject(FreeStyleProject.class, "never_created");
try {
AbstractProject not_found = AbstractProject.resolveForCLI("never_created1");
fail("Exception should occur before!");
} catch (CmdLineException e) {
assert e.getMessage().contentEquals("No such job \u2018never_created1\u2019 exists. Perhaps you meant \u2018never_created\u2019?")
}

}

static class MockBuildTriggerThrowsNPEOnStart<Item> extends Trigger {
@Override
public void start(hudson.model.Item project, boolean newInstance) { throw new NullPointerException(); }
@@ -28,7 +28,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>pom</artifactId>
<version>1.632-SNAPSHOT</version>
<version>1.632</version>
</parent>

<artifactId>jenkins-war</artifactId>

0 comments on commit 95ca3da

Please sign in to comment.