Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'master' into config-ui-changes
* master: (178 commits)
  Some docs
  Some docs
  Fixing comments from @amuniz
  Fixing NITs from @KostyaSha
  commons-compress -> 1.10
  Noting #1788
  Remove hardcode in tar test
  [FIXED JENKINS-10629] Unbroke stream with new tar implementation.
  Revert "Revert "FIXED JENKINS-10629] - Enable BigNumber mode to support archiving of files with size >8Gb""
  Revert "Revert "[JENKINS-10629] - Migrate the Tar archives handling code to commons-compress""
  Fix at-since from PR #1788
  Merge PR #1788: Make plugin manager pluggable
  WebClientUtil (HtmlUnit to v2.18)
  Updated HtmlUnit to v2.18
  Remove JavaScriptEngine override
  Fixed TaskTest tests
  Fixed RobustReflectionConverterTest tests
  Fixed RobustReflectionConverterTest compile errors after merge
  Make sure all background JS is done executing before querying the DOM
  ApiTokenPropertyTest fixes
  ...
  • Loading branch information
tfennelly committed Aug 26, 2015
2 parents 71adc67 + f552d48 commit 3ab5336
Show file tree
Hide file tree
Showing 195 changed files with 2,444 additions and 720 deletions.
58 changes: 53 additions & 5 deletions changelog.html
Expand Up @@ -54,6 +54,58 @@

<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class="major bug">
Race condition in triggers could cause various <code>NullPointerException</code>s.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-29790">issue 29790</a>)
<li class=bug>
Archiving of large artifacts. Tar implementation cannot handle files having a size >8GB.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-10629">issue 10629</a>)
<li class="rfe">
Allow plugins to augment or replace the plugin manager UI.
(<a href="https://github.com/jenkinsci/jenkins/pull/1788">PR 1788</a>)
</ul>
</div><!--=TRUNK-END=-->
<h3><a name=v1.626>What's new in 1.626</a> (2015/08/23)</h3>
<ul class=image>
<li class="bug">
RunIdMigrator fails to revert Matrix and Maven jobs.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-29989">issue 29989</a>)
<li class=bug>
Fix error message "Failed to listen to incoming slave connection" after fixing port through init.groovy.d.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-29798">issue 29798</a>)
<li class=>
</ul>
<h3><a name=v1.625>What's new in 1.625</a> (2015/08/17)</h3>
<ul class=image>
<li class="major bug">
Fixed a deadlock between the old data monitor and authorization strategies.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-29936">issue 29936</a>)
<li class="rfe">
Allow rejecting configurations with errors in critical fields via REST / CLI.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-28440">issue 28440</a>)
<li class="bug">
Do not display <em>No changes</em> if changelog is still being computed.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-2327">issue 2327</a>)
</ul>
<h3><a name=v1.624>What's new in 1.624</a> (2015/08/09)</h3>
<ul class=image>
<li class=rfe>
Allow more job types to use a custom &quot;Build Now&quot; text.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-26147">issue 26147</a>)
</ul>
<h3><a name=v1.623>What's new in 1.623</a> (2015/08/02)</h3>
<p><em>No notable changes in this release.</em></p>
<h3><a name=v1.622>What's new in 1.622</a> (2015/07/27)</h3>
<ul class=image>
<li class=rfe>
Jenkins now support self-restart and daemonization in FreeBSD
(<a href="https://github.com/jenkinsci/jenkins/pull/1770">PR 1770</a>)
<li class=bug>
Node provisioner may fail to correctly indicate that provisioning was finished.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-29568">issue 29568</a>)
</ul>
<h3><a name=v1.621>What's new in 1.621</a> (2015/07/19)</h3>
<ul class=image>
<li class=bug>
Sort by 'Free Disk Space' is incorrect.
Expand All @@ -67,11 +119,7 @@
<li class=rfe>
Don't run trigger for disabled/copied projects.
(<a href="https://github.com/jenkinsci/jenkins/pull/1617">PR 1617</a>)
<li class=rfe>
Jenkins now support self-restart and daemonization in FreeBSD
(<a href="https://github.com/jenkinsci/jenkins/pull/1770">PR 1770</a>)
</ul>
</div><!--=TRUNK-END=-->
<h3><a name=v1.620>What's new in 1.620</a> (2015/07/12)</h3>
<ul class=image>
<li class=bug>
Expand Down Expand Up @@ -247,7 +295,7 @@ <h3><a name=v1.610>What's new in 1.610</a> (2015/04/19)</h3>
Since 1.598 overrides of <code>Descriptor.getId</code> were not correctly handled by form binding, breaking at least the CloudBees Templates plugin.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-26781">issue 26781</a>)
<li class=bug>
<b>Reverted in 1.611</b>. Archiving of large artifacts. Tar implementation cannot handle files having a size >8GB.
<b>Reverted in 1.611, reimplemented in 1.627</b>. Archiving of large artifacts. Tar implementation cannot handle files having a size >8GB.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-10629">issue 10629</a>)
<li class=bug>
The queue state was not updated between scheduling builds.
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>1.621-SNAPSHOT</version>
<version>1.627-SNAPSHOT</version>
</parent>

