Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/2.0' into JENKINS-31162
Browse files Browse the repository at this point in the history
  • Loading branch information
recena committed Mar 16, 2016
2 parents 602eca7 + 5ecbb09 commit ee00e33
Show file tree
Hide file tree
Showing 27 changed files with 515 additions and 144 deletions.
6 changes: 5 additions & 1 deletion changelog.html
Expand Up @@ -54,12 +54,16 @@

<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class=>
</ul>
</div><!--=TRUNK-END=-->
<h3><a name=v2.0-alpha-3>What's new in 2.0-alpha-3</a> (2016/03/10)</h3>
<ul class=image>
<li class="bug">
Under some conditions Jenkins startup could fail because of incorrectly linked extensions; now recovering more gracefully.
(<a href-"https://issues.jenkins-ci.org/browse/JENKINS-25440">issue 25440</a>)
</ul>
</div><!--=TRUNK-END=-->
<h3><a name=v1.651>What's new in 1.651</a> (2016/02/28)</h3>
<ul class=image>
<li class="rfe">
Expand Down
2 changes: 1 addition & 1 deletion cli/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>pom</artifactId>
<version>2.0-alpha-3-SNAPSHOT</version>
<version>2.0-alpha-4-SNAPSHOT</version>
</parent>

<artifactId>cli</artifactId>
Expand Down
8 changes: 4 additions & 4 deletions core/pom.xml
Expand Up @@ -29,7 +29,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>pom</artifactId>
<version>2.0-alpha-3-SNAPSHOT</version>
<version>2.0-alpha-4-SNAPSHOT</version>
</parent>

<artifactId>jenkins-core</artifactId>
Expand All @@ -41,7 +41,7 @@ THE SOFTWARE.
<staplerFork>true</staplerFork>
<stapler.version>1.240</stapler.version>
<spring.version>2.5.6.SEC03</spring.version>
<groovy.version>1.8.9</groovy.version>
<groovy.version>2.4.6</groovy.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -411,13 +411,13 @@ THE SOFTWARE.
<dependency><!-- groovy shell uses this but uses an optional dependency -->
<groupId>jline</groupId>
<artifactId>jline</artifactId>
<version>1.0</version>
<version>2.12</version>
<scope>compile</scope>
</dependency>
<dependency><!-- groovy shell uses this but it doesn't declare this dependency -->
<groupId>org.fusesource.jansi</groupId>
<artifactId>jansi</artifactId>
<version>1.9</version>
<version>1.11</version>
</dependency>
<dependency>
<!--
Expand Down
16 changes: 12 additions & 4 deletions core/src/main/java/hudson/cli/GroovyshCommand.java
Expand Up @@ -41,7 +41,7 @@
import java.util.ArrayList;

import jline.UnsupportedTerminal;
import jline.Terminal;
import jline.TerminalFactory;
import org.kohsuke.args4j.Argument;

