Merge branch 'scmpolllistener'

This commit is contained in:
Alex Earl committed 2013-12-19 11:24:56 -07:00
commit ed7828b959
100 files changed
+705 -477

No files matched your search

+1 -1
View File
@@ -29,7 +29,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>pom</artifactId>
<version>1.544-SNAPSHOT</version>
<version>1.546-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
+5 -3
View File
@@ -150,6 +150,7 @@ import org.kohsuke.stapler.jelly.InternationalizedStringExpression.RawHtmlArgume
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import hudson.util.RunList;
import java.util.concurrent.atomic.AtomicLong;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
@@ -1431,7 +1432,8 @@ public class Functions {
}
/**
* Returns a sub-list if the given list is bigger than the specified 'maxSize'
* Returns a sub-list if the given list is bigger than the specified {@code maxSize}.
* <strong>Warning:</strong> do not call this with a {@link RunList}, or you will break lazy loading!
*/
public static <T> List<T> subList(List<T> base, int maxSize) {
if(maxSize<base.size())
@@ -1824,8 +1826,8 @@ public class Functions {
*/
public static String breakableString(final String plain) {
return plain.replaceAll("(\\p{Punct}+\\w)", "<wbr>$1")
.replaceAll("(\\w{10})(?=\\w{3})", "$1<wbr>")
return plain.replaceAll("([\\p{Punct}&&[^;]]+\\w)", "<wbr>$1")
.replaceAll("([^\\p{Punct}\\s-]{10})(?=[^\\p{Punct}\\s-]{3})", "$1<wbr>")
;
}
+3 -7
View File
@@ -24,7 +24,7 @@
package hudson;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.converters.ConversionException;
import com.thoughtworks.xstream.XStreamException;
import com.thoughtworks.xstream.converters.Converter;
import com.thoughtworks.xstream.converters.UnmarshallingContext;
import com.thoughtworks.xstream.io.StreamException;
@@ -140,9 +140,7 @@ public final class XmlFile {
InputStream in = new BufferedInputStream(new FileInputStream(file));
try {
return xs.fromXML(in);
} catch(StreamException e) {
throw new IOException("Unable to read "+file,e);
} catch(ConversionException e) {
} catch (XStreamException e) {
throw new IOException("Unable to read "+file,e);
} catch(Error e) {// mostly reflection errors
throw new IOException("Unable to read "+file,e);
@@ -163,9 +161,7 @@ public final class XmlFile {
try {
// TODO: expose XStream the driver from XStream
return xs.unmarshal(DEFAULT_DRIVER.createReader(in), o);
} catch (StreamException e) {
throw new IOException("Unable to read "+file,e);
} catch(ConversionException e) {
} catch (XStreamException e) {
throw new IOException("Unable to read "+file,e);
} catch(Error e) {// mostly reflection errors
throw new IOException("Unable to read "+file,e);
@@ -299,7 +299,7 @@ public class LogRecorder extends AbstractModelObject implements Saveable {
* The file we save our configuration.
*/
private XmlFile getConfigFile() {
return new XmlFile(XSTREAM, new File(Jenkins.getInstance().getRootDir(),"log/"+name+".xml"));
return new XmlFile(XSTREAM, new File(LogRecorderManager.configDir(), name + ".xml"));
}
/**
@@ -33,7 +33,6 @@ import hudson.model.RSS;
import hudson.util.CopyOnWriteMap;
import jenkins.model.JenkinsLocationConfiguration;
import jenkins.model.ModelObjectWithChildren;
import jenkins.model.ModelObjectWithContextMenu;
import jenkins.model.ModelObjectWithContextMenu.ContextMenu;
import org.apache.commons.io.filefilter.WildcardFileFilter;
import org.kohsuke.stapler.QueryParameter;
@@ -52,7 +51,6 @@ import java.util.GregorianCalendar;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.Logger;
@@ -84,12 +82,16 @@ public class LogRecorderManager extends AbstractModelObject implements ModelObje
return logRecorders.get(token);
}
static File configDir() {
return new File(Jenkins.getInstance().getRootDir(), "log");
}
/**
* Loads the configuration from disk.
*/
public void load() throws IOException {
logRecorders.clear();
File dir = new File(Jenkins.getInstance().getRootDir(), "log");
File dir = configDir();
File[] files = dir.listFiles((FileFilter)new WildcardFileFilter("*.xml"));
if(files==null) return;
for (File child : files) {
@@ -45,13 +45,15 @@ public class BuildTimelineWidget {
protected final RunList<?> builds;
public BuildTimelineWidget(RunList<?> builds) {
this.builds = builds;
this.builds = builds.limit(20); // TODO instead render lazily
}
@Deprecated
public Run<?, ?> getFirstBuild() {
return builds.getFirstBuild();
}
@Deprecated
public Run<?, ?> getLastBuild() {
return builds.getLastBuild();
}
@@ -40,6 +40,8 @@ import java.io.FileFilter;
import java.io.IOException;
import java.io.InputStream;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Defines a bunch of static methods to be used as a "mix-in" for {@link ItemGroup}
@@ -99,7 +101,7 @@ public abstract class ItemGroupMixIn {
V item = (V) Items.load(parent,subdir);
configurations.put(key.call(item), item);
} catch (IOException e) {
e.printStackTrace(); // TODO: logging
Logger.getLogger(ItemGroupMixIn.class.getName()).log(Level.WARNING, "could not load " + subdir, e);
}
}
+1 -1
View File
@@ -1269,7 +1269,7 @@ public abstract class Job<JobT extends Job<JobT, RunT>, RunT extends Run<JobT, R
}
DataSetBuilder<String, ChartLabel> data = new DataSetBuilder<String, ChartLabel>();
for (Run r : getBuilds()) {
for (Run r : getNewBuilds()) {
if (r.isBuilding())
continue;
data.add(((double) r.getDuration()) / (1000 * 60), "min",
@@ -0,0 +1,42 @@
/*
* The MIT License
*
* Copyright (c) 2013 Red Hat, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package hudson.model;
import java.io.IOException;
import javax.annotation.Nonnull;
/**
* {@link ViewGroup} that can be modified.
*
* @author ogondza
* @since 1.545
*/
public interface ModifiableViewGroup extends ViewGroup {
/**
* Add new {@link View} to this {@link ViewGroup}.
*/
public void addView(@Nonnull View view) throws IOException;
}
@@ -58,7 +58,7 @@ import org.kohsuke.stapler.StaplerResponse;
*
* @author Tom Huybrechts
*/
public class MyViewsProperty extends UserProperty implements ViewGroup, Action, StaplerFallback {
public class MyViewsProperty extends UserProperty implements ModifiableViewGroup, Action, StaplerFallback {
private String primaryViewName;
/**
@@ -136,6 +136,7 @@ public class MyViewsProperty extends UserProperty implements ViewGroup, Action,
viewGroupMixIn.onViewRenamed(view,oldName,newName);
}
@Override
public void addView(View view) throws IOException {
viewGroupMixIn.addView(view);
}
+8 -11
View File
@@ -194,24 +194,21 @@ public final class RunMap<R extends Run<?,R>> extends AbstractLazyLoadRunMap<R>
final SimpleDateFormat formatter = Run.ID_FORMATTER.get();
return new FilenameFilter() {
public boolean accept(File dir, String name) {
// JENKINS-1461 sometimes create bogus data directories with impossible dates, such as year 0, April 31st,
// or August 0th. Date object doesn't roundtrip those, so we eventually fail to load this data.
// Don't even bother trying.
if (!isCorrectDate(name)) {
LOGGER.log(FINE, "Skipping {0}", new File(dir,name));
@Override public boolean accept(File dir, String name) {
if (name.startsWith("0000")) {
// JENKINS-1461 sometimes create bogus data directories with impossible dates, such as year 0, April 31st,
// or August 0th. Date object doesn't roundtrip those, so we eventually fail to load this data.
// Don't even bother trying.
return false;
}
return !name.startsWith("0000") && new File(dir,name).isDirectory();
}
private boolean isCorrectDate(String name) {
try {
if(formatter.format(formatter.parse(name)).equals(name))
if (formatter.format(formatter.parse(name)).equals(name)) {
return true;
}
} catch (ParseException e) {
// fall through
}
LOGGER.log(FINE, "Skipping {0} in {1}", new Object[] {name, dir});
return false;
}
};
+5 -9
View File
@@ -24,6 +24,7 @@
*/
package hudson.model;
import com.google.common.base.Predicate;
import com.infradna.tool.bridge_method_injector.WithBridgeMethods;
import hudson.*;
import hudson.model.Descriptor.FormException;
@@ -451,19 +452,14 @@ public class User extends AbstractModelObject implements AccessControlled, Descr
/**
* Gets the list of {@link Build}s that include changes by this user,
* by the timestamp order.
*
* TODO: do we need some index for this?
*/
@WithBridgeMethods(List.class)
public RunList getBuilds() {
List<AbstractBuild> r = new ArrayList<AbstractBuild>();
for (AbstractProject<?,?> p : Jenkins.getInstance().getAllItems(AbstractProject.class))
for (AbstractBuild<?,?> b : p.getBuilds().newBuilds()){
if (relatedTo(b)) {
r.add(b);
}
return new RunList<Run<?,?>>(Jenkins.getInstance().getAllItems(Job.class)).filter(new Predicate<Run<?,?>>() {
@Override public boolean apply(Run<?,?> r) {
return r instanceof AbstractBuild && relatedTo((AbstractBuild<?,?>) r);
}
return RunList.fromRuns(r);
});
}
/**
@@ -265,7 +265,7 @@ public abstract class AbstractNodeMonitorDescriptor<T> extends Descriptor<NodeMo
synchronized(AbstractNodeMonitorDescriptor.this) {
if(inProgress!=null) {
// maybe it got stuck?
LOGGER.warning("Previous "+getDisplayName()+" monitoring activity still in progress. Interrupting");
LOGGER.log(Level.WARNING, "Previous {0} monitoring activity still in progress. Interrupting", getDisplayName());
inProgress.interrupt();
}
inProgress = this;
@@ -283,7 +283,9 @@ public abstract class AbstractNodeMonitorDescriptor<T> extends Descriptor<NodeMo
timestamp = System.currentTimeMillis();
record = this;
LOGGER.fine("Node monitoring "+getDisplayName()+" completed in "+(System.currentTimeMillis()-startTime)+"ms");
LOGGER.log(Level.FINE, "Node monitoring {0} completed in {1}ms", new Object[] {getDisplayName(), System.currentTimeMillis()-startTime});
} catch (InterruptedException x) {
// interrupted by new one, fine
} catch (Throwable t) {
LOGGER.log(Level.WARNING, "Unexpected node monitoring termination: "+getDisplayName(),t);
} finally {
@@ -133,6 +133,7 @@ public class JUnitResultArchiver extends Recorder implements MatrixAggregatable
TestResult result = parse(testResults, build, launcher, listener);
try {
// TODO can the build argument be omitted now, or is it used prior to the call to addAction?
action = new TestResultAction(build, result, listener);
} catch (NullPointerException npe) {
throw new AbortException(Messages.JUnitResultArchiver_BadXML(testResults));
@@ -173,7 +174,7 @@ public class JUnitResultArchiver extends Recorder implements MatrixAggregatable
return true;
}
build.getActions().add(action);
build.addAction(action);
CHECKPOINT.report();
if (action.getResult().getFailCount() > 0)
@@ -62,11 +62,17 @@ public class TestResultAction extends AbstractTestResultAction<TestResultAction>
private Integer totalCount;
private List<Data> testData = new ArrayList<Data>();
@Deprecated
public TestResultAction(AbstractBuild owner, TestResult result, BuildListener listener) {
super(owner);
setResult(result, listener);
}
/** @since 1.545 */
public TestResultAction(TestResult result, BuildListener listener) {
this(null, result, listener);
}
/**
* Overwrites the {@link TestResult} by a new data set.
*/
@@ -28,6 +28,14 @@ import hudson.model.*;
import hudson.tasks.junit.CaseResult;
import hudson.util.*;
import hudson.util.ChartUtil.NumberOnlyBuildLabel;
import java.awt.*;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import jenkins.model.RunAction2;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.CategoryAxis;
@@ -44,13 +52,6 @@ import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.export.ExportedBean;
import java.awt.*;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
* Common base class for recording test result.
*
@@ -61,15 +62,28 @@ import java.util.concurrent.ConcurrentHashMap;
* @author Kohsuke Kawaguchi
*/
@ExportedBean
public abstract class AbstractTestResultAction<T extends AbstractTestResultAction> implements HealthReportingAction {
public final AbstractBuild<?,?> owner;
public abstract class AbstractTestResultAction<T extends AbstractTestResultAction> implements HealthReportingAction, RunAction2 {
public transient AbstractBuild<?,?> owner;
private Map<String,String> descriptions = new ConcurrentHashMap<String, String>();
/** @since 1.545 */
protected AbstractTestResultAction() {}
/** @deprecated Use the default constructor and just call {@link Run#addAction} to associate the build with the action. */
@Deprecated
protected AbstractTestResultAction(AbstractBuild owner) {
this.owner = owner;
}
@Override public void onAttached(Run<?, ?> r) {
this.owner = (AbstractBuild<?,?>) r;
}
@Override public void onLoad(Run<?, ?> r) {
this.owner = (AbstractBuild<?,?>) r;
}
/**
* Gets the number of failed tests.
*/
@@ -67,10 +67,14 @@ public abstract class AggregatedTestResultAction extends AbstractTestResultActio
*/
public final List<Child> children = new ArrayList<Child>();
@Deprecated
public AggregatedTestResultAction(AbstractBuild owner) {
super(owner);
}
/** @since 1.545 */
public AggregatedTestResultAction() {}
protected void update(List<? extends AbstractTestResultAction> children) {
failCount = skipCount = totalCount = 0;
this.children.clear();
@@ -87,7 +87,7 @@ public class AggregatedTestResultPublisher extends Recorder {
public boolean perform(AbstractBuild<?,?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
// add a TestResult just so that it can show up later.
build.addAction(new TestResultAction(jobs,includeFailedBuilds,build));
build.addAction(new TestResultAction(jobs, includeFailedBuilds));
return true;
}
@@ -131,6 +131,11 @@ public class AggregatedTestResultPublisher extends Recorder {
private transient List<AbstractProject> didntRun;
private transient List<AbstractProject> noFingerprints;
public TestResultAction(String jobs, boolean includeFailedBuilds) {
this(jobs, includeFailedBuilds, null);
}
@Deprecated
public TestResultAction(String jobs, boolean includeFailedBuilds, AbstractBuild<?,?> owner) {
super(owner);
this.includeFailedBuilds = includeFailedBuilds;
@@ -38,10 +38,15 @@ import hudson.model.Action;
* @author Kohsuke Kawaguchi
*/
public class MatrixTestResult extends AggregatedTestResultAction {
@Deprecated
public MatrixTestResult(MatrixBuild owner) {
super(owner);
}
/** @since 1.545 */
public MatrixTestResult() {}
/**
* Use the configuration name.
*/
@@ -46,7 +46,7 @@ public class TestResultAggregator extends MatrixAggregator {
@Override
public boolean startBuild() throws InterruptedException, IOException {
result = new MatrixTestResult(build);
result = new MatrixTestResult();
build.addAction(result);
return true;
}
@@ -74,6 +74,12 @@ import jenkins.model.RunAction2;
/**
* {@link Trigger} that checks for SCM updates periodically.
*
* You can add UI elements under the SCM section by creating a
* config.jelly or config.groovy in the resources area for
* your class that inherits from SCMTrigger and has the
* @{@link hudson.model.Extension} annotation. The UI should
* be wrapped in an f:section element to denote it.
*
* @author Kohsuke Kawaguchi
*/
public class SCMTrigger extends Trigger<SCMedItem> {
@@ -23,7 +23,7 @@
*/
package hudson.util;
import com.thoughtworks.xstream.mapper.CannotResolveClassException;
import com.thoughtworks.xstream.XStreamException;
import com.thoughtworks.xstream.converters.Converter;
import com.thoughtworks.xstream.converters.MarshallingContext;
import com.thoughtworks.xstream.converters.UnmarshallingContext;
@@ -38,8 +38,6 @@ import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Arrays;
import static java.util.logging.Level.FINE;
import java.util.logging.Logger;
/**
@@ -192,11 +190,9 @@ public class CopyOnWriteList<E> implements Iterable<E> {
try {
Object item = readItem(reader, context, items);
items.add(item);
} catch (CannotResolveClassException e) {
LOGGER.log(FINE, "Failed to resolve class", e);
} catch (XStreamException e) {
RobustReflectionConverter.addErrorInContext(context, e);
} catch (LinkageError e) {
LOGGER.log(FINE, "Failed to resolve class", e);
RobustReflectionConverter.addErrorInContext(context, e);
}
reader.moveUp();
@@ -206,5 +202,4 @@ public class CopyOnWriteList<E> implements Iterable<E> {
}
}
private static final Logger LOGGER = Logger.getLogger(CopyOnWriteList.class.getName());
}
@@ -23,7 +23,6 @@
*/
package hudson.util;
import com.thoughtworks.xstream.mapper.CannotResolveClassException;
import com.thoughtworks.xstream.converters.UnmarshallingContext;
import com.thoughtworks.xstream.converters.collections.CollectionConverter;
import com.thoughtworks.xstream.converters.reflection.ReflectionProvider;
@@ -31,16 +30,15 @@ import com.thoughtworks.xstream.converters.reflection.SerializableConverter;
import com.thoughtworks.xstream.io.HierarchicalStreamReader;
import com.thoughtworks.xstream.mapper.Mapper;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.XStreamException;
import java.util.Collection;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CopyOnWriteArraySet;
import static java.util.logging.Level.FINE;
import java.util.logging.Logger;
/**
* {@link CollectionConverter} that ignores {@link CannotResolveClassException}.
* {@link CollectionConverter} that ignores {@link XStreamException}.
*
* <p>
* This allows Hudson to load XML files that contain non-existent classes
@@ -84,16 +82,13 @@ public class RobustCollectionConverter extends CollectionConverter {
try {
Object item = readItem(reader, context, collection);
collection.add(item);
} catch (CannotResolveClassException e) {
LOGGER.log(FINE, "Failed to resolve class", e);
} catch (XStreamException e) {
RobustReflectionConverter.addErrorInContext(context, e);
} catch (LinkageError e) {
LOGGER.log(FINE, "Failed to resolve class", e);
RobustReflectionConverter.addErrorInContext(context, e);
}
reader.moveUp();
}
}
private static final Logger LOGGER = Logger.getLogger(RobustCollectionConverter.class.getName());
}
@@ -23,12 +23,12 @@
*/
package hudson.util;
import com.thoughtworks.xstream.XStreamException;
import com.thoughtworks.xstream.converters.ConversionException;
import com.thoughtworks.xstream.converters.Converter;
import com.thoughtworks.xstream.converters.MarshallingContext;
import com.thoughtworks.xstream.converters.SingleValueConverter;
import com.thoughtworks.xstream.converters.UnmarshallingContext;
import com.thoughtworks.xstream.converters.reflection.MissingFieldException;
import com.thoughtworks.xstream.converters.reflection.ObjectAccessException;
import com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider;
import com.thoughtworks.xstream.converters.reflection.ReflectionConverter;
@@ -38,7 +38,6 @@ import com.thoughtworks.xstream.core.util.Primitives;
import com.thoughtworks.xstream.io.ExtendedHierarchicalStreamWriterHelper;
import com.thoughtworks.xstream.io.HierarchicalStreamReader;
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
import com.thoughtworks.xstream.mapper.CannotResolveClassException;
import com.thoughtworks.xstream.mapper.Mapper;
import hudson.diagnosis.OldDataMonitor;
import hudson.model.Saveable;
@@ -293,14 +292,9 @@ public class RobustReflectionConverter implements Converter {
implicitCollectionsForCurrentObject = writeValueToImplicitCollection(context, value, implicitCollectionsForCurrentObject, result, fieldName);
}
}
} catch (MissingFieldException e) {
LOGGER.log(FINE, "Skipping a non-existent field " + e.getFieldName(), e);
addErrorInContext(context, e);
} catch (CannotResolveClassException e) {
LOGGER.log(FINE, "Skipping a non-existent type", e);
} catch (XStreamException e) {
addErrorInContext(context, e);
} catch (LinkageError e) {
LOGGER.log(FINE, "Failed to resolve a type", e);
addErrorInContext(context, e);
}
@@ -316,6 +310,7 @@ public class RobustReflectionConverter implements Converter {
}
public static void addErrorInContext(UnmarshallingContext context, Throwable e) {
LOGGER.log(FINE, "Failed to load", e);
ArrayList<Throwable> list = (ArrayList<Throwable>)context.get("ReadError");
if (list == null)
context.put("ReadError", list = new ArrayList<Throwable>());
+3 -2
View File
@@ -186,9 +186,10 @@ public class RunList<R extends Run> extends AbstractList<R> {
/**
* Returns elements that satisfy the given predicate.
* <em>Warning:</em> this method mutates the original list and then returns it.
* @since 1.544
*/
// for compatibility reasons, this method doesn't create a new list but updates the current one
private RunList<R> filter(Predicate<R> predicate) {
public RunList<R> filter(Predicate<R> predicate) {
size = null;
first = null;
base = Iterables.filter(base,predicate);
@@ -26,12 +26,12 @@ package hudson.util.xstream;
import com.google.common.collect.ImmutableList;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.XStreamException;
import com.thoughtworks.xstream.converters.UnmarshallingContext;
import com.thoughtworks.xstream.converters.collections.CollectionConverter;
import com.thoughtworks.xstream.converters.reflection.ReflectionProvider;
import com.thoughtworks.xstream.converters.reflection.SerializableConverter;
import com.thoughtworks.xstream.io.HierarchicalStreamReader;
import com.thoughtworks.xstream.mapper.CannotResolveClassException;
import com.thoughtworks.xstream.mapper.Mapper;
import hudson.util.RobustReflectionConverter;
@@ -76,7 +76,7 @@ public class ImmutableListConverter extends CollectionConverter {
try {
Object item = readItem(reader, context, items);
items.add(item);
} catch (CannotResolveClassException e) {
} catch (XStreamException e) {
RobustReflectionConverter.addErrorInContext(context, e);
} catch (LinkageError e) {
RobustReflectionConverter.addErrorInContext(context, e);
@@ -56,6 +56,7 @@ import hudson.model.Item;
import hudson.model.ItemGroup;
import hudson.model.ItemGroupMixIn;
import hudson.model.Items;
import hudson.model.ModifiableViewGroup;
import hudson.model.JDK;
import hudson.model.Job;
import hudson.model.JobPropertyDescriptor;
@@ -78,7 +79,6 @@ import hudson.model.UnprotectedRootAction;
import hudson.model.UpdateCenter;
import hudson.model.User;
import hudson.model.View;
import hudson.model.ViewGroup;
import hudson.model.ViewGroupMixIn;
import hudson.model.Descriptor.FormException;
import hudson.model.labels.LabelAtom;
@@ -305,7 +305,7 @@ import javax.annotation.Nullable;
*/
@ExportedBean
public class Jenkins extends AbstractCIBase implements ModifiableTopLevelItemGroup, StaplerProxy, StaplerFallback,
ViewGroup, AccessControlled, DescriptorByNameOwner,
ModifiableViewGroup, AccessControlled, DescriptorByNameOwner,
ModelObjectWithContextMenu, ModelObjectWithChildren {
private transient final Queue queue;
@@ -1456,6 +1456,7 @@ public class Jenkins extends AbstractCIBase implements ModifiableTopLevelItemGro
return viewGroupMixIn.getViews();
}
@Override
public void addView(View v) throws IOException {
viewGroupMixIn.addView(v);
}
@@ -26,19 +26,15 @@ package jenkins.model.lazy;
import hudson.model.Job;
import hudson.model.Run;
import hudson.model.RunMap;
import org.apache.commons.collections.keyvalue.DefaultMapEntry;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
import java.lang.ref.Reference;
import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
@@ -50,6 +46,9 @@ import javax.annotation.CheckForNull;
import static jenkins.model.lazy.AbstractLazyLoadRunMap.Direction.*;
import static jenkins.model.lazy.Boundary.*;
import org.apache.commons.collections.keyvalue.DefaultMapEntry;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
/**
* {@link SortedMap} that keeps build records by their build numbers, in the descending order
@@ -224,26 +223,27 @@ public abstract class AbstractLazyLoadRunMap<R> extends AbstractMap<Integer,R> i
}
private void loadIdOnDisk() {
String[] buildDirs = dir.list(createDirectoryFilter());
if (buildDirs==null) {
String[] kids = dir.list();
if (kids == null) {
// the job may have just been created
buildDirs=EMPTY_STRING_ARRAY;
kids = EMPTY_STRING_ARRAY;
}
// wrap into ArrayList to enable mutation
Arrays.sort(buildDirs);
idOnDisk = new SortedList<String>(new ArrayList<String>(Arrays.asList(buildDirs)));
// TODO: should we check that shortcuts is a symlink?
String[] shortcuts = dir.list();
if (shortcuts==null) shortcuts=EMPTY_STRING_ARRAY;
SortedIntList list = new SortedIntList(shortcuts.length/2);
for (String s : shortcuts) {
try {
list.add(Integer.parseInt(s));
} catch (NumberFormatException e) {
// this isn't a shortcut
List<String> buildDirs = new ArrayList<String>();
FilenameFilter buildDirFilter = createDirectoryFilter();
SortedIntList list = new SortedIntList(kids.length / 2);
for (String s : kids) {
if (buildDirFilter.accept(dir, s)) {
buildDirs.add(s);
} else {
try {
list.add(Integer.parseInt(s));
} catch (NumberFormatException e) {
// this isn't a shortcut
}
}
}
Collections.sort(buildDirs);
idOnDisk = new SortedList<String>(buildDirs);
list.sort();
numberOnDisk = list;
}
@@ -0,0 +1,53 @@
/*
* The MIT License
*
* Copyright 2013 Jesse Glick.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package jenkins.widgets;
import hudson.Functions;
import hudson.model.BallColor;
import hudson.model.Run;
import net.sf.json.JSONObject;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.DoNotUse;
@Restricted(DoNotUse.class) // only for buildListTable.jelly
public class BuildListTable extends RunListProgressiveRendering {
@Override protected void calculate(Run<?,?> build, JSONObject element) {
BallColor iconColor = build.getIconColor();
element.put("iconColorOrdinal", iconColor.ordinal());
element.put("iconColorDescription", iconColor.getDescription());
element.put("url", build.getUrl());
element.put("buildStatusUrl", build.getBuildStatusUrl());
element.put("parentUrl", build.getParent().getUrl());
element.put("parentFullDisplayName", Functions.breakableString(Functions.escape(build.getParent().getFullDisplayName())));
element.put("displayName", build.getDisplayName());
element.put("timestampString", build.getTimestampString());
element.put("timestampString2", build.getTimestampString2());
Run.Summary buildStatusSummary = build.getBuildStatusSummary();
element.put("buildStatusSummaryWorse", buildStatusSummary.isWorse);
element.put("buildStatusSummaryMessage", buildStatusSummary.message);
}
}
@@ -0,0 +1,65 @@
/*
* The MIT License
*
* Copyright 2013 Jesse Glick.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package jenkins.widgets;
import hudson.model.AbstractBuild;
import hudson.model.BallColor;
import hudson.model.Node;
import hudson.model.Run;
import jenkins.model.Jenkins;
import net.sf.json.JSONObject;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.DoNotUse;
@Restricted(DoNotUse.class) // only for buildTimeTrend.jelly
public class BuildTimeTrend extends RunListProgressiveRendering {
@Override protected void calculate(Run<?,?> build, JSONObject element) {
BallColor iconColor = build.getIconColor();
element.put("iconColorOrdinal", iconColor.ordinal());
element.put("iconColorDescription", iconColor.getDescription());
element.put("buildStatusUrl", build.getBuildStatusUrl());
element.put("number", build.getNumber());
element.put("displayName", build.getDisplayName());
element.put("duration", build.getDuration());
element.put("durationString", build.getDurationString());
if (build instanceof AbstractBuild) {
AbstractBuild<?,?> b = (AbstractBuild) build;
Node n = b.getBuiltOn();
if (n == null) {
String ns = b.getBuiltOnStr();
if (ns != null && !ns.isEmpty()) {
element.put("builtOnStr", ns);
}
} else if (n != Jenkins.getInstance()) {
element.put("builtOn", n.getNodeName());
element.put("builtOnStr", n.getDisplayName());
} else {
element.put("builtOnStr", hudson.model.Messages.Hudson_Computer_DisplayName());
}
}
}
}
@@ -0,0 +1,81 @@
/*
* The MIT License
*
* Copyright 2013 Jesse Glick.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package jenkins.widgets;
import hudson.model.Run;
import hudson.util.RunList;
import java.util.ArrayList;
import java.util.List;
import jenkins.util.ProgressiveRendering;
import net.sf.json.JSON;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
/**
* Makes it possible to incrementally render some information from a {@link RunList}.
*/
@Restricted(NoExternalUse.class)
public abstract class RunListProgressiveRendering extends ProgressiveRendering {
/**
* Since we cannot predict how many runs there will be, just show an ever-growing progress bar.
* The first increment will be sized as if this many runs will be in the total,
* but then like Zeno’s paradox we will never seem to finish until we actually do.
*/
private static final double MAX_LIKELY_RUNS = 20;
private final List<JSONObject> results = new ArrayList<JSONObject>();
private Iterable<? extends Run<?,?>> builds;
/** Jelly cannot call a constructor with arguments. */
public void setBuilds(Iterable<? extends Run<?,?>> builds) {
this.builds = builds;
}
@Override protected void compute() throws Exception {
double decay = 1;
for (Run<?,?> build : builds) {
if (canceled()) {
return;
}
JSONObject element = new JSONObject();
calculate(build, element);
synchronized (results) {
results.add(element);
}
decay *= (1 - 1 / MAX_LIKELY_RUNS);
progress(1 - decay);
}
}
@Override protected synchronized JSON data() {
JSONArray d = JSONArray.fromObject(results);
results.clear();
return d;
}
protected abstract void calculate(Run<?,?> build, JSONObject element);
}
@@ -24,13 +24,13 @@ HTTP\ Proxy\ Configuration=Configuration du proxy HTTP
Submit=Soumettre
Upload\ Plugin=Soumettre un plugin
File=Fichier
Update\ Site=Rafra\u00EEchir site
Update\ Site=Site de mise \u00E0 jour
Upload=Soumettre
lastUpdated=Derni\u00E8re mise \u00E0 jour\u00A0: il y a {0}
Check\ now=Vérifier maintenant
Check\ now=V\u00E9rifier maintenant
uploadtext=Vous pouvez t\u00E9l\u00E9verser un fichier .hpi pour installer un plugin ext\u00E9rieur au d\u00E9p\u00F4t centralis\u00E9 de plugin.
Proxy\ Needs\ Authorization=Le proxy n\u00E9cessite une authentification
Server=Serveur
User\ name=Nom d''utilisateur
No\ Proxy\ for=Pas de proxy pour
No\ Proxy\ Host=Pas de proxy pour
Password=Mot de passe
@@ -20,4 +20,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
Not\ configured=Non configuree
Not\ configured=Non configur\u00E9e
@@ -21,9 +21,7 @@
# THE SOFTWARE.
Advanced\ Project\ Options=Options avanc\u00E9es du projet
Restrict\ where\ this\ project\ can\ be\ run=Restreindre o\u00F9 le projet peut \u00EAtre ex\u00E9cuter
Tie\ this\ project\ to\ a\ node=Associer ce projet \u00E0 un noeud
Node=Noeud
Execute\ concurrent\ builds\ if\ necessary\ =Ex\u00E9cuter les builds en parall\u00E8le si n\u00E9cessaire
JDK\ to\ be\ used\ for\ this\ project=Le JDK \u00E0 utiliser pour ce projet
default.value=(Valeur par d\u00E9faut)
@@ -22,4 +22,4 @@
Are\ you\ sure\ about\ deleting\ the\ job?=Etes-vous sûr de vouloir supprimer ce job?
Yes=Oui
blurb=\u00CAtes vous s\u00FBr de vouloir supprimer ce {0} "{1}"?
blurb=\u00CAtes-vous s\u00FBr de vouloir supprimer ce {0} "{1}"?
@@ -77,10 +77,7 @@ THE SOFTWARE.
// theme1.autoWidth = true; // Set the Timeline's "width" automatically.
// Set autoWidth on the Timeline's first band's theme,
// will affect all bands.
theme1.timeline_start = new Date(${it.firstBuild.timeInMillis-24*60*60*1000});
theme1.timeline_stop = new Date(${it.lastBuild.timeInMillis+24*60*60*1000});
var d = new Date(${it.lastBuild.timeInMillis});
var bandInfos = [
// the bar that shows outline
Timeline.createBandInfo({
@@ -34,15 +34,39 @@ THE SOFTWARE.
<div style="height:2em"/><!-- spacer -->
<h1>${%Build Time Trend}</h1>
<j:choose>
<j:when test="${it.builds.size()&gt;1}">
<div align="center">
<img src="buildTimeGraph/png" width="500" height="400" lazymap="buildTimeGraph/map" alt="[Build time graph]" style="float:right"/>
</div>
<j:set var="isMasterSlaveEnabled" value="${!empty(app.slaves)}"/>
<div align="center">
<table class="sortable" style="margin-top:1em;">
<script>
function displayBuilds(data) {
var p = $$('trend');
for (var x = 0; data.length > x; x++) {
var e = data[x];
var tr = new Element('tr');
tr.insert(new Element('td', {data: e.iconColorOrdinal}).
insert(new Element('img', {width: 16, height: 16, src: '${imagesURL}/16x16/' + e.buildStatusUrl, alt: e.iconColorDescription})));
tr.insert(new Element('td', {data: e.number}).
insert(new Element('a', {href: e.number + '/', 'class': 'model-link inside'}).
update(e.displayName.escapeHTML())));
tr.insert(new Element('td', {data: e.duration}).
update(e.durationString.escapeHTML()));
<j:if test="${isMasterSlaveEnabled}">
tr.insert(new Element('td').
update(e.builtOn ? new Element('a', {href: '${rootURL}/computer/' + e.builtOn, 'class': 'model-link inside'}).update(e.builtOnStr) : e.builtOnStr));
</j:if>
p.insert(tr);
Behaviour.applySubtree(tr);
}
ts_refresh(p);
}
</script>
<j:new var="handler" className="jenkins.widgets.BuildTimeTrend"/>
${handler.setBuilds(it.builds)}
<l:progressiveRendering handler="${handler}" callback="displayBuilds"/>
<table class="sortable" style="margin-top:1em;" id="trend">
<tr>
<th><st:nbsp/></th>
<th initialSortDir="up">${%Build}</th>
@@ -51,33 +75,8 @@ THE SOFTWARE.
<th>${%Slave}</th>
</j:if>
</tr>
<j:forEach var="r" items="${it.builds}">
<tr>
<td data="${r.iconColor.ordinal()}">
<img width="16" height="16" src="${imagesURL}/16x16/${r.buildStatusUrl}" alt="${r.iconColor.description}" />
</td>
<td data="${r.number}">
<a href="${r.number}/" class="model-link inside">
${r.displayName}
</a>
</td>
<td data="${r.duration}">
${r.durationString}
</td>
<j:if test="${isMasterSlaveEnabled}">
<td>
<t:node value="${r.builtOn}" valueStr="${r.builtOnStr}"/>
</td>
</j:if>
</tr>
</j:forEach>
</table>
</div>
</j:when>
<j:otherwise>
${%More than 1 builds are needed for the trend report.}
</j:otherwise>
</j:choose>
</l:main-panel>
</l:layout>
</j:jelly>
@@ -30,6 +30,7 @@ THE SOFTWARE.
<img src="${h.getUserAvatar(it,'48x48')}" alt="" height="48" width="48" />
${%title(it)}
</h1>
<!-- TODO consider adding a BuildTimelineWidget (cf. Job, View, Computer) -->
<t:buildListTable builds="${it.builds}" jobBaseUrl="${rootURL}/" />
</l:main-panel>
</l:layout>
@@ -20,8 +20,8 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
NewJob=Nouvelle {0}
People=Utilsateurs
NewJob=Nouveau {0}
People=Utilisateurs
Build\ History=Historique des constructions
Edit\ View=\u00C9diter cette vue
Delete\ View=Supprimer cette vue
@@ -28,7 +28,7 @@ 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">
<table class="pane sortable" id="testresult">
<table class="pane sortable bigtable" id="testresult">
<tr>
<td class="pane-header" style="width:10em">${%Build}</td>
<td class="pane-header" style="width:10em">${%Test Description}</td>
@@ -26,7 +26,7 @@ THE SOFTWARE.
<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">
<j:if test="${it.totalCount!=0}">
<h2>${%All Tests}</h2>
<table class="pane sortable" id="testresult">
<table class="pane sortable bigtable" id="testresult">
<tr>
<td class="pane-header">${%Test name}</td>
<td class="pane-header" style="width:6em">${%Duration}</td>
@@ -25,7 +25,7 @@ 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">
<table class="pane sortable" id="testresult">
<table class="pane sortable bigtable" id="testresult">
<tr>
<td class="pane-header">${%Build}</td>
<td class="pane-header">${%Description}</td>
@@ -57,6 +57,8 @@ THE SOFTWARE.
<td class="pane-header" style="width:1em; font-size:smaller; white-space:nowrap;">(${%diff})</td>
<td class="pane-header" style="width:5em">${%Skip}</td>
<td class="pane-header" style="width:1em; font-size:smaller; white-space:nowrap;">(${%diff})</td>
<td class="pane-header" style="width:5em">${%Pass}</td>
<td class="pane-header" style="width:1em; font-size:smaller; white-space:nowrap;">(${%diff})</td>
<td class="pane-header" style="width:5em">${%Total}</td>
<td class="pane-header" style="width:1em; font-size:smaller; white-space:nowrap;">(${%diff})</td>
</tr>
@@ -80,6 +82,10 @@ THE SOFTWARE.
<td class="pane" style="text-align:right" data="${p.skipCount-prev.skipCount}">
${h.getDiffString2(p.skipCount-prev.skipCount)}
</td>
<td class="pane" style="text-align:right">${p.passCount}</td>
<td class="pane" style="text-align:right">
${h.getDiffString2(p.passCount-prev.passCount)}
</td>
<td class="pane" style="text-align:right">${p.totalCount}</td>
<td class="pane" style="text-align:right" data="${p.totalCount-prev.totalCount}">
${h.getDiffString2(p.totalCount-prev.totalCount)}
@@ -25,7 +25,7 @@ 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">
<table class="pane sortable" id="testresult">
<table class="pane sortable bigtable" id="testresult">
<tr>
<td class="pane-header">${%Build}</td>
<td class="pane-header">${%Description}</td>
@@ -1,3 +1,3 @@
# This file is under the MIT License by authors
Apply=V\u00E4rkst\u00E4ll
Apply=Verkst\u00E4ll
@@ -58,7 +58,7 @@ THE SOFTWARE.
if present, the foldable section will not be grouped into a separate JSON object upon submission
</st:attribute>
</st:documentation>
<j:if test="${attrs.help==null}">
<j:if test="${attrs.help == null and attrs.field != null}">
<!-- infer the help page from the current descriptor and field if possible -->
<j:set target="${attrs}" property="help"
value="${descriptor.getHelpFile(attrs.field)}" />
@@ -35,6 +35,37 @@ THE SOFTWARE.
</st:documentation>
<t:setIconSize/>
<script>
function displayBuilds(data) {
var p = $$('projectStatus');
for (var x = 0; data.length > x; x++) {
var e = data[x];
var tr = new Element('tr');
tr.insert(new Element('td', {data: e.iconColorOrdinal}).
insert(new Element('a', {href: '${jobBaseUrl}' + e.url}).
insert(new Element('img', {src: '${imagesURL}/${iconSize}/' + e.buildStatusUrl, alt: e.iconColorDescription, 'class': 'icon${iconSize}'}))));
tr.insert(new Element('td').
insert(new Element('a', {href: '${jobBaseUrl}' + e.parentUrl, 'class': 'model-link'}).
update(e.parentFullDisplayName)).
insert('\u00A0').
insert(new Element('a', {href: '${jobBaseUrl}' + e.url, 'class': 'model-link inside'}).
update(e.displayName.escapeHTML())));
tr.insert(new Element('td', {data: e.timestampString2, tooltip: '${%Click to center timeline on event}', onclick: 'javascript:tl.getBand(0).scrollToCenter(Timeline.DateTime.parseGregorianDateTime("' + e.timestampString2 + '"))'}).
update(e.timestampString.escapeHTML()));
tr.insert(new Element('td', {style: e.buildStatusSummaryWorse ? 'color: red' : ''}).
update(e.buildStatusSummaryMessage.escapeHTML()));
tr.insert(new Element('td').
insert(new Element('a', {href: '${jobBaseUrl}' + e.url + 'console'}).
insert(new Element('img', {src: '${imagesURL}/${subIconSize}/terminal.png', alt: '${%Console output}', border: 0}))));
p.insert(tr);
Behaviour.applySubtree(tr);
}
ts_refresh(p);
}
</script>
<j:new var="handler" className="jenkins.widgets.BuildListTable"/>
${handler.setBuilds(attrs.builds)}
<l:progressiveRendering handler="${handler}" callback="displayBuilds"/>
<table class="sortable pane bigtable" id="projectStatus">
<tr>
<th><st:nbsp/></th>
@@ -43,33 +74,6 @@ THE SOFTWARE.
<th>${%Status}</th>
<th><st:nbsp/></th>
</tr>
<!-- TODO: support gradual expansion of the list -->
<j:forEach var="b" items="${h.subList(attrs.builds,50)}">
<tr>
<td data="${b.iconColor.ordinal()}">
<a href="${jobBaseUrl}${b.url}">
<img src="${imagesURL}/${iconSize}/${b.buildStatusUrl}"
alt="${b.iconColor.description}" class="icon${iconSize}"/>
</a>
</td>
<td>
<a href="${jobBaseUrl}${b.parent.url}" class="model-link"><l:breakable value="${b.parent.fullDisplayName}"/></a>
<st:nbsp/>
<a href="${jobBaseUrl}${b.url}" class="model-link inside">${b.displayName}</a>
</td>
<td data="${b.timestampString2}" tooltip="${%Click to center timeline on event}" onclick="javascript:tl.getBand(0).scrollToCenter(Timeline.DateTime.parseGregorianDateTime('${b.timestampString2}'))">
${b.timestampString}
</td>
<td>
<t:buildStatusSummary build="${b}" />
</td>
<td>
<a href="${jobBaseUrl}${b.url}console">
<img src="${imagesURL}/${subIconSize}/terminal.png" title="${%Console output}" alt="${%Console output}" border="0" />
</a>
</td>
</tr>
</j:forEach>
</table>
<t:rssBar-with-iconSize/>
</j:jelly>
@@ -0,0 +1,24 @@
# The MIT License
#
# Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Simon Wiest
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
Restrict\ where\ this\ project\ can\ be\ run=Restreindre o\u00F9 le projet peut \u00EAtre ex\u00E9cut\u00E9
Label\ Expression=Expression
@@ -50,5 +50,5 @@ THE SOFTWARE.
<span class="copy-button" tooltip="${attrs.tooltip}" text="${attrs.text}" message="${attrs.message}" container="${attrs.container}">
<input type="button"/>
</span>
<st:adjunct includes="org.kohsuke.stapler.zeroclipboard, lib.layout.copyButton.copyButton"/>
<st:adjunct includes="lib.layout.copyButton.copyButton"/>
</j:jelly>
+20 -3
View File
@@ -291,9 +291,26 @@ public class FunctionsTest {
@Test
public void testBreakableString() {
assertEquals("Hello world!", Functions.breakableString("Hello world!"));
assertEquals("H<wbr>,e<wbr>.l<wbr>/l<wbr>:o<wbr>-w<wbr>_o<wbr>=+|d", Functions.breakableString("H,e.l/l:o-w_o=+|d"));
assertEquals("ALongStrin<wbr>gThatCanNo<wbr>tBeBrokenB<wbr>yDefault", Functions.breakableString("ALongStringThatCanNotBeBrokenByDefault"));
assertBrokenAs("Hello world!", "Hello world!");
assertBrokenAs("Hello-world!", "Hello", "-world!");
assertBrokenAs("ALongStringThatCanNotBeBrokenByDefault", "ALongStrin", "gThatCanNo", "tBeBrokenB", "yDefault");
assertBrokenAs("jenkins_main_trunk", "jenkins", "_main", "_trunk");
assertBrokenAs("&lt;&lt;&lt;&lt;&lt;", "", "&lt;", "&lt;", "&lt;", "&lt;", "&lt;");
assertBrokenAs("&amp;&amp;&amp;&amp;&amp;", "", "&amp;", "&amp;", "&amp;", "&amp;", "&amp;");
assertBrokenAs("&thetasym;&thetasym;&thetasym;", "", "&thetasym;", "&thetasym;", "&thetasym;");
assertBrokenAs("Crazy &lt;ha ha&gt;", "Crazy ", "&lt;ha ha", "&gt;");
assertBrokenAs("A;String>Full]Of)Weird}Punctuation", "A;String", ">Full", "]Of", ")Weird", "}Punctuation");
assertBrokenAs("&lt;&lt;a&lt;bc&lt;def&lt;ghi&lt;", "", "&lt;", "&lt;a", "&lt;bc", "&lt;def", "&lt;ghi", "&lt;");
assertBrokenAs("H,e.l/l:o=w_o+|d", "H", ",e", ".l", "/l", ":o", "=w", "_o", "+|d");
assertBrokenAs("a¶‱ﻷa¶‱ﻷa¶‱ﻷa¶‱ﻷa¶‱ﻷa¶‱ﻷa¶‱ﻷa¶‱ﻷ", "a¶‱ﻷa¶‱ﻷa¶", "‱ﻷa¶‱ﻷa¶‱ﻷ", "a¶‱ﻷa¶‱ﻷa¶‱ﻷ");
}
private void assertBrokenAs(String plain, String... chunks) {
assertEquals(
Util.join(Arrays.asList(chunks), "<wbr>"),
Functions.breakableString(plain)
);
}
@Bug(20800)
@@ -41,7 +41,7 @@ public class CronTabEventualityTest {
this.hash = hash;
}
@Test(timeout = 1000)
@Test
@Bug(12388)
public void testYearlyWillBeEventuallyTriggeredWithinOneYear() throws ANTLRException {
Calendar start = new GregorianCalendar(2012, 0, 11, 22, 33); // Jan 11th 2012 22:33
@@ -49,7 +49,7 @@ public class CronTabEventualityTest {
checkEventuality(start, "@yearly", limit);
}
@Test(timeout = 1000)
@Test
@Bug(12388)
public void testAnnuallyWillBeEventuallyTriggeredWithinOneYear() throws ANTLRException {
Calendar start = new GregorianCalendar(2012, 0, 11, 22, 33); // Jan 11th 2012 22:33
@@ -57,49 +57,49 @@ public class CronTabEventualityTest {
checkEventuality(start, "@annually", limit);
}
@Test(timeout = 1000)
@Test
public void testMonthlyWillBeEventuallyTriggeredWithinOneMonth() throws ANTLRException {
Calendar start = new GregorianCalendar(2012, 0, 11, 22, 33); // Jan 11th 2012 22:33
Calendar limit = createLimit(start, Calendar.MONTH, 1);
checkEventuality(start, "@monthly", limit);
}
@Test(timeout = 1000)
@Test
public void testWeeklyWillBeEventuallyTriggeredWithinOneWeek() throws ANTLRException {
Calendar start = new GregorianCalendar(2012, 0, 11, 22, 33); // Jan 11th 2012 22:33
Calendar limit = createLimit(start, Calendar.WEEK_OF_YEAR, 1);
checkEventuality(start, "@weekly", limit);
}
@Test(timeout = 1000)
@Test
public void testDailyWillBeEventuallyTriggeredWithinOneDay() throws ANTLRException {
Calendar start = new GregorianCalendar(2012, 0, 11, 22, 33); // Jan 11th 2012 22:33
Calendar limit = createLimit(start, Calendar.DAY_OF_MONTH, 1);
checkEventuality(start, "@daily", limit);
}
@Test(timeout = 1000)
@Test
public void testMidnightWillBeEventuallyTriggeredWithinOneDay() throws ANTLRException {
Calendar start = new GregorianCalendar(2012, 0, 11, 22, 33); // Jan 11th 2012 22:33
Calendar limit = createLimit(start, Calendar.DAY_OF_MONTH, 1);
checkEventuality(start, "@midnight", limit);
}
@Test(timeout = 1000)
@Test
public void testHourlyWillBeEventuallyTriggeredWithinOneHour() throws ANTLRException {
Calendar start = new GregorianCalendar(2012, 0, 11, 22, 33); // Jan 11th 2012 22:33
Calendar limit = createLimit(start, Calendar.HOUR, 1);
checkEventuality(start, "@hourly", limit);
}
@Test(timeout = 1000)
@Test
public void testFirstDayOfMonthWillBeEventuallyTriggeredWithinOneMonth() throws ANTLRException {
Calendar start = new GregorianCalendar(2012, 0, 11, 22, 33); // Jan 11th 2012 22:33
Calendar limit = createLimit(start, Calendar.MONTH, 1);
checkEventuality(start, "H H 1 * *", limit);
}
@Test(timeout = 1000)
@Test
public void testFirstSundayOfMonthWillBeEventuallyTriggeredWithinOneMonthAndOneWeek() throws ANTLRException {
Calendar start = new GregorianCalendar(2012, 0, 11, 22, 33); // Jan 11th 2012 22:33
Calendar limit = createLimit(start, Calendar.DAY_OF_MONTH, 31+7);