<artifactId>cli</artifactId>
Expand Down
13 changes: 9 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>1.621-SNAPSHOT</version>
<version>1.627-SNAPSHOT</version>
</parent>

<artifactId>jenkins-core</artifactId>
Expand Down Expand Up @@ -276,6 +276,11 @@ THE SOFTWARE.
<artifactId>commons-beanutils</artifactId>
<version>1.8.3</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.10</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
Expand Down Expand Up @@ -471,9 +476,9 @@ THE SOFTWARE.
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</dependency>
<dependency><!-- [JENKINS-4433] -->
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.txw2</groupId>
Expand Down
34 changes: 10 additions & 24 deletions core/src/main/java/hudson/FilePath.java
Expand Up @@ -33,7 +33,6 @@
import hudson.model.Computer;
import hudson.model.Item;
import hudson.model.TaskListener;
import hudson.org.apache.tools.tar.TarInputStream;
import hudson.os.PosixAPI;
import hudson.os.PosixException;
import hudson.remoting.Callable;
Expand Down Expand Up @@ -70,7 +69,6 @@
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.FileSet;
import org.apache.tools.tar.TarEntry;
import org.apache.tools.zip.ZipEntry;
import org.apache.tools.zip.ZipFile;
import org.kohsuke.stapler.Stapler;
Expand Down Expand Up @@ -120,6 +118,8 @@
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import jenkins.security.MasterToSlaveCallable;
import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
import org.jenkinsci.remoting.RoleChecker;
import org.jenkinsci.remoting.RoleSensitive;

Expand Down Expand Up @@ -175,7 +175,7 @@
* </pre>
*
* <p>
* When {@link FileCallable} is transfered to a remote node, it will be done so
* When {@link FileCallable} is transferred to a remote node, it will be done so
* by using the same Java serialization scheme that the remoting module uses.
* See {@link Channel} for more about this.
*
Expand Down Expand Up @@ -2268,12 +2268,15 @@ private Integer writeToTar(File baseDir, DirScanner scanner, OutputStream out) t