/**
Expand All @@ -65,10 +65,18 @@ protected int run() {

// this being remote means no jline capability is available
System.setProperty("jline.terminal", UnsupportedTerminal.class.getName());
Terminal.resetTerminal();
TerminalFactory.reset();

StringBuilder commandLine = new StringBuilder();
for (String arg : args) {
if (commandLine.length() > 0) {
commandLine.append(" ");
}
commandLine.append(arg);
}

Groovysh shell = createShell(stdin, stdout, stderr);
return shell.run(args.toArray(new String[args.size()]));
return shell.run(commandLine.toString());
}

@SuppressWarnings({"unchecked","rawtypes"})
Expand Down Expand Up @@ -101,7 +109,7 @@ public Object doCall(Object[] args) {
}
};
Groovysh shell = new Groovysh(cl, binding, io, registrar);
shell.getImports().add("import hudson.model.*");
shell.getImports().add("hudson.model.*");

// defaultErrorHook doesn't re-throw IOException, so ShellRunner in
// Groovysh will keep looping forever if we don't terminate when the
Expand Down
5 changes: 3 additions & 2 deletions core/src/main/java/hudson/util/spring/BeanBuilder.java
Expand Up @@ -39,6 +39,7 @@

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -132,7 +133,7 @@ public void parse(InputStream script, Binding binding) {
cc.setScriptBaseClass(ClosureScript.class.getName());
GroovyShell shell = new GroovyShell(classLoader,binding,cc);

ClosureScript s = (ClosureScript)shell.parse(script);
ClosureScript s = (ClosureScript)shell.parse(new InputStreamReader(script));
s.setDelegate(this);
s.run();
}
Expand Down Expand Up @@ -336,7 +337,7 @@ public Object call(Object... args) {

GroovyShell shell = classLoader != null ? new GroovyShell(classLoader,b) : new GroovyShell(b);
for (Resource resource : resources) {
shell.evaluate(resource.getInputStream());
shell.evaluate(new InputStreamReader(resource.getInputStream()));
}
}

Expand Down
5 changes: 2 additions & 3 deletions core/src/main/resources/hudson/model/Job/configure.jelly
Expand Up @@ -27,14 +27,13 @@ THE SOFTWARE.
-->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt">
<l:layout title="${it.displayName} Config" norefresh="true" permission="${it.EXTENDED_READ}">
<l:layout title="${it.displayName} Config" cssClass="config j-hide-left" norefresh="true" permission="${it.EXTENDED_READ}">
<st:include page="sidepanel.jelly" />
<f:breadcrumb-config-outline />
<l:main-panel>
<l:js src="jsbundles/config-tabbar.js" />
<l:css src="jsbundles/jenkins-widgets.css" />

<div class="behavior-loading">${%LOADING}</div>
<div class="behavior-loading">${%loading}</div>
<f:form method="post" action="configSubmit" name="config" tableClass="job-config tabbed">
<j:set var="descriptor" value="${it.descriptor}" />
<j:set var="instance" value="${it}" />
Expand Down
Expand Up @@ -8,19 +8,26 @@
<div class="modal-content">

<div class="modal-header">
<h4 class="modal-title">${%Security Token}</h4>
<h4 class="modal-title">${%Getting Started}</h4>
</div>
<div class="modal-body">
<i class="water-mark icon-service"></i>
<div class="jumbotron welcome-panel offline">

<h1>${%Security Token}</h1>
<p>${%As an extra measure of security, please enter the setup security token to proceed.}</p>
<p>${%It can be found in the logs for this Jenkins instance.}</p>
<h1>${%Unlock Jenkins}</h1>
<p>
${%To ensure Jenkins is securely set up by the administrator, a setup security token has been printed to the logs.}
<small>
<a href="https://jenkins-ci.org/redirect/find-jenkins-logs" target="_blank">
${%Not sure where to find the logs?}
</a>
</small>
</p>
<p>${%Please copy the token and paste it below.}</p>
<j:if test="${error}">
<div class="alert alert-danger">
<strong>${%ERROR:} </strong>
${%There is a problem with your security token, please check the server logs for the correct token}
${%There is a problem with the security token, please check the logs for the correct token}
</div>
</j:if>
<div class="form-group ${error ? 'has-error' : ''}">
Expand Down
@@ -1,10 +1,10 @@
installWizard_welcomePanel_title=Getting Started
installWizard_welcomePanel_banner=Initial Jenkins Setup
installWizard_welcomePanel_message=Choose plugins. This will add features to your Jenkins environment.
installWizard_welcomePanel_recommendedActionTitle=Start with recommended plugins
installWizard_welcomePanel_recommendedActionDetails=Install the set of plugins the community finds most useful
installWizard_welcomePanel_customizeActionTitle=Customize your plugins
installWizard_welcomePanel_customizeActionDetails=Select from a community approved list of plugins
installWizard_welcomePanel_banner=Customize Jenkins
installWizard_welcomePanel_message=Plugins extend Jenkins with additional features to support many different needs.
installWizard_welcomePanel_recommendedActionTitle=Install suggested plugins
installWizard_welcomePanel_recommendedActionDetails=Install plugins the Jenkins community finds most useful.
installWizard_welcomePanel_customizeActionTitle=Select plugins to install
installWizard_welcomePanel_customizeActionDetails=Select and install plugins most suitable for your needs.
installWizard_offline_title=Offline
installWizard_offline_message=This Jenkins instance appears to be offline. \
<p style="font-size:18px; margin-top: 6%"> \
Expand All @@ -15,7 +15,7 @@ You may choose to continue by configuring a proxy or skipping plugin installatio
installWizard_error_header=An error occurred
installWizard_error_message=An error occurred during installation:
installWizard_error_connection=Unable to connect to Jenkins
installWizard_installCustom_title=Plugin Selection
installWizard_installCustom_title=Getting Started
installWizard_installCustom_selectAll=All
installWizard_installCustom_selectNone=None
installWizard_installCustom_selectRecommended=Recommended
Expand All @@ -24,26 +24,26 @@ installWizard_installCustom_dependenciesPrefix=Dependencies
installWizard_installCustom_pluginListDesc=Note that the full list of plugins is not shown here. Additional plugins can be installed in the <strong>Plugin Manager</strong> once the initial setup is complete. <a href="https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins#InstallingJenkins-InstallationWizard" target="_blank">See the Wiki for more information</a>.
installWizard_goBack=Back
installWizard_goInstall=Install
installWizard_installing_title=Installing...
installWizard_installing_title=Getting Started
installWizard_installing_detailsLink=Details...
installWizard_installComplete_title=Installed
installWizard_installComplete_title=Getting Started
installWizard_installComplete_banner=Jenkins is ready!
installWizard_pluginsInstalled_message=Your plugin installations are complete.
installWizard_installComplete_message=Your Jenkins installation is complete.
installWizard_installComplete_finishButtonLabel=Get Started
installWizard_installComplete_message=Your Jenkins setup is complete.
installWizard_installComplete_finishButtonLabel=Start using Jenkins
installWizard_installComplete_restartRequiredMessage=Some plugins require Jenkins to be restarted.
installWizard_installComplete_restartLabel=Restart
installWizard_installIncomplete_title=Resume Installation
installWizard_installIncomplete_banner=Resume Installation
installWizard_installIncomplete_message=Jenknins was restarted during installation and some plugins didn't seem to get installed.
installWizard_installIncomplete_message=Jenkins was restarted during installation and some plugins didn't seem to get installed.
installWizard_installIncomplete_resumeInstallationButtonLabel=Resume
installWizard_saveFirstUser=Save and Finish
installWizard_skipFirstUser=Skip
installWizard_firstUserSkippedMessage=<div class="alert alert-warning fade in">\
You've skipped creating an admin user. To log in, use the username: 'admin' and \
the security token you used to access the setup wizard.\
</div>
installWizard_addFirstUser_title=Create an Admin User
installWizard_addFirstUser_title=Getting Started
installWizard_configureProxy_label=Configure Proxy
installWizard_configureProxy_save=Save and Continue
installWizard_skipPluginInstallations=Skip Plugin Installations
Expand Down
5 changes: 3 additions & 2 deletions core/src/main/resources/lib/form/select/select.js
Expand Up @@ -44,7 +44,8 @@ Behaviour.specify("SELECT.select", 'select', 1000, function(e) {

function hasChanged(selectEl, originalValue) {
// seems like a race condition allows this to fire before the 'selectEl' is defined. If that happens, exit..
if(!selectEl || !selectEl.options || !selectEl[0])

if(!selectEl || !selectEl.options || !selectEl.options[0])
return false;
var firstValue = selectEl.options[0].value;
var selectedValue = selectEl.value;
Expand Down Expand Up @@ -82,4 +83,4 @@ Behaviour.specify("SELECT.select", 'select', 1000, function(e) {
}
});
});
});
});
13 changes: 11 additions & 2 deletions core/src/main/resources/lib/layout/layout.jelly
Expand Up @@ -37,6 +37,9 @@ THE SOFTWARE.
If non-null and not "false", auto refresh is disabled on this page.
This is necessary for pages that include forms.
</st:attribute>
<st:attribute name="cssclass">
specify a css class name to include in the top level of this layout dom.
</st:attribute>
<st:attribute name="css" deprecated="true">
specify path that starts from "/" for loading additional CSS stylesheet.
path is interprted as relative to the context root. e.g.,
Expand Down Expand Up @@ -96,7 +99,13 @@ ${h.initPageVariables(context)}
</j:if>
<link rel="shortcut icon" href="${resURL}/favicon.ico" type="image/vnd.microsoft.icon" />
<link rel="mask-icon" href="${rootURL}/images/mask-icon.svg" color="black" />


<!-- should the sidebar be hidden on load? -->
<style>
body.j-hide-left #side-panel{width:0; padding:0; overflow:hidden;}
body.j-hide-left #main-panel{margin:0 auto; max-width:75em;}
</style>

<!-- are we running as an unit test? -->
<script>var isRunAsTest=${h.isUnitTest}; var rootURL="${rootURL}"; var resURL="${resURL}";</script>

Expand Down Expand Up @@ -165,7 +174,7 @@ ${h.initPageVariables(context)}
<script src="${resURL}/jsbundles/page-init.js" type="text/javascript"/>

</head>
<body id="jenkins" class="yui-skin-sam jenkins-${h.version}" data-version="jenkins-${h.version}" data-model-type="${it.class.name}">
<body id="jenkins" class="yui-skin-sam jenkins-${h.version} ${attrs.cssClass}" data-version="jenkins-${h.version}" data-model-type="${it.class.name}">
<!-- for accessibility, skip the entire navigation bar and etc and go straight to the head of the content -->
<a href="#skip2content" class="skiplink">Skip to content</a>

Expand Down
24 changes: 11 additions & 13 deletions pom.xml
Expand Up @@ -33,7 +33,7 @@ THE SOFTWARE.

<groupId>org.jenkins-ci.main</groupId>
<artifactId>pom</artifactId>
<version>2.0-alpha-3-SNAPSHOT</version>
<version>2.0-alpha-4-SNAPSHOT</version>
<packaging>pom</packaging>

<name>Jenkins main module</name>
Expand Down Expand Up @@ -323,7 +323,17 @@ THE SOFTWARE.
<artifactId>servlet-api</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>org.codehaus.gmaven.runtime</groupId>
<artifactId>gmaven-runtime-2.0</artifactId>
<version>1.5-jenkins-3</version>
</dependency>
</dependencies>
<configuration>
<!-- 2.4 not yet supported by plugin but 2.0 works
here so long as we provide explicit version -->
<providerSelection>2.0</providerSelection>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -724,18 +734,6 @@ THE SOFTWARE.
</goals>
</execution>
</executions>
<configuration>
<!-- 1.8 not yet supported by plugin but 1.7 works
here so long as we provide explicit version -->
<providerSelection>1.7</providerSelection>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.gmaven.runtime</groupId>
<artifactId>gmaven-runtime-1.7</artifactId>
<version>1.3</version>
</dependency>
</dependencies>
</plugin>
</plugins>

Expand Down
10 changes: 1 addition & 9 deletions test/pom.xml
Expand Up @@ -28,7 +28,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>pom</artifactId>
<version>2.0-alpha-3-SNAPSHOT</version>
<version>2.0-alpha-4-SNAPSHOT</version>
</parent>

<artifactId>test</artifactId>
Expand Down Expand Up @@ -240,15 +240,7 @@ THE SOFTWARE.
<artifactId>ant-launcher</artifactId>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.gmaven.runtime</groupId>
<artifactId>gmaven-runtime-2.0</artifactId>
<version>1.5-jenkins-1</version>
</dependency>
</dependencies>
<configuration>
<providerSelection>2.0</providerSelection>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
2 changes: 1 addition & 1 deletion test/src/test/java/hudson/cli/GroovyshCommandTest.java
Expand Up @@ -42,7 +42,7 @@ public class GroovyshCommandTest {
@Test public void authentication() throws Exception {
CLICommandInvoker.Result result = new CLICommandInvoker(r, new GroovyshCommand())
.authorizedTo(Jenkins.READ, Jenkins.RUN_SCRIPTS)
.withStdin(new StringInputStream("println(jenkins.model.Jenkins.instance.getClass().name)\nquit\n"))
.withStdin(new StringInputStream("println(jenkins.model.Jenkins.instance.getClass().name)\n:quit\n"))
.invoke();
assertThat(result, succeeded());
assertThat(result, hasNoErrorOutput());
Expand Down
2 changes: 1 addition & 1 deletion war/pom.xml
Expand Up @@ -28,7 +28,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>pom</artifactId>
<version>2.0-alpha-3-SNAPSHOT</version>
<version>2.0-alpha-4-SNAPSHOT</version>
</parent>

<artifactId>jenkins-war</artifactId>
Expand Down

0 comments on commit ee00e33

Please sign in to comment.