/**
* Reads from a tar stream and stores obtained files to the base dir.
* @since TODO supports large files > 10 GB, migration to commons-compress
*/
private void readFromTar(String name, File baseDir, InputStream in) throws IOException {
TarInputStream t = new TarInputStream(in);
TarArchiveInputStream t = new TarArchiveInputStream(in);

// TarInputStream t = new TarInputStream(in);
try {
TarEntry te;
while ((te = t.getNextEntry()) != null) {
TarArchiveEntry te;
while ((te = t.getNextTarEntry()) != null) {
File f = new File(baseDir,te.getName());
if(te.isDirectory()) {
mkdirs(f);
Expand All @@ -2282,8 +2285,7 @@ private void readFromTar(String name, File baseDir, InputStream in) throws IOExc
if (parent != null) mkdirs(parent);
writing(f);

byte linkFlag = (Byte) LINKFLAG_FIELD.get(te);
if (linkFlag==TarEntry.LF_SYMLINK) {
if (te.isSymbolicLink()) {
new FilePath(f).symlinkTo(te.getLinkName(), TaskListener.NULL);
} else {
IOUtils.copy(t,f);
Expand All @@ -2300,8 +2302,6 @@ private void readFromTar(String name, File baseDir, InputStream in) throws IOExc
} catch (InterruptedException e) {
Thread.currentThread().interrupt(); // process this later
throw new IOException("Failed to extract "+name,e);
} catch (IllegalAccessException e) {
throw new IOException("Failed to extract "+name,e);
} finally {
t.close();
}
Expand Down Expand Up @@ -2725,20 +2725,6 @@ public int compare(String o1, String o2) {
}
};

private static final Field LINKFLAG_FIELD = getTarEntryLinkFlagField();

private static Field getTarEntryLinkFlagField() {
try {
Field f = TarEntry.class.getDeclaredField("linkFlag");
f.setAccessible(true);
return f;
} catch (SecurityException e) {
throw new AssertionError(e);
} catch (NoSuchFieldException e) {
throw new AssertionError(e);
}
}

/**
* Gets the {@link FilePath} representation of the "~" directory
* (User's home directory in the Unix sense) of the given channel.
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/FileSystemProvisioner.java
Expand Up @@ -238,7 +238,7 @@ public void restoreTo(AbstractBuild<?,?> owner, FilePath dst, TaskListener liste
@Extension
public static final class DescriptorImpl extends FileSystemProvisionerDescriptor {
public boolean discard(FilePath ws, TaskListener listener) throws IOException, InterruptedException {
// the default provisioner doens't do anything special,
// the default provisioner does not do anything special,
// so allow other types to manage it
return false;
}
Expand Down
Expand Up @@ -39,7 +39,7 @@ public abstract class FileSystemProvisionerDescriptor extends Descriptor<FileSys
*
* <p>
* Because users may modify the file system behind Hudson, and slaves may come and go when
* configuration changes hapen, in general case Hudson is unable to keep track of which jobs
* configuration changes happen, in general case Hudson is unable to keep track of which jobs
* have workspaces in which slaves.
*
* <p>
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/Functions.java
Expand Up @@ -1385,7 +1385,7 @@ public static boolean defaultToTrue(Boolean b) {
/**
* If the value exists, return that value. Otherwise return the default value.
* <p>
* Starting 1.294, JEXL supports the elvis operator "x?:y" that supercedes this.
* Starting 1.294, JEXL supports the elvis operator "x?:y" that supersedes this.
*
* @since 1.150
*/
Expand Down
13 changes: 12 additions & 1 deletion core/src/main/java/hudson/PluginManager.java
Expand Up @@ -71,6 +71,7 @@
import org.kohsuke.stapler.HttpResponse;
import org.kohsuke.stapler.HttpResponses;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.StaplerOverridable;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.export.Exported;
Expand Down Expand Up @@ -128,7 +129,7 @@
* @author Kohsuke Kawaguchi
*/
@ExportedBean
public abstract class PluginManager extends AbstractModelObject implements OnMaster {
public abstract class PluginManager extends AbstractModelObject implements OnMaster, StaplerOverridable {
/**
* All discovered plugins.
*/
Expand Down Expand Up @@ -215,6 +216,16 @@ public Api getApi() {
return new Api(this);
}

/**
* Find all registered overrides (intended to allow overriding/adding views)
* @return List of extensions
* @since 1.627
*/
@Override
public Collection<PluginManagerStaplerOverride> getOverrides() {
return PluginManagerStaplerOverride.all();
}

/**
* Called immediately after the construction.
* This is a separate method so that code executed from here will see a valid value in
Expand Down
28 changes: 28 additions & 0 deletions core/src/main/java/hudson/PluginManagerStaplerOverride.java
@@ -0,0 +1,28 @@
package hudson;

import jenkins.model.Jenkins;

import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;

/**
* Extension point for selectively overriding parts of the {@link PluginManager} views
* Anything extending this and registered with an @Extension can replace existing views and define new views.
*
* It is also possible to add/modify API calls coming via Stapler, but this requires caution.
*
* In both cases, this is simply done by defining a resource or method that matches the existing one
*
* @author Sam Van Oort
* @since 1.627
*/
public abstract class PluginManagerStaplerOverride implements ExtensionPoint {

/**
* Return all implementations of this extension point
* @return All implementations of this extension point
*/
public static @Nonnull ExtensionList<PluginManagerStaplerOverride> all() {
return ExtensionList.lookup(PluginManagerStaplerOverride.class);
}
}
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/PluginWrapper.java
Expand Up @@ -63,7 +63,7 @@
* for Jenkins to control {@link Plugin}.
*
* <p>
* A plug-in is packaged into a jar file whose extension is <tt>".jpi"</tt> (or <tt>".hpi"</tt> for backward compatability),
* A plug-in is packaged into a jar file whose extension is <tt>".jpi"</tt> (or <tt>".hpi"</tt> for backward compatibility),
* A plugin needs to have a special manifest entry to identify what it is.
*
* <p>
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/cli/CloneableCLICommand.java
Expand Up @@ -26,7 +26,7 @@
/**
* {@link Cloneable} {@link CLICommand}.
*
* Uses {@link #clone()} instead of "new" to create a copy for exection.
* Uses {@link #clone()} instead of "new" to create a copy for execution.
*
* @author Kohsuke Kawaguchi
*/
Expand Down
29 changes: 23 additions & 6 deletions core/src/main/java/hudson/diagnosis/OldDataMonitor.java
Expand Up @@ -25,6 +25,7 @@

import com.google.common.base.Predicate;
import com.thoughtworks.xstream.converters.UnmarshallingContext;

import hudson.Extension;
import hudson.XmlFile;
import hudson.model.AdministrativeMonitor;
Expand All @@ -36,8 +37,10 @@
import hudson.model.listeners.ItemListener;
import hudson.model.listeners.RunListener;
import hudson.model.listeners.SaveableListener;
import hudson.security.ACL;
import hudson.util.RobustReflectionConverter;
import hudson.util.VersionNumber;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
Expand All @@ -48,8 +51,13 @@
import java.util.TreeSet;
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.annotation.CheckForNull;

import jenkins.model.Jenkins;

import org.acegisecurity.context.SecurityContext;
import org.acegisecurity.context.SecurityContextHolder;
import org.kohsuke.stapler.HttpRedirect;
import org.kohsuke.stapler.HttpResponse;
import org.kohsuke.stapler.HttpResponses;
Expand Down Expand Up @@ -102,12 +110,21 @@ public Map<Saveable,VersionRange> getData() {
}

private static void remove(Saveable obj, boolean isDelete) {
OldDataMonitor odm = get(Jenkins.getInstance());
synchronized (odm) {
odm.data.remove(referTo(obj));
if (isDelete && obj instanceof Job<?,?>)
for (Run r : ((Job<?,?>)obj).getBuilds())
odm.data.remove(referTo(r));
Jenkins j = Jenkins.getInstance();
if (j != null) {
OldDataMonitor odm = get(j);
SecurityContext oldContext = ACL.impersonate(ACL.SYSTEM);
try {
synchronized (odm) {
odm.data.remove(referTo(obj));
if (isDelete && obj instanceof Job<?,?>)
for (Run r : ((Job<?,?>)obj).getBuilds())
odm.data.remove(referTo(r));
}
}
finally {
SecurityContextHolder.setContext(oldContext);
}
}
}

Expand Down

0 comments on commit 3ab5336

Please sign in to comment.