From 5afdade7bba5184a25dce3a8b1fbda6580a63830 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20Gond=C5=BEa?= Date: Sun, 24 Nov 2013 16:08:39 +0100 Subject: [PATCH 01/49] Introduce ModifiableViewGroup --- .../hudson/model/ModifiableViewGroup.java | 42 +++++++++++++++++++ .../java/hudson/model/MyViewsProperty.java | 3 +- core/src/main/java/jenkins/model/Jenkins.java | 5 ++- .../org/jvnet/hudson/test/MockFolder.java | 6 +-- 4 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 core/src/main/java/hudson/model/ModifiableViewGroup.java diff --git a/core/src/main/java/hudson/model/ModifiableViewGroup.java b/core/src/main/java/hudson/model/ModifiableViewGroup.java new file mode 100644 index 0000000000..6e5a42960d --- /dev/null +++ b/core/src/main/java/hudson/model/ModifiableViewGroup.java @@ -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 TODO + */ +public interface ModifiableViewGroup extends ViewGroup { + + /** + * Add new {@link View} to this {@link ViewGroup}. + */ + public void addView(@Nonnull View view) throws IOException; +} diff --git a/core/src/main/java/hudson/model/MyViewsProperty.java b/core/src/main/java/hudson/model/MyViewsProperty.java index 3f65ba8d3b..a7a40014e8 100644 --- a/core/src/main/java/hudson/model/MyViewsProperty.java +++ b/core/src/main/java/hudson/model/MyViewsProperty.java @@ -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); } diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java index 03ead6b7c3..9b6b7b6d80 100755 --- a/core/src/main/java/jenkins/model/Jenkins.java +++ b/core/src/main/java/jenkins/model/Jenkins.java @@ -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; @@ -77,7 +78,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; @@ -304,7 +304,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; @@ -1455,6 +1455,7 @@ public class Jenkins extends AbstractCIBase implements ModifiableTopLevelItemGro return viewGroupMixIn.getViews(); } + @Override public void addView(View v) throws IOException { viewGroupMixIn.addView(v); } diff --git a/test/src/main/java/org/jvnet/hudson/test/MockFolder.java b/test/src/main/java/org/jvnet/hudson/test/MockFolder.java index cf4231c2e9..e3687b2046 100644 --- a/test/src/main/java/org/jvnet/hudson/test/MockFolder.java +++ b/test/src/main/java/org/jvnet/hudson/test/MockFolder.java @@ -33,11 +33,11 @@ import hudson.model.Hudson; import hudson.model.Item; import hudson.model.ItemGroup; import hudson.model.ItemGroupMixIn; +import hudson.model.ModifiableViewGroup; import hudson.model.Job; import hudson.model.TopLevelItem; import hudson.model.TopLevelItemDescriptor; import hudson.model.View; -import hudson.model.ViewGroup; import hudson.model.ViewGroupMixIn; import hudson.util.Function1; import hudson.views.DefaultViewsTabBar; @@ -69,7 +69,7 @@ import org.kohsuke.stapler.WebMethod; * @since 1.494 */ @SuppressWarnings({"unchecked", "rawtypes"}) // the usual API mistakes -public class MockFolder extends AbstractItem implements ModifiableTopLevelItemGroup, TopLevelItem, ViewGroup, StaplerFallback { +public class MockFolder extends AbstractItem implements ModifiableTopLevelItemGroup, TopLevelItem, ModifiableViewGroup, StaplerFallback { private transient Map items = new TreeMap(); private final List views = new ArrayList(Collections.singleton(new AllView("All", this))); @@ -188,7 +188,7 @@ public class MockFolder extends AbstractItem implements ModifiableTopLevelItemGr return Jenkins.getInstance().getDescriptorByType(DescriptorImpl.class); } - public void addView(View view) throws IOException { + @Override public void addView(View view) throws IOException { vgmixin().addView(view); } From c5e23739fa85a6fe93ad90a35da4051a2767c874 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Fri, 6 Dec 2013 18:21:57 -0500 Subject: [PATCH 02/49] [JENKINS-20892] Partial fix of poor scalability in /builds and related displays. --- core/src/main/java/hudson/Functions.java | 4 +- .../hudson/model/BuildTimelineWidget.java | 4 +- core/src/main/java/hudson/model/Job.java | 2 +- core/src/main/java/hudson/model/User.java | 14 ++- core/src/main/java/hudson/util/RunList.java | 5 +- .../java/jenkins/widgets/BuildListTable.java | 89 +++++++++++++++++++ .../model/BuildTimelineWidget/control.jelly | 3 - .../hudson/model/Job/buildTimeTrend.jelly | 9 +- .../resources/hudson/model/User/builds.jelly | 1 + .../resources/lib/hudson/buildListTable.jelly | 86 ++++++++++++------ 10 files changed, 165 insertions(+), 52 deletions(-) create mode 100644 core/src/main/java/jenkins/widgets/BuildListTable.java diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index 50c115a850..8c9e72edd9 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -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}. + * Warning: do not call this with a {@link RunList}, or you will break lazy loading! */ public static List subList(List base, int maxSize) { if(maxSize 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(); } diff --git a/core/src/main/java/hudson/model/Job.java b/core/src/main/java/hudson/model/Job.java index aef474184a..29a7cd9425 100644 --- a/core/src/main/java/hudson/model/Job.java +++ b/core/src/main/java/hudson/model/Job.java @@ -1269,7 +1269,7 @@ public abstract class Job, RunT extends Run data = new DataSetBuilder(); - for (Run r : getBuilds()) { + for (Run r : getNewBuilds()) { if (r.isBuilding()) continue; data.add(((double) r.getDuration()) / (1000 * 60), "min", diff --git a/core/src/main/java/hudson/model/User.java b/core/src/main/java/hudson/model/User.java index 90e6f472f0..e0b3cd5e87 100644 --- a/core/src/main/java/hudson/model/User.java +++ b/core/src/main/java/hudson/model/User.java @@ -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 r = new ArrayList(); - for (AbstractProject p : Jenkins.getInstance().getAllItems(AbstractProject.class)) - for (AbstractBuild b : p.getBuilds().newBuilds()){ - if (relatedTo(b)) { - r.add(b); - } + return new RunList>(Jenkins.getInstance().getAllItems(Job.class)).filter(new Predicate>() { + @Override public boolean apply(Run r) { + return r instanceof AbstractBuild && relatedTo((AbstractBuild) r); } - return RunList.fromRuns(r); + }); } /** diff --git a/core/src/main/java/hudson/util/RunList.java b/core/src/main/java/hudson/util/RunList.java index 891e4ff8b5..add82eb890 100644 --- a/core/src/main/java/hudson/util/RunList.java +++ b/core/src/main/java/hudson/util/RunList.java @@ -186,9 +186,10 @@ public class RunList extends AbstractList { /** * Returns elements that satisfy the given predicate. + * Warning: this method mutates the original list and then returns it. + * @since TODO */ - // for compatibility reasons, this method doesn't create a new list but updates the current one - private RunList filter(Predicate predicate) { + public RunList filter(Predicate predicate) { size = null; first = null; base = Iterables.filter(base,predicate); diff --git a/core/src/main/java/jenkins/widgets/BuildListTable.java b/core/src/main/java/jenkins/widgets/BuildListTable.java new file mode 100644 index 0000000000..1a29abe1e6 --- /dev/null +++ b/core/src/main/java/jenkins/widgets/BuildListTable.java @@ -0,0 +1,89 @@ +/* + * 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 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.DoNotUse; + +@Restricted(DoNotUse.class) // only for buildListTable.jelly +public class BuildListTable extends ProgressiveRendering { + + private final List results = new ArrayList(); + private Iterable> builds; + + /** Jelly cannot call a constructor with arguments. */ + public void setBuilds(Iterable> 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); + } + // Since we cannot predict how many there will be, just show an ever-growing bar. + decay *= .99; + progress(1 - decay); + } + } + + @Override protected synchronized JSON data() { + JSONArray d = JSONArray.fromObject(results); + results.clear(); + return d; + } + + private 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); + } + +} diff --git a/core/src/main/resources/hudson/model/BuildTimelineWidget/control.jelly b/core/src/main/resources/hudson/model/BuildTimelineWidget/control.jelly index 3941925526..f695275f06 100644 --- a/core/src/main/resources/hudson/model/BuildTimelineWidget/control.jelly +++ b/core/src/main/resources/hudson/model/BuildTimelineWidget/control.jelly @@ -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({ diff --git a/core/src/main/resources/hudson/model/Job/buildTimeTrend.jelly b/core/src/main/resources/hudson/model/Job/buildTimeTrend.jelly index ec41aca715..44af0bde57 100644 --- a/core/src/main/resources/hudson/model/Job/buildTimeTrend.jelly +++ b/core/src/main/resources/hudson/model/Job/buildTimeTrend.jelly @@ -34,8 +34,6 @@ THE SOFTWARE.

${%Build Time Trend}

- -
[Build time graph]
@@ -51,7 +49,7 @@ THE SOFTWARE. ${%Slave} - + ${r.iconColor.description} @@ -73,11 +71,6 @@ THE SOFTWARE.
- - - ${%More than 1 builds are needed for the trend report.} - - diff --git a/core/src/main/resources/hudson/model/User/builds.jelly b/core/src/main/resources/hudson/model/User/builds.jelly index 7b7b63834f..cc4a6f28dc 100644 --- a/core/src/main/resources/hudson/model/User/builds.jelly +++ b/core/src/main/resources/hudson/model/User/builds.jelly @@ -30,6 +30,7 @@ THE SOFTWARE. ${%title(it)} + diff --git a/core/src/main/resources/lib/hudson/buildListTable.jelly b/core/src/main/resources/lib/hudson/buildListTable.jelly index cf2b131db2..296633dd41 100644 --- a/core/src/main/resources/lib/hudson/buildListTable.jelly +++ b/core/src/main/resources/lib/hudson/buildListTable.jelly @@ -43,33 +43,65 @@ THE SOFTWARE. ${%Status} - - - - - - ${b.iconColor.description} - - - - - - ${b.displayName} - - - ${b.timestampString} - - - - - - - ${%Console output} - - - - + + + ${handler.setBuilds(attrs.builds)} + From 51765382e861355037600d9fc63d4aadedf5d7b1 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 9 Dec 2013 12:38:02 -0500 Subject: [PATCH 03/49] [JENKINS-4543] Noting retroactively. --- changelog.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/changelog.html b/changelog.html index ab6951a887..8ca5526b01 100644 --- a/changelog.html +++ b/changelog.html @@ -798,6 +798,9 @@ Upcoming changes
  • NPE from MatrixConfiguration.newBuild. (issue 17728) +
  • + Identify the short name of an uploaded plugin from the manifest, so it does not matter what the filename was. + (issue 4543)
  • NPE configuring Copy Artifact with Maven jobs. (issue 17402) From c4bc5ebb333d1146e26676f33a1ef39d3962db69 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 9 Dec 2013 14:59:00 -0500 Subject: [PATCH 04/49] =?UTF-8?q?Using=20Prototype=E2=80=99s=20Template=20?= =?UTF-8?q?utility=20makes=20inserted=20table=20rows=20shorter=20and=20mor?= =?UTF-8?q?e=20readable.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Experimented with loading innerHTML of a hidden prototype HTML element, but the browser tried to load the bogus image URLs: http://stackoverflow.com/questions/805107/creating-multiline-strings-in-javascript --- .../resources/lib/hudson/buildListTable.jelly | 66 +++++-------------- 1 file changed, 17 insertions(+), 49 deletions(-) diff --git a/core/src/main/resources/lib/hudson/buildListTable.jelly b/core/src/main/resources/lib/hudson/buildListTable.jelly index 296633dd41..b0529ad586 100644 --- a/core/src/main/resources/lib/hudson/buildListTable.jelly +++ b/core/src/main/resources/lib/hudson/buildListTable.jelly @@ -43,62 +43,30 @@ THE SOFTWARE. ${%Status} - + ]]> ${handler.setBuilds(attrs.builds)} From f313db963c4b9a664b35a0bbaf2fd3d260d2cff3 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 9 Dec 2013 17:53:13 -0500 Subject: [PATCH 05/49] =?UTF-8?q?Using=20Prototype=E2=80=99s=20new=20Eleme?= =?UTF-8?q?nt(=E2=80=A6)=20is=20barely=20more=20verbose=20than=20Template,?= =?UTF-8?q?=20and=20seems=20safer.=20(More=20practical=20for=20conditional?= =?UTF-8?q?=20inclusion=20of=20elements.)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/lib/hudson/buildListTable.jelly | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/core/src/main/resources/lib/hudson/buildListTable.jelly b/core/src/main/resources/lib/hudson/buildListTable.jelly index b0529ad586..29da06161f 100644 --- a/core/src/main/resources/lib/hudson/buildListTable.jelly +++ b/core/src/main/resources/lib/hudson/buildListTable.jelly @@ -43,30 +43,33 @@ THE SOFTWARE. ${%Status} - + ${handler.setBuilds(attrs.builds)} From c9bb2bb3d38006baec1f747c0a14978cdd2ce1c2 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 9 Dec 2013 18:19:33 -0500 Subject: [PATCH 06/49] More consistent formatting. --- core/src/main/resources/lib/hudson/buildListTable.jelly | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/resources/lib/hudson/buildListTable.jelly b/core/src/main/resources/lib/hudson/buildListTable.jelly index 29da06161f..2c4bb71578 100644 --- a/core/src/main/resources/lib/hudson/buildListTable.jelly +++ b/core/src/main/resources/lib/hudson/buildListTable.jelly @@ -48,8 +48,8 @@ THE SOFTWARE. var p = $$('projectStatus'); for (var x = 0; data.length > x; x++) { var e = data[x]; - p.insert( - new Element('tr'). + p. + insert(new Element('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}'})))). From 335aa624a58efa4de3cfca1d7280c8a2f4d435ad Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 9 Dec 2013 18:25:38 -0500 Subject: [PATCH 07/49] Inefficient to call Behaviour.applySubtree on rows we added earlier. --- .../resources/lib/hudson/buildListTable.jelly | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/core/src/main/resources/lib/hudson/buildListTable.jelly b/core/src/main/resources/lib/hudson/buildListTable.jelly index 2c4bb71578..7bdd1118dc 100644 --- a/core/src/main/resources/lib/hudson/buildListTable.jelly +++ b/core/src/main/resources/lib/hudson/buildListTable.jelly @@ -48,26 +48,26 @@ THE SOFTWARE. var p = $$('projectStatus'); for (var x = 0; data.length > x; x++) { var e = data[x]; - p. - insert(new Element('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}'})))). - 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()))). - 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())). - insert(new Element('td', {style: e.buildStatusSummaryWorse ? 'color: red' : ''}). - update(e.buildStatusSummaryMessage.escapeHTML())). - 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}))))); + var tr = new Element('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}'})))). + 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()))). + 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())). + insert(new Element('td', {style: e.buildStatusSummaryWorse ? 'color: red' : ''}). + update(e.buildStatusSummaryMessage.escapeHTML())). + 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); } - Behaviour.applySubtree(p); } From 42fcaa6f5eb1081c2eced785b86f5b81c6434d5c Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 9 Dec 2013 18:35:36 -0500 Subject: [PATCH 08/49] Also need to refresh table sorting as we go. --- core/src/main/resources/lib/hudson/buildListTable.jelly | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/main/resources/lib/hudson/buildListTable.jelly b/core/src/main/resources/lib/hudson/buildListTable.jelly index 7bdd1118dc..71458c1e5b 100644 --- a/core/src/main/resources/lib/hudson/buildListTable.jelly +++ b/core/src/main/resources/lib/hudson/buildListTable.jelly @@ -68,6 +68,7 @@ THE SOFTWARE. p.insert(tr); Behaviour.applySubtree(tr); } + ts_refresh(p); } From 1e13c13e1c35fe883737c364f463cc24416a9615 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 9 Dec 2013 18:37:00 -0500 Subject: [PATCH 09/49] Factored out RunListProgressiveRendering supertype. --- .../java/jenkins/widgets/BuildListTable.java | 40 +-------- .../widgets/RunListProgressiveRendering.java | 81 +++++++++++++++++++ 2 files changed, 83 insertions(+), 38 deletions(-) create mode 100644 core/src/main/java/jenkins/widgets/RunListProgressiveRendering.java diff --git a/core/src/main/java/jenkins/widgets/BuildListTable.java b/core/src/main/java/jenkins/widgets/BuildListTable.java index 1a29abe1e6..ec8e60e368 100644 --- a/core/src/main/java/jenkins/widgets/BuildListTable.java +++ b/core/src/main/java/jenkins/widgets/BuildListTable.java @@ -27,50 +27,14 @@ package jenkins.widgets; import hudson.Functions; import hudson.model.BallColor; import hudson.model.Run; -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.DoNotUse; @Restricted(DoNotUse.class) // only for buildListTable.jelly -public class BuildListTable extends ProgressiveRendering { +public class BuildListTable extends RunListProgressiveRendering { - private final List results = new ArrayList(); - private Iterable> builds; - - /** Jelly cannot call a constructor with arguments. */ - public void setBuilds(Iterable> 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); - } - // Since we cannot predict how many there will be, just show an ever-growing bar. - decay *= .99; - progress(1 - decay); - } - } - - @Override protected synchronized JSON data() { - JSONArray d = JSONArray.fromObject(results); - results.clear(); - return d; - } - - private void calculate(Run build, JSONObject element) { + @Override protected void calculate(Run build, JSONObject element) { BallColor iconColor = build.getIconColor(); element.put("iconColorOrdinal", iconColor.ordinal()); element.put("iconColorDescription", iconColor.getDescription()); diff --git a/core/src/main/java/jenkins/widgets/RunListProgressiveRendering.java b/core/src/main/java/jenkins/widgets/RunListProgressiveRendering.java new file mode 100644 index 0000000000..5ab72a8a38 --- /dev/null +++ b/core/src/main/java/jenkins/widgets/RunListProgressiveRendering.java @@ -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 results = new ArrayList(); + private Iterable> builds; + + /** Jelly cannot call a constructor with arguments. */ + public void setBuilds(Iterable> 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); +} From 14b86d7728fdd4367c3ed7a89b1f5f2a47f417f0 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 9 Dec 2013 18:38:00 -0500 Subject: [PATCH 10/49] Display build trend progressively. --- .../java/jenkins/widgets/BuildTimeTrend.java | 65 +++++++++++++++++++ .../hudson/model/Job/buildTimeTrend.jelly | 45 +++++++------ 2 files changed, 91 insertions(+), 19 deletions(-) create mode 100644 core/src/main/java/jenkins/widgets/BuildTimeTrend.java diff --git a/core/src/main/java/jenkins/widgets/BuildTimeTrend.java b/core/src/main/java/jenkins/widgets/BuildTimeTrend.java new file mode 100644 index 0000000000..158ec398ea --- /dev/null +++ b/core/src/main/java/jenkins/widgets/BuildTimeTrend.java @@ -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()); + } + } + } + +} diff --git a/core/src/main/resources/hudson/model/Job/buildTimeTrend.jelly b/core/src/main/resources/hudson/model/Job/buildTimeTrend.jelly index 44af0bde57..083493abab 100644 --- a/core/src/main/resources/hudson/model/Job/buildTimeTrend.jelly +++ b/core/src/main/resources/hudson/model/Job/buildTimeTrend.jelly @@ -40,7 +40,7 @@ THE SOFTWARE.
    - +
    @@ -49,26 +49,33 @@ THE SOFTWARE. - - - - - + + + ${handler.setBuilds(it.builds)} +
    ${%Build}${%Slave}
    - ${r.iconColor.description} - - - ${r.displayName} - - - ${r.durationString} -
    From 102d9fc3ca2c618cc8dc95ab330c40ac80b34a21 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 9 Dec 2013 18:44:26 -0500 Subject: [PATCH 11/49] Progress bar should normally be outside, and above, table. --- .../hudson/model/Job/buildTimeTrend.jelly | 54 ++++++++-------- .../resources/lib/hudson/buildListTable.jelly | 62 +++++++++---------- 2 files changed, 58 insertions(+), 58 deletions(-) diff --git a/core/src/main/resources/hudson/model/Job/buildTimeTrend.jelly b/core/src/main/resources/hudson/model/Job/buildTimeTrend.jelly index 083493abab..f76f1f5a66 100644 --- a/core/src/main/resources/hudson/model/Job/buildTimeTrend.jelly +++ b/core/src/main/resources/hudson/model/Job/buildTimeTrend.jelly @@ -40,6 +40,33 @@ THE SOFTWARE.
    + + + ${handler.setBuilds(it.builds)} + @@ -49,33 +76,6 @@ THE SOFTWARE. - - - ${handler.setBuilds(it.builds)} -
    ${%Slave}
    diff --git a/core/src/main/resources/lib/hudson/buildListTable.jelly b/core/src/main/resources/lib/hudson/buildListTable.jelly index 71458c1e5b..fd63fb6bf5 100644 --- a/core/src/main/resources/lib/hudson/buildListTable.jelly +++ b/core/src/main/resources/lib/hudson/buildListTable.jelly @@ -35,6 +35,37 @@ THE SOFTWARE. + + + ${handler.setBuilds(attrs.builds)} + @@ -43,37 +74,6 @@ THE SOFTWARE. - - - ${handler.setBuilds(attrs.builds)} -
    ${%Status}
    From 207d6769b28a741fc1172e990cd23cb7c2d9f710 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 9 Dec 2013 18:49:44 -0500 Subject: [PATCH 12/49] So long as we need to define a variable for the tr anyway, it is less scary to terminate the fluid API there between each td. --- .../hudson/model/Job/buildTimeTrend.jelly | 21 ++++++------ .../resources/lib/hudson/buildListTable.jelly | 34 +++++++++---------- 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/core/src/main/resources/hudson/model/Job/buildTimeTrend.jelly b/core/src/main/resources/hudson/model/Job/buildTimeTrend.jelly index f76f1f5a66..e389beed31 100644 --- a/core/src/main/resources/hudson/model/Job/buildTimeTrend.jelly +++ b/core/src/main/resources/hudson/model/Job/buildTimeTrend.jelly @@ -45,19 +45,18 @@ THE SOFTWARE. var p = $$('trend'); for (var x = 0; data.length > x; x++) { var e = data[x]; - var tr = new Element('tr'). - insert(new Element('td', {data: e.iconColorOrdinal}). - insert(new Element('img', {width: 16, height: 16, src: '${imagesURL}/16x16/' + e.buildStatusUrl, alt: e.iconColorDescription}))). - insert(new Element('td', {data: e.number}). - insert(new Element('a', {href: e.number + '/', 'class': 'model-link inside'}). - update(e.displayName.escapeHTML()))). - insert(new Element('td', {data: e.duration}). - update(e.durationString.escapeHTML())) + 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())); - .insert(new Element('td'). - update(e.builtOn ? new Element('a', {href: '${rootURL}/computer/' + e.builtOn, 'class': 'model-link inside'}).update(e.builtOnStr) : e.builtOnStr)) + 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)); - ; p.insert(tr); Behaviour.applySubtree(tr); } diff --git a/core/src/main/resources/lib/hudson/buildListTable.jelly b/core/src/main/resources/lib/hudson/buildListTable.jelly index fd63fb6bf5..17d59a4bef 100644 --- a/core/src/main/resources/lib/hudson/buildListTable.jelly +++ b/core/src/main/resources/lib/hudson/buildListTable.jelly @@ -40,23 +40,23 @@ THE SOFTWARE. var p = $$('projectStatus'); for (var x = 0; data.length > x; x++) { var e = data[x]; - var tr = new Element('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}'})))). - 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()))). - 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())). - insert(new Element('td', {style: e.buildStatusSummaryWorse ? 'color: red' : ''}). - update(e.buildStatusSummaryMessage.escapeHTML())). - 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})))); + 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); } From c1d487f3256405ea1a43de4cdfffee5d674d4f1b Mon Sep 17 00:00:00 2001 From: Chris Arnott Date: Tue, 10 Dec 2013 09:22:21 +0000 Subject: [PATCH 13/49] [JENKINS 13870] Make all test results tables highlight row on hover Added the bigtable css class to all testresults tables that were missing it. --- .../src/main/resources/hudson/tasks/junit/CaseResult/list.jelly | 2 +- .../main/resources/hudson/tasks/junit/ClassResult/body.jelly | 2 +- .../main/resources/hudson/tasks/junit/ClassResult/list.jelly | 2 +- .../resources/hudson/tasks/test/MetaTabulatedResult/list.jelly | 2 +- .../resources/hudson/tasks/test/TrivialTestResult/body.jelly | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/main/resources/hudson/tasks/junit/CaseResult/list.jelly b/core/src/main/resources/hudson/tasks/junit/CaseResult/list.jelly index f7c2480ec0..99f9b4218f 100644 --- a/core/src/main/resources/hudson/tasks/junit/CaseResult/list.jelly +++ b/core/src/main/resources/hudson/tasks/junit/CaseResult/list.jelly @@ -28,7 +28,7 @@ THE SOFTWARE. - +
    diff --git a/core/src/main/resources/hudson/tasks/junit/ClassResult/body.jelly b/core/src/main/resources/hudson/tasks/junit/ClassResult/body.jelly index 6e5f67cfc9..64c7554a6d 100644 --- a/core/src/main/resources/hudson/tasks/junit/ClassResult/body.jelly +++ b/core/src/main/resources/hudson/tasks/junit/ClassResult/body.jelly @@ -26,7 +26,7 @@ THE SOFTWARE.

    ${%All Tests}

    -
    ${%Build} ${%Test Description}
    +
    diff --git a/core/src/main/resources/hudson/tasks/junit/ClassResult/list.jelly b/core/src/main/resources/hudson/tasks/junit/ClassResult/list.jelly index 918183b925..3c631ef775 100644 --- a/core/src/main/resources/hudson/tasks/junit/ClassResult/list.jelly +++ b/core/src/main/resources/hudson/tasks/junit/ClassResult/list.jelly @@ -25,7 +25,7 @@ THE SOFTWARE. -
    ${%Test name} ${%Duration}
    +
    diff --git a/core/src/main/resources/hudson/tasks/test/MetaTabulatedResult/list.jelly b/core/src/main/resources/hudson/tasks/test/MetaTabulatedResult/list.jelly index df754d1cf1..277272f560 100644 --- a/core/src/main/resources/hudson/tasks/test/MetaTabulatedResult/list.jelly +++ b/core/src/main/resources/hudson/tasks/test/MetaTabulatedResult/list.jelly @@ -25,7 +25,7 @@ THE SOFTWARE. -
    ${%Build} ${%Description}
    +
    diff --git a/test/src/test/resources/hudson/tasks/test/TrivialTestResult/body.jelly b/test/src/test/resources/hudson/tasks/test/TrivialTestResult/body.jelly index dd673d0f67..a1b51c9061 100644 --- a/test/src/test/resources/hudson/tasks/test/TrivialTestResult/body.jelly +++ b/test/src/test/resources/hudson/tasks/test/TrivialTestResult/body.jelly @@ -65,7 +65,7 @@ THE SOFTWARE.

    ${%All Tests}

    -
    ${%Build} ${%Description}
    +
    From a4e011835f33ba78adf6333f63e3f1912a38f611 Mon Sep 17 00:00:00 2001 From: Anders Kindberg Date: Tue, 10 Dec 2013 15:58:54 +0100 Subject: [PATCH 14/49] Fix Swedish typo --- core/src/main/resources/lib/form/apply_sv_SE.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/resources/lib/form/apply_sv_SE.properties b/core/src/main/resources/lib/form/apply_sv_SE.properties index ffa3c39f8d..578751a2b0 100644 --- a/core/src/main/resources/lib/form/apply_sv_SE.properties +++ b/core/src/main/resources/lib/form/apply_sv_SE.properties @@ -1,3 +1,3 @@ # This file is under the MIT License by authors -Apply=V\u00E4rkst\u00E4ll +Apply=Verkst\u00E4ll From 9679a6123ed30cb70e4d6e4b389f14d04746b995 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 10 Dec 2013 10:59:43 -0500 Subject: [PATCH 15/49] [JENKINS-20892] Noting merge of #1046. --- changelog.html | 3 +++ core/src/main/java/hudson/util/RunList.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index 8ca5526b01..d51476d812 100644 --- a/changelog.html +++ b/changelog.html @@ -67,6 +67,9 @@ Upcoming changes
  • groovysh command did not work in authenticated Jenkins instances. (issue 17929) +
  • + Avoid eagerly loading all builds when displaying lists of them (Build History and Build Time Trend UIs). + (issue 20892)
  • Error page should be visible even if the anonymous user does not have overall/read access. (issue 20866) diff --git a/core/src/main/java/hudson/util/RunList.java b/core/src/main/java/hudson/util/RunList.java index add82eb890..a2b040234d 100644 --- a/core/src/main/java/hudson/util/RunList.java +++ b/core/src/main/java/hudson/util/RunList.java @@ -187,7 +187,7 @@ public class RunList extends AbstractList { /** * Returns elements that satisfy the given predicate. * Warning: this method mutates the original list and then returns it. - * @since TODO + * @since 1.544 */ public RunList filter(Predicate predicate) { size = null; From fcdf74991226fb6869052caa89ed8d678944b6fc Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 10 Dec 2013 17:49:41 -0500 Subject: [PATCH 16/49] [FIXED JENKINS-18410] AbstractTestResultAction should be a RunAction2 so it need not persist its owning build. --- changelog.html | 3 ++ .../tasks/junit/JUnitResultArchiver.java | 3 +- .../hudson/tasks/junit/TestResultAction.java | 6 ++++ .../tasks/test/AbstractTestResultAction.java | 32 +++++++++++++------ .../test/AggregatedTestResultAction.java | 4 +++ .../test/AggregatedTestResultPublisher.java | 7 +++- .../hudson/tasks/test/MatrixTestResult.java | 5 +++ .../tasks/test/TestResultAggregator.java | 2 +- .../tasks/test/TrivialTestResultAction.java | 7 ++++ .../tasks/test/TrivialTestResultRecorder.java | 4 +-- 10 files changed, 59 insertions(+), 14 deletions(-) diff --git a/changelog.html b/changelog.html index d51476d812..58ccb7ea64 100644 --- a/changelog.html +++ b/changelog.html @@ -61,6 +61,9 @@ Upcoming changes
  • Hudson shows 0GB free space when space available drops below 1GB. (issue 7776) +
  • + Avoiding serializing the owning build as part of a test result action, as this can lead to errors later. + (issue 18410)
  • Added filter field for installed plugins tab. (issue 20219) diff --git a/core/src/main/java/hudson/tasks/junit/JUnitResultArchiver.java b/core/src/main/java/hudson/tasks/junit/JUnitResultArchiver.java index 50d5d784e8..6dea15b9ed 100644 --- a/core/src/main/java/hudson/tasks/junit/JUnitResultArchiver.java +++ b/core/src/main/java/hudson/tasks/junit/JUnitResultArchiver.java @@ -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) diff --git a/core/src/main/java/hudson/tasks/junit/TestResultAction.java b/core/src/main/java/hudson/tasks/junit/TestResultAction.java index c27053e7a3..4c48e1b74b 100644 --- a/core/src/main/java/hudson/tasks/junit/TestResultAction.java +++ b/core/src/main/java/hudson/tasks/junit/TestResultAction.java @@ -62,11 +62,17 @@ public class TestResultAction extends AbstractTestResultAction private Integer totalCount; private List testData = new ArrayList(); + @Deprecated public TestResultAction(AbstractBuild owner, TestResult result, BuildListener listener) { super(owner); setResult(result, listener); } + /** @since 1.544 */ + public TestResultAction(TestResult result, BuildListener listener) { + this(null, result, listener); + } + /** * Overwrites the {@link TestResult} by a new data set. */ diff --git a/core/src/main/java/hudson/tasks/test/AbstractTestResultAction.java b/core/src/main/java/hudson/tasks/test/AbstractTestResultAction.java index 16ac32ad1d..925e0fb99b 100644 --- a/core/src/main/java/hudson/tasks/test/AbstractTestResultAction.java +++ b/core/src/main/java/hudson/tasks/test/AbstractTestResultAction.java @@ -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 implements HealthReportingAction { - public final AbstractBuild owner; +public abstract class AbstractTestResultAction implements HealthReportingAction, RunAction2 { + public transient AbstractBuild owner; private Map descriptions = new ConcurrentHashMap(); + /** @since 1.544 */ + 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. */ diff --git a/core/src/main/java/hudson/tasks/test/AggregatedTestResultAction.java b/core/src/main/java/hudson/tasks/test/AggregatedTestResultAction.java index 91d97ac64d..877cc0af6d 100644 --- a/core/src/main/java/hudson/tasks/test/AggregatedTestResultAction.java +++ b/core/src/main/java/hudson/tasks/test/AggregatedTestResultAction.java @@ -67,10 +67,14 @@ public abstract class AggregatedTestResultAction extends AbstractTestResultActio */ public final List children = new ArrayList(); + @Deprecated public AggregatedTestResultAction(AbstractBuild owner) { super(owner); } + /** @since 1.544 */ + public AggregatedTestResultAction() {} + protected void update(List children) { failCount = skipCount = totalCount = 0; this.children.clear(); diff --git a/core/src/main/java/hudson/tasks/test/AggregatedTestResultPublisher.java b/core/src/main/java/hudson/tasks/test/AggregatedTestResultPublisher.java index 2b4bd00174..709908d688 100644 --- a/core/src/main/java/hudson/tasks/test/AggregatedTestResultPublisher.java +++ b/core/src/main/java/hudson/tasks/test/AggregatedTestResultPublisher.java @@ -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 didntRun; private transient List 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; diff --git a/core/src/main/java/hudson/tasks/test/MatrixTestResult.java b/core/src/main/java/hudson/tasks/test/MatrixTestResult.java index 5f6fa77c8c..d023fc9a6c 100644 --- a/core/src/main/java/hudson/tasks/test/MatrixTestResult.java +++ b/core/src/main/java/hudson/tasks/test/MatrixTestResult.java @@ -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.544 */ + public MatrixTestResult() {} + /** * Use the configuration name. */ diff --git a/core/src/main/java/hudson/tasks/test/TestResultAggregator.java b/core/src/main/java/hudson/tasks/test/TestResultAggregator.java index 22d90b9134..72b76fd708 100644 --- a/core/src/main/java/hudson/tasks/test/TestResultAggregator.java +++ b/core/src/main/java/hudson/tasks/test/TestResultAggregator.java @@ -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; } diff --git a/test/src/test/java/hudson/tasks/test/TrivialTestResultAction.java b/test/src/test/java/hudson/tasks/test/TrivialTestResultAction.java index efa33f76de..993c05bf44 100644 --- a/test/src/test/java/hudson/tasks/test/TrivialTestResultAction.java +++ b/test/src/test/java/hudson/tasks/test/TrivialTestResultAction.java @@ -32,12 +32,19 @@ import org.kohsuke.stapler.StaplerProxy; public class TrivialTestResultAction extends AbstractTestResultAction implements StaplerProxy { protected TrivialTestResult result; + + @Deprecated protected TrivialTestResultAction(AbstractBuild owner, TrivialTestResult result) { super(owner); this.result = result; this.result.setParentAction(this); } + /** @since 1.544 */ + protected TrivialTestResultAction(TrivialTestResult result) { + this(null, result); + } + /** * Gets the number of failed tests. */ diff --git a/test/src/test/java/hudson/tasks/test/TrivialTestResultRecorder.java b/test/src/test/java/hudson/tasks/test/TrivialTestResultRecorder.java index 3958f1a340..aaa272bb10 100644 --- a/test/src/test/java/hudson/tasks/test/TrivialTestResultRecorder.java +++ b/test/src/test/java/hudson/tasks/test/TrivialTestResultRecorder.java @@ -48,9 +48,9 @@ public class TrivialTestResultRecorder extends Recorder implements Serializable System.out.println("performing TrviialTestResultRecorder"); listener.getLogger().println("perfoming TrivialTestResultRecorder"); TrivialTestResult r = new TrivialTestResult("gubernatorial"); - TrivialTestResultAction action = new TrivialTestResultAction(build, r); + TrivialTestResultAction action = new TrivialTestResultAction(r); r.setParentAction(action); - build.getActions().add(action); + build.addAction(action); listener.getLogger().println("done with TrivialTestResultRecorder"); System.out.println("done with TrivialTestResultRecorder"); return true; From a58e198f8aa60dd0cb244cba338d9c48141590e5 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 10 Dec 2013 18:50:33 -0500 Subject: [PATCH 17/49] [FIXED JENKINS-20951] XmlFile.read/unmarshal needs to catch general XStreamException so as to include CannotResolveClassException, thrown when a TopLevelItem provided by a plugin is unloadable. --- changelog.html | 3 ++ core/src/main/java/hudson/XmlFile.java | 10 ++-- .../java/hudson/model/ItemGroupMixIn.java | 4 +- .../org/jvnet/hudson/test/MockFolder.java | 3 ++ .../java/hudson/model/ItemGroupMixInTest.java | 50 ++++++++++++++++++ ...xmlFileReadCannotResolveClassException.zip | Bin 0 -> 1390 bytes 6 files changed, 62 insertions(+), 8 deletions(-) create mode 100644 test/src/test/java/hudson/model/ItemGroupMixInTest.java create mode 100644 test/src/test/resources/hudson/model/ItemGroupMixInTest/xmlFileReadCannotResolveClassException.zip diff --git a/changelog.html b/changelog.html index 58ccb7ea64..ca68e9c0ac 100644 --- a/changelog.html +++ b/changelog.html @@ -76,6 +76,9 @@ Upcoming changes
  • Error page should be visible even if the anonymous user does not have overall/read access. (issue 20866) +
  • + CannotResolveClassException breaks loading of entire containing folder, not just one job. + (issue 20951)
  • JavaScript errors when navigating away from a page with a build timeline widget while the timeline is loading. (pull request 1041) diff --git a/core/src/main/java/hudson/XmlFile.java b/core/src/main/java/hudson/XmlFile.java index 148578c469..00eae060e9 100644 --- a/core/src/main/java/hudson/XmlFile.java +++ b/core/src/main/java/hudson/XmlFile.java @@ -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); diff --git a/core/src/main/java/hudson/model/ItemGroupMixIn.java b/core/src/main/java/hudson/model/ItemGroupMixIn.java index a91405c3a4..5c9bbab602 100644 --- a/core/src/main/java/hudson/model/ItemGroupMixIn.java +++ b/core/src/main/java/hudson/model/ItemGroupMixIn.java @@ -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); } } diff --git a/test/src/main/java/org/jvnet/hudson/test/MockFolder.java b/test/src/main/java/org/jvnet/hudson/test/MockFolder.java index cf4231c2e9..dec3e6243a 100644 --- a/test/src/main/java/org/jvnet/hudson/test/MockFolder.java +++ b/test/src/main/java/org/jvnet/hudson/test/MockFolder.java @@ -94,6 +94,9 @@ public class MockFolder extends AbstractItem implements ModifiableTopLevelItemGr } @Override public TopLevelItem getItem(String name) { + if (items == null) { + return null; // cf. parent hack in AbstractProject.onLoad + } return items.get(name); } diff --git a/test/src/test/java/hudson/model/ItemGroupMixInTest.java b/test/src/test/java/hudson/model/ItemGroupMixInTest.java new file mode 100644 index 0000000000..ddf14573db --- /dev/null +++ b/test/src/test/java/hudson/model/ItemGroupMixInTest.java @@ -0,0 +1,50 @@ +/* + * 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 hudson.model; + +import java.util.Collection; +import static org.junit.Assert.*; +import org.junit.Rule; +import org.junit.Test; +import org.jvnet.hudson.test.Bug; +import org.jvnet.hudson.test.JenkinsRule; +import org.jvnet.hudson.test.MockFolder; +import org.jvnet.hudson.test.recipes.LocalData; + +public class ItemGroupMixInTest { + + @Rule public JenkinsRule r = new JenkinsRule(); + + @Bug(20951) + @LocalData + @Test public void xmlFileReadCannotResolveClassException() throws Exception { + MockFolder d = r.jenkins.getItemByFullName("d", MockFolder.class); + assertNotNull(d); + Collection items = d.getItems(); + assertEquals(1, items.size()); + assertEquals("valid", items.iterator().next().getName()); + } + +} diff --git a/test/src/test/resources/hudson/model/ItemGroupMixInTest/xmlFileReadCannotResolveClassException.zip b/test/src/test/resources/hudson/model/ItemGroupMixInTest/xmlFileReadCannotResolveClassException.zip new file mode 100644 index 0000000000000000000000000000000000000000..c5f4ba8211596f2ae57783c0b031d3268f4a99dd GIT binary patch literal 1390 zcmaiy&q@MO6vnTP_D6#uDoQHD@TuM19{7L8uQbcErhU;Zo}Mf+ zMSFZYet_`?S(ZqBDUA6q?f;Z7XjbF-mrfj&-70ID{xnRRv0wtO#$ z!XaLEZKtj_d)#o785VIDkHIW+sTN(ogOs3(Mo=BUvO1q~g#lI*#2ms_w+f*Tn1^5iq%A_a@FR(#mh| z%j;kjr!a*^3?mnZ8uoaL+kLKfEU#{I_0ToizWGG5piC?12FT*G!hTEm9ba5}R9B*) zRRk(rRvEP)pz!7Z7SS~dn=I}KmH^E2@JhhsB;v8*g32Dh1y*d0b)B(wxU4d92mJad zz36{}E`ZaBg2@4diz^2(jO3CmVidy7m7RYO1<_;h9?><~d$`52_wD3lCIOkakJL!d P!4 literal 0 HcmV?d00001 From c71a7d070da48a00d5c57f5c2b413dfec27c31aa Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Tue, 10 Dec 2013 16:57:12 -0800 Subject: [PATCH 18/49] [maven-release-plugin] prepare release jenkins-1.543 --- cli/pom.xml | 2 +- core/pom.xml | 2 +- plugins/pom.xml | 8 ++++---- pom.xml | 2 +- test/pom.xml | 2 +- war/pom.xml | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 7988fba3ca..b663df7468 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ pom org.jenkins-ci.main - 1.543-SNAPSHOT + 1.543 cli diff --git a/core/pom.xml b/core/pom.xml index 40c56a5451..0b8144dc19 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 1.543-SNAPSHOT + 1.543 ../pom.xml diff --git a/plugins/pom.xml b/plugins/pom.xml index 34803dc406..ab7b3bb732 100644 --- a/plugins/pom.xml +++ b/plugins/pom.xml @@ -11,7 +11,7 @@ org.jenkins-ci.plugins plugin Jenkins plugin POM - 1.543-SNAPSHOT + 1.543 pom +

    What's new in 1.543 (2013/12/10)

    • HTML metacharacters not escaped in log messages. (issue 20800)
    -

    What's new in 1.542 (2013/12/02)

    • From 6db47326e1eb8fa5884783f63733399eb1aa9f53 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Tue, 10 Dec 2013 18:55:01 -0800 Subject: [PATCH 21/49] updated changelog as a part of the release --- debian/debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/debian/changelog b/debian/debian/changelog index e07e824096..d4e063941f 100644 --- a/debian/debian/changelog +++ b/debian/debian/changelog @@ -1,3 +1,9 @@ +jenkins (1.543) unstable; urgency=low + + * See http://jenkins-ci.org/changelog for more details. + + -- Kohsuke Kawaguchi Tue, 10 Dec 2013 18:12:44 -0800 + jenkins (1.542) unstable; urgency=low * See http://jenkins-ci.org/changelog for more details. From f6d5448eedb57a27a721a17c0603f2ba16345cae Mon Sep 17 00:00:00 2001 From: Chris Arnott Date: Wed, 11 Dec 2013 08:52:11 +0000 Subject: [PATCH 22/49] [JENKINS-11429] Add a column "Success" in test result table Added a column Pass (rather than success) to the tables in the junit plugin. --- .../hudson/tasks/test/MetaTabulatedResult/body.jelly | 6 ++++++ .../hudson/tasks/test/TrivialTestResult/body.jelly | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/core/src/main/resources/hudson/tasks/test/MetaTabulatedResult/body.jelly b/core/src/main/resources/hudson/tasks/test/MetaTabulatedResult/body.jelly index 9ca50c497d..6c141a1cec 100644 --- a/core/src/main/resources/hudson/tasks/test/MetaTabulatedResult/body.jelly +++ b/core/src/main/resources/hudson/tasks/test/MetaTabulatedResult/body.jelly @@ -57,6 +57,8 @@ THE SOFTWARE.
  • + + @@ -80,6 +82,10 @@ THE SOFTWARE. + + + + @@ -96,6 +98,10 @@ THE SOFTWARE. + +
    ${it.childTitle} ${%Duration}(${%diff}) ${%Skip} (${%diff})${%Pass}(${%diff}) ${%Total} (${%diff})
    ${h.getDiffString2(p.skipCount-prev.skipCount)} ${p.passCount} + ${h.getDiffString2(p.passCount-prev.passCount)} + ${p.totalCount} ${h.getDiffString2(p.totalCount-prev.totalCount)} diff --git a/test/src/test/resources/hudson/tasks/test/TrivialTestResult/body.jelly b/test/src/test/resources/hudson/tasks/test/TrivialTestResult/body.jelly index a1b51c9061..201940681c 100644 --- a/test/src/test/resources/hudson/tasks/test/TrivialTestResult/body.jelly +++ b/test/src/test/resources/hudson/tasks/test/TrivialTestResult/body.jelly @@ -73,6 +73,8 @@ THE SOFTWARE. (${%diff}) ${%Skip} (${%diff})${%Pass}(${%diff}) ${%Total} (${%diff})
    ${h.getDiffString2(p.skipCount-prev.skipCount)} ${p.passCount} + ${h.getDiffString2(p.passCount-prev.passCount)} + ${p.totalCount} ${h.getDiffString2(p.totalCount-prev.totalCount)} From a1cd8c73fdd29282b08e31d454819976cdf3612d Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Wed, 11 Dec 2013 07:53:30 -0800 Subject: [PATCH 23/49] creating an RC branch --- changelog.html | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/changelog.html b/changelog.html index 66bade5da9..1bb9a8af3a 100644 --- a/changelog.html +++ b/changelog.html @@ -54,6 +54,14 @@ Upcoming changes + + + - - -

    What's new in 1.543 (2013/12/10)

      From cf396b0f9ad234d070341fc6ee87afa2283b81ca Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Wed, 11 Dec 2013 07:53:34 -0800 Subject: [PATCH 24/49] the trunk is toward 1.545-SNAPSHOT --- cli/pom.xml | 2 +- core/pom.xml | 2 +- plugins/pom.xml | 8 ++++---- pom.xml | 2 +- test/pom.xml | 2 +- war/pom.xml | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index d0bf4ce3a2..6328a2d6af 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ pom org.jenkins-ci.main - 1.544-SNAPSHOT + 1.545-SNAPSHOT cli diff --git a/core/pom.xml b/core/pom.xml index 9ce0208877..adae6bbacb 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 1.544-SNAPSHOT + 1.545-SNAPSHOT ../pom.xml diff --git a/plugins/pom.xml b/plugins/pom.xml index 488f37d662..fd0e915227 100644 --- a/plugins/pom.xml +++ b/plugins/pom.xml @@ -11,7 +11,7 @@ org.jenkins-ci.plugins plugin Jenkins plugin POM - 1.544-SNAPSHOT + 1.545-SNAPSHOT pom @@ -69,9 +74,6 @@ Upcoming changes
    • Hudson shows 0GB free space when space available drops below 1GB. (issue 7776) -
    • - Avoiding serializing the owning build as part of a test result action, as this can lead to errors later. - (issue 18410)
    • Added filter field for installed plugins tab. (issue 20219) @@ -84,9 +86,6 @@ Upcoming changes
    • Error page should be visible even if the anonymous user does not have overall/read access. (issue 20866) -
    • - CannotResolveClassException breaks loading of entire containing folder, not just one job. - (issue 20951)
    • JavaScript errors when navigating away from a page with a build timeline widget while the timeline is loading. (pull request 1041) diff --git a/core/src/main/java/hudson/tasks/junit/TestResultAction.java b/core/src/main/java/hudson/tasks/junit/TestResultAction.java index 4c48e1b74b..318246d710 100644 --- a/core/src/main/java/hudson/tasks/junit/TestResultAction.java +++ b/core/src/main/java/hudson/tasks/junit/TestResultAction.java @@ -68,7 +68,7 @@ public class TestResultAction extends AbstractTestResultAction setResult(result, listener); } - /** @since 1.544 */ + /** @since 1.545 */ public TestResultAction(TestResult result, BuildListener listener) { this(null, result, listener); } diff --git a/core/src/main/java/hudson/tasks/test/AbstractTestResultAction.java b/core/src/main/java/hudson/tasks/test/AbstractTestResultAction.java index 925e0fb99b..fa89a51ebb 100644 --- a/core/src/main/java/hudson/tasks/test/AbstractTestResultAction.java +++ b/core/src/main/java/hudson/tasks/test/AbstractTestResultAction.java @@ -67,7 +67,7 @@ public abstract class AbstractTestResultAction descriptions = new ConcurrentHashMap(); - /** @since 1.544 */ + /** @since 1.545 */ protected AbstractTestResultAction() {} /** @deprecated Use the default constructor and just call {@link Run#addAction} to associate the build with the action. */ diff --git a/core/src/main/java/hudson/tasks/test/AggregatedTestResultAction.java b/core/src/main/java/hudson/tasks/test/AggregatedTestResultAction.java index 877cc0af6d..549fca2eb4 100644 --- a/core/src/main/java/hudson/tasks/test/AggregatedTestResultAction.java +++ b/core/src/main/java/hudson/tasks/test/AggregatedTestResultAction.java @@ -72,7 +72,7 @@ public abstract class AggregatedTestResultAction extends AbstractTestResultActio super(owner); } - /** @since 1.544 */ + /** @since 1.545 */ public AggregatedTestResultAction() {} protected void update(List children) { diff --git a/core/src/main/java/hudson/tasks/test/MatrixTestResult.java b/core/src/main/java/hudson/tasks/test/MatrixTestResult.java index d023fc9a6c..6d2122a3cd 100644 --- a/core/src/main/java/hudson/tasks/test/MatrixTestResult.java +++ b/core/src/main/java/hudson/tasks/test/MatrixTestResult.java @@ -44,7 +44,7 @@ public class MatrixTestResult extends AggregatedTestResultAction { super(owner); } - /** @since 1.544 */ + /** @since 1.545 */ public MatrixTestResult() {} /** diff --git a/test/src/test/java/hudson/tasks/test/TrivialTestResultAction.java b/test/src/test/java/hudson/tasks/test/TrivialTestResultAction.java index 993c05bf44..f51f50d24d 100644 --- a/test/src/test/java/hudson/tasks/test/TrivialTestResultAction.java +++ b/test/src/test/java/hudson/tasks/test/TrivialTestResultAction.java @@ -40,7 +40,7 @@ public class TrivialTestResultAction extends AbstractTestResultAction Date: Wed, 11 Dec 2013 15:29:20 -0500 Subject: [PATCH 26/49] [JENKINS-10615] AbstractProjectTest.testWorkspaceLock frequently fails on jenkins.ci due to InterruptedException in HudsonTestCase.setUp. Possibly because it is sorted after [JENKINS-15156] testGetBuildAfterGC and the test suite times out. --- test/src/test/groovy/hudson/model/AbstractProjectTest.groovy | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/src/test/groovy/hudson/model/AbstractProjectTest.groovy b/test/src/test/groovy/hudson/model/AbstractProjectTest.groovy index 96fe360bd4..96b64e7aab 100644 --- a/test/src/test/groovy/hudson/model/AbstractProjectTest.groovy +++ b/test/src/test/groovy/hudson/model/AbstractProjectTest.groovy @@ -278,6 +278,7 @@ public class AbstractProjectTest extends HudsonTestCase { assertSymlinkForBuild(lastStable, 1); } + /* TODO too slow, seems capable of causing testWorkspaceLock to time out: @Bug(15156) public void testGetBuildAfterGC() { FreeStyleProject job = createFreeStyleProject(); @@ -286,6 +287,7 @@ public class AbstractProjectTest extends HudsonTestCase { MemoryAssert.assertGC(new WeakReference(job.getLastBuild())); assert job.lastBuild != null; } + */ @Bug(13502) public void testHandleBuildTrigger() { From 3f1f122ff415319b6408ab89f8b3ff0bf4da597d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20Gond=C5=BEa?= Date: Wed, 11 Dec 2013 15:54:00 +0100 Subject: [PATCH 27/49] [FIXED JENKINS-20928] l:breakable mishandles HTML metacharacters --- core/src/main/java/hudson/Functions.java | 4 ++-- core/src/test/java/hudson/FunctionsTest.java | 23 +++++++++++++++++--- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index 50c115a850..1d285059e9 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -1824,8 +1824,8 @@ public class Functions { */ public static String breakableString(final String plain) { - return plain.replaceAll("(\\p{Punct}+\\w)", "$1") - .replaceAll("(\\w{10})(?=\\w{3})", "$1") + return plain.replaceAll("([\\p{Punct}&&[^;]]+\\w)", "$1") + .replaceAll("([^\\p{Punct}\\s-]{10})(?=[^\\p{Punct}\\s-]{3})", "$1") ; } diff --git a/core/src/test/java/hudson/FunctionsTest.java b/core/src/test/java/hudson/FunctionsTest.java index 8d13742cac..a35cce9240 100644 --- a/core/src/test/java/hudson/FunctionsTest.java +++ b/core/src/test/java/hudson/FunctionsTest.java @@ -291,9 +291,26 @@ public class FunctionsTest { @Test public void testBreakableString() { - assertEquals("Hello world!", Functions.breakableString("Hello world!")); - assertEquals("H,e.l/l:o-w_o=+|d", Functions.breakableString("H,e.l/l:o-w_o=+|d")); - assertEquals("ALongStringThatCanNotBeBrokenByDefault", 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("<<<<<", "", "<", "<", "<", "<", "<"); + assertBrokenAs("&&&&&", "", "&", "&", "&", "&", "&"); + assertBrokenAs("ϑϑϑ", "", "ϑ", "ϑ", "ϑ"); + assertBrokenAs("Crazy <ha ha>", "Crazy ", "<ha ha", ">"); + assertBrokenAs("A;String>Full]Of)Weird}Punctuation", "A;String", ">Full", "]Of", ")Weird", "}Punctuation"); + assertBrokenAs("<<a<bc<def<ghi<", "", "<", "<a", "<bc", "<def", "<ghi", "<"); + 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), ""), + Functions.breakableString(plain) + ); } @Bug(20800) From bc4c1326579631be648dc6c47f1200b246743b0a Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Thu, 12 Dec 2013 15:28:52 -0500 Subject: [PATCH 28/49] =?UTF-8?q?Plugins=20with=20=E2=89=A51=20functional?= =?UTF-8?q?=20test=20and=20a=20=E2=89=A51.536=20dep=20would=20sometimes=20?= =?UTF-8?q?fail=20during=20clean=20builds=20due=20to=20a=20race=20conditio?= =?UTF-8?q?n=20in=20WarExploder.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/src/main/java/org/jvnet/hudson/test/WarExploder.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/src/main/java/org/jvnet/hudson/test/WarExploder.java b/test/src/main/java/org/jvnet/hudson/test/WarExploder.java index 2d831b7f95..eab9e231af 100644 --- a/test/src/main/java/org/jvnet/hudson/test/WarExploder.java +++ b/test/src/main/java/org/jvnet/hudson/test/WarExploder.java @@ -89,17 +89,21 @@ final class WarExploder { // TODO this assumes that the CWD of the Maven process is the plugin ${basedir}, which may not be the case File explodeDir = new File("./target/jenkins-for-test").getAbsoluteFile(); + while (new File(explodeDir + ".exploding").isFile()) { + explodeDir = new File(explodeDir + "x"); + } File timestamp = new File(explodeDir,".timestamp"); if(!timestamp.exists() || (timestamp.lastModified()!=war.lastModified())) { - System.out.println("Exploding jenkins.war at "+war); + System.out.println("Exploding " + war + " into " + explodeDir); + new FileOutputStream(explodeDir + ".exploding").close(); new FilePath(explodeDir).deleteRecursive(); - // TODO this can fail (race condition?) when running tests in parallel; need a three-state flag, and switch to a different explodeDir as needed new FilePath(war).unzip(new FilePath(explodeDir)); if(!explodeDir.exists()) // this is supposed to be impossible, but I'm investigating HUDSON-2605 throw new IOException("Failed to explode "+war); new FileOutputStream(timestamp).close(); timestamp.setLastModified(war.lastModified()); + new File(explodeDir + ".exploding").delete(); } else { System.out.println("Picking up existing exploded jenkins.war at "+explodeDir.getAbsolutePath()); } From 192defb79d706343bb38508bf0cfaeaef5a82775 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Thu, 12 Dec 2013 21:09:28 -0500 Subject: [PATCH 29/49] Fixing a couple of obsolete references to HudsonTestCase. --- .../main/java/org/jvnet/hudson/test/JenkinsRule.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java b/test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java index eaf8c8c6d5..47e38d6cf4 100644 --- a/test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java +++ b/test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java @@ -653,7 +653,7 @@ public class JenkinsRule implements TestRule, MethodRule, RootAction { LOGGER.warning("Extracting a copy of Maven bundled in the test harness into " + mvnHome + ". " + "To avoid a performance hit, set the system property 'maven.home' to point to a Maven2 installation."); FilePath mvn = jenkins.getRootPath().createTempFile("maven", "zip"); - mvn.copyFrom(HudsonTestCase.class.getClassLoader().getResource(mavenVersion + "-bin.zip")); + mvn.copyFrom(JenkinsRule.class.getClassLoader().getResource(mavenVersion + "-bin.zip")); mvn.unzip(new FilePath(buildDirectory)); // TODO: switch to tar that preserves file permissions more easily if(!Functions.isWindows()) @@ -676,7 +676,7 @@ public class JenkinsRule implements TestRule, MethodRule, RootAction { LOGGER.warning("Extracting a copy of Ant bundled in the test harness. " + "To avoid a performance hit, set the environment variable ANT_HOME to point to an Ant installation."); FilePath ant = jenkins.getRootPath().createTempFile("ant", "zip"); - ant.copyFrom(HudsonTestCase.class.getClassLoader().getResource("apache-ant-1.8.1-bin.zip")); + ant.copyFrom(JenkinsRule.class.getClassLoader().getResource("apache-ant-1.8.1-bin.zip")); File antHome = createTmpDir(); ant.unzip(new FilePath(antHome)); // TODO: switch to tar that preserves file permissions more easily @@ -1667,7 +1667,7 @@ public class JenkinsRule implements TestRule, MethodRule, RootAction { * in the context of an HTTP request. * *

      - * In {@link HudsonTestCase}, a thread that's executing the test code is different from the thread + * In {@link JenkinsRule}, a thread that's executing the test code is different from the thread * that carries out HTTP requests made through {@link WebClient}. But sometimes you want to * make assertions and other calls with side-effect from within the request handling thread. * @@ -1783,7 +1783,7 @@ public class JenkinsRule implements TestRule, MethodRule, RootAction { * Logs in to Hudson, by using the user name as the password. * *

      - * See {@link HudsonTestCase#configureUserRealm()} for how the container is set up with the user names + * See {@link #configureUserRealm} for how the container is set up with the user names * and passwords. All the test accounts have the same user name and password. */ public WebClient login(String username) throws Exception { @@ -1796,7 +1796,7 @@ public class JenkinsRule implements TestRule, MethodRule, RootAction { * in the context of an HTTP request. * *

      - * In {@link HudsonTestCase}, a thread that's executing the test code is different from the thread + * In {@link JenkinsRule}, a thread that's executing the test code is different from the thread * that carries out HTTP requests made through {@link WebClient}. But sometimes you want to * make assertions and other calls with side-effect from within the request handling thread. * From 59ba11bce6906c46ab420a31868b3ec181292443 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Thu, 12 Dec 2013 21:09:46 -0500 Subject: [PATCH 30/49] Making a field final. --- test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java b/test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java index 47e38d6cf4..7019fb23b4 100644 --- a/test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java +++ b/test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java @@ -2070,7 +2070,7 @@ public class JenkinsRule implements TestRule, MethodRule, RootAction { /** * Specify this to a TCP/IP port number to have slaves started with the debugger. */ - public static int SLAVE_DEBUG_PORT = Integer.getInteger(HudsonTestCase.class.getName()+".slaveDebugPort",-1); + public static final int SLAVE_DEBUG_PORT = Integer.getInteger(HudsonTestCase.class.getName()+".slaveDebugPort",-1); public static final MimeTypes MIME_TYPES = new MimeTypes(); static { From c0c5b076ec7fa75093bfdb13e0b06a12a46e4a6e Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Fri, 13 Dec 2013 10:49:57 -0500 Subject: [PATCH 31/49] DRY: LogRecorderManager.configDir. --- core/src/main/java/hudson/logging/LogRecorder.java | 2 +- core/src/main/java/hudson/logging/LogRecorderManager.java | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/hudson/logging/LogRecorder.java b/core/src/main/java/hudson/logging/LogRecorder.java index f780252af4..918724bbb4 100644 --- a/core/src/main/java/hudson/logging/LogRecorder.java +++ b/core/src/main/java/hudson/logging/LogRecorder.java @@ -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")); } /** diff --git a/core/src/main/java/hudson/logging/LogRecorderManager.java b/core/src/main/java/hudson/logging/LogRecorderManager.java index ab8337c701..d16ece6c2b 100644 --- a/core/src/main/java/hudson/logging/LogRecorderManager.java +++ b/core/src/main/java/hudson/logging/LogRecorderManager.java @@ -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) { From 4ca5aba3c0627292d18f8b05e8cc65c60eed6b82 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Fri, 13 Dec 2013 16:56:16 -0500 Subject: [PATCH 32/49] Suppressing a senseless stack trace. h.n.AbstractNodeMonitorDescriptor$Record#: Previous Free Disk Space monitoring activity still in progress. Interrupting h.n.AbstractNodeMonitorDescriptor$Record#run: Unexpected node monitoring termination: Free Disk Space java.lang.InterruptedException at java.lang.Object.wait(Native Method) at hudson.remoting.Request$1.get(Request.java:272) at hudson.remoting.Request$1.get(Request.java:210) at hudson.remoting.FutureAdapter.get(FutureAdapter.java:59) at hudson.node_monitors.AbstractAsyncNodeMonitorDescriptor.monitor(AbstractAsyncNodeMonitorDescriptor.java:97) at hudson.node_monitors.AbstractNodeMonitorDescriptor$Record.run(AbstractNodeMonitorDescriptor.java:282) --- .../hudson/node_monitors/AbstractNodeMonitorDescriptor.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/node_monitors/AbstractNodeMonitorDescriptor.java b/core/src/main/java/hudson/node_monitors/AbstractNodeMonitorDescriptor.java index 062268ea37..c104c73868 100644 --- a/core/src/main/java/hudson/node_monitors/AbstractNodeMonitorDescriptor.java +++ b/core/src/main/java/hudson/node_monitors/AbstractNodeMonitorDescriptor.java @@ -265,7 +265,7 @@ public abstract class AbstractNodeMonitorDescriptor extends Descriptor extends Descriptor Date: Sun, 15 Dec 2013 05:33:30 -0800 Subject: [PATCH 33/49] [maven-release-plugin] prepare release jenkins-1.544 --- cli/pom.xml | 2 +- core/pom.xml | 2 +- plugins/pom.xml | 8 ++++---- pom.xml | 2 +- test/pom.xml | 2 +- war/pom.xml | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index d0bf4ce3a2..0abc0c869a 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ pom org.jenkins-ci.main - 1.544-SNAPSHOT + 1.544 cli diff --git a/core/pom.xml b/core/pom.xml index 9ce0208877..bcbd838596 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 1.544-SNAPSHOT + 1.544 ../pom.xml diff --git a/plugins/pom.xml b/plugins/pom.xml index 488f37d662..5f9dadd069 100644 --- a/plugins/pom.xml +++ b/plugins/pom.xml @@ -11,7 +11,7 @@ org.jenkins-ci.plugins plugin Jenkins plugin POM - 1.544-SNAPSHOT + 1.544 pom

      +

      What's new in 1.544 (2013/12/15)

      • RingBufferLogHandler throws ArrayIndexOutOfBoundsException after int-overflow. @@ -85,7 +88,6 @@ Upcoming changes JavaScript errors when navigating away from a page with a build timeline widget while the timeline is loading. (pull request 1041)
      -

      What's new in 1.543 (2013/12/10)

      • From c9432bda978ef9e510b2fda19d04c110b2212943 Mon Sep 17 00:00:00 2001 From: olivierlemasle Date: Sun, 15 Dec 2013 16:35:34 +0100 Subject: [PATCH 36/49] Fix french translation --- .../PluginManager/advanced_fr.properties | 6 ++--- .../MatrixProject/ajaxMatrix_fr.properties | 2 +- .../configure-common_fr.properties | 2 -- .../model/AbstractItem/delete_fr.properties | 2 +- .../hudson/model/View/sidepanel_fr.properties | 4 ++-- .../config-assignedLabel_fr.properties | 24 +++++++++++++++++++ 6 files changed, 31 insertions(+), 9 deletions(-) create mode 100644 core/src/main/resources/lib/hudson/project/config-assignedLabel_fr.properties diff --git a/core/src/main/resources/hudson/PluginManager/advanced_fr.properties b/core/src/main/resources/hudson/PluginManager/advanced_fr.properties index c27841534d..18e75bbbd8 100644 --- a/core/src/main/resources/hudson/PluginManager/advanced_fr.properties +++ b/core/src/main/resources/hudson/PluginManager/advanced_fr.properties @@ -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 diff --git a/core/src/main/resources/hudson/matrix/MatrixProject/ajaxMatrix_fr.properties b/core/src/main/resources/hudson/matrix/MatrixProject/ajaxMatrix_fr.properties index 2eb98346cc..d973d5dab9 100644 --- a/core/src/main/resources/hudson/matrix/MatrixProject/ajaxMatrix_fr.properties +++ b/core/src/main/resources/hudson/matrix/MatrixProject/ajaxMatrix_fr.properties @@ -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 diff --git a/core/src/main/resources/hudson/model/AbstractItem/configure-common_fr.properties b/core/src/main/resources/hudson/model/AbstractItem/configure-common_fr.properties index 676b9ee7c6..6c32876b4e 100644 --- a/core/src/main/resources/hudson/model/AbstractItem/configure-common_fr.properties +++ b/core/src/main/resources/hudson/model/AbstractItem/configure-common_fr.properties @@ -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) diff --git a/core/src/main/resources/hudson/model/AbstractItem/delete_fr.properties b/core/src/main/resources/hudson/model/AbstractItem/delete_fr.properties index 43bbfcd4a8..2b290a25c3 100644 --- a/core/src/main/resources/hudson/model/AbstractItem/delete_fr.properties +++ b/core/src/main/resources/hudson/model/AbstractItem/delete_fr.properties @@ -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}"? \ No newline at end of file diff --git a/core/src/main/resources/hudson/model/View/sidepanel_fr.properties b/core/src/main/resources/hudson/model/View/sidepanel_fr.properties index 89ccb9debd..ac09421cf1 100644 --- a/core/src/main/resources/hudson/model/View/sidepanel_fr.properties +++ b/core/src/main/resources/hudson/model/View/sidepanel_fr.properties @@ -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 diff --git a/core/src/main/resources/lib/hudson/project/config-assignedLabel_fr.properties b/core/src/main/resources/lib/hudson/project/config-assignedLabel_fr.properties new file mode 100644 index 0000000000..c0ec0f1dc0 --- /dev/null +++ b/core/src/main/resources/lib/hudson/project/config-assignedLabel_fr.properties @@ -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 From 0d373fa3724ace25154a07f81589bcab2877daef Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 15 Dec 2013 08:59:28 -0800 Subject: [PATCH 37/49] updated changelog as a part of the release --- debian/debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/debian/changelog b/debian/debian/changelog index d4e063941f..2282db70a2 100644 --- a/debian/debian/changelog +++ b/debian/debian/changelog @@ -1,3 +1,9 @@ +jenkins (1.544) unstable; urgency=low + + * See http://jenkins-ci.org/changelog for more details. + + -- Kohsuke Kawaguchi Sun, 15 Dec 2013 07:15:04 -0800 + jenkins (1.543) unstable; urgency=low * See http://jenkins-ci.org/changelog for more details. From c3508113f0e1659f0e6c1064f31cb2ac1caa2ef3 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 16 Dec 2013 15:03:07 -0500 Subject: [PATCH 38/49] =?UTF-8?q?[FIXED=20JENKINS-21024]=20Catch=20a=20ful?= =?UTF-8?q?l=20range=20of=20XStreamException=E2=80=99s=20during=20deserial?= =?UTF-8?q?ization,=20including=20rethrown=20exceptions=20from=20readResol?= =?UTF-8?q?ve.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.html | 3 + .../java/hudson/util/CopyOnWriteList.java | 9 +-- .../util/RobustCollectionConverter.java | 11 +--- .../util/RobustReflectionConverter.java | 11 +--- .../util/xstream/ImmutableListConverter.java | 4 +- .../groovy/hudson/model/RunMapTest.groovy | 6 +- .../util/RobustReflectionConverterTest.java | 56 ++++++++++++++++++ .../randomExceptionsReported.zip | Bin 0 -> 276 bytes 8 files changed, 74 insertions(+), 26 deletions(-) create mode 100644 test/src/test/java/hudson/util/RobustReflectionConverterTest.java create mode 100644 test/src/test/resources/hudson/util/RobustReflectionConverterTest/randomExceptionsReported.zip diff --git a/changelog.html b/changelog.html index 6091481ff4..e20c5644f6 100644 --- a/changelog.html +++ b/changelog.html @@ -58,6 +58,9 @@ Upcoming changes
      • CannotResolveClassException breaks loading of entire containing folder, not just one job. (issue 20951) +
      • + Better robustness against XML deserialization errors. + (issue 21024)
      • Avoiding serializing the owning build as part of a test result action, as this can lead to errors later. (issue 18410) diff --git a/core/src/main/java/hudson/util/CopyOnWriteList.java b/core/src/main/java/hudson/util/CopyOnWriteList.java index a6e7372b8b..bf66360658 100644 --- a/core/src/main/java/hudson/util/CopyOnWriteList.java +++ b/core/src/main/java/hudson/util/CopyOnWriteList.java @@ -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 implements Iterable { 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 implements Iterable { } } - private static final Logger LOGGER = Logger.getLogger(CopyOnWriteList.class.getName()); } diff --git a/core/src/main/java/hudson/util/RobustCollectionConverter.java b/core/src/main/java/hudson/util/RobustCollectionConverter.java index 86e1de7b21..78dc2b2f2f 100644 --- a/core/src/main/java/hudson/util/RobustCollectionConverter.java +++ b/core/src/main/java/hudson/util/RobustCollectionConverter.java @@ -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}. * *

        * 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()); } diff --git a/core/src/main/java/hudson/util/RobustReflectionConverter.java b/core/src/main/java/hudson/util/RobustReflectionConverter.java index 99cd902d5a..0be434f1de 100755 --- a/core/src/main/java/hudson/util/RobustReflectionConverter.java +++ b/core/src/main/java/hudson/util/RobustReflectionConverter.java @@ -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 list = (ArrayList)context.get("ReadError"); if (list == null) context.put("ReadError", list = new ArrayList()); diff --git a/core/src/main/java/hudson/util/xstream/ImmutableListConverter.java b/core/src/main/java/hudson/util/xstream/ImmutableListConverter.java index 6c901e008a..18fd97ec98 100644 --- a/core/src/main/java/hudson/util/xstream/ImmutableListConverter.java +++ b/core/src/main/java/hudson/util/xstream/ImmutableListConverter.java @@ -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); diff --git a/test/src/test/groovy/hudson/model/RunMapTest.groovy b/test/src/test/groovy/hudson/model/RunMapTest.groovy index 8a1ca14036..63529cf668 100644 --- a/test/src/test/groovy/hudson/model/RunMapTest.groovy +++ b/test/src/test/groovy/hudson/model/RunMapTest.groovy @@ -53,7 +53,11 @@ class RunMapTest extends HudsonTestCase { b.save() p._getRuns().purgeCache() - assert p.getBuildByNumber(b.number)==null + b = p.getBuildByNumber(b.number) + // Original test assumed that b == null, but after JENKINS-21024 this is no longer true, + // so this may not really be testing anything interesting: + assert b != null + assert b.getAction(BombAction.class) == null assert bombed } diff --git a/test/src/test/java/hudson/util/RobustReflectionConverterTest.java b/test/src/test/java/hudson/util/RobustReflectionConverterTest.java new file mode 100644 index 0000000000..009c40a4c4 --- /dev/null +++ b/test/src/test/java/hudson/util/RobustReflectionConverterTest.java @@ -0,0 +1,56 @@ +/* + * 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 hudson.util; + +import hudson.diagnosis.OldDataMonitor; +import hudson.model.FreeStyleProject; +import hudson.model.Saveable; +import java.util.Collections; +import java.util.Map; +import static org.junit.Assert.*; +import org.junit.Rule; +import org.junit.Test; +import org.jvnet.hudson.test.Bug; +import org.jvnet.hudson.test.JenkinsRule; +import org.jvnet.hudson.test.recipes.LocalData; + +public class RobustReflectionConverterTest { + + @Rule public JenkinsRule r = new JenkinsRule(); + + @Bug(21024) + @LocalData + @Test public void randomExceptionsReported() throws Exception { + FreeStyleProject p = r.jenkins.getItemByFullName("j", FreeStyleProject.class); + assertNotNull(p); + assertEquals(Collections.emptyMap(), p.getTriggers()); + OldDataMonitor odm = (OldDataMonitor) r.jenkins.getAdministrativeMonitor("OldData"); + Map data = odm.getData(); + assertEquals(Collections.singleton(p), data.keySet()); + String text = data.values().iterator().next().extra; + assertTrue(text, text.contains("Could not call hudson.triggers.TimerTrigger.readResolve")); + } + +} diff --git a/test/src/test/resources/hudson/util/RobustReflectionConverterTest/randomExceptionsReported.zip b/test/src/test/resources/hudson/util/RobustReflectionConverterTest/randomExceptionsReported.zip new file mode 100644 index 0000000000000000000000000000000000000000..23248c408552fdae4882537c67ab79944286157e GIT binary patch literal 276 zcmWIWW@Zs#U|`^2$jX}F%qz40ZVZsO5r_pDWEisYlZy4T^po@R(lXQaDspo|LpT|j zHC)yQfpBRBHv=Qf3uXoeFtJ%v5%a<#Ql3Jh4Ir1neda2QZ zkh+ONE@Eqx7Mm=!u=nR*7NDt4s6% literal 0 HcmV?d00001 From 66805b7463230da6512306b84485700aea83f349 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 16 Dec 2013 16:25:05 -0500 Subject: [PATCH 39/49] Why did these tests have timeouts? Seems to have caused spurious timeout errors. https://jenkins.ci.cloudbees.com/job/core/job/jenkins_main_trunk/1748/testReport/junit/hudson.scheduler/CronTabEventualityTest/testFirstSundayOfMonthWillBeEventuallyTriggeredWithinOneMonthAndOneWeek_0_/ java.lang.Exception: test timed out after 1000 milliseconds at java.io.UnixFileSystem.getBooleanAttributes0(Native Method) at java.io.UnixFileSystem.getBooleanAttributes(UnixFileSystem.java:242) at java.io.File.exists(File.java:772) at sun.misc.URLClassPath$FileLoader.getResource(URLClassPath.java:1072) at sun.misc.URLClassPath.getResource(URLClassPath.java:199) at java.net.URLClassLoader$1.run(URLClassLoader.java:358) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at hudson.scheduler.CronTab.set(CronTab.java:87) at hudson.scheduler.CronTab.(CronTab.java:83) at hudson.scheduler.CronTab.(CronTab.java:66) at hudson.scheduler.CronTabEventualityTest.checkEventuality(CronTabEventualityTest.java:113) at hudson.scheduler.CronTabEventualityTest.testFirstSundayOfMonthWillBeEventuallyTriggeredWithinOneMonthAndOneWeek(CronTabEventualityTest.java:109) --- .../scheduler/CronTabEventualityTest.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/core/src/test/java/hudson/scheduler/CronTabEventualityTest.java b/core/src/test/java/hudson/scheduler/CronTabEventualityTest.java index d322d402e8..45fae2367e 100644 --- a/core/src/test/java/hudson/scheduler/CronTabEventualityTest.java +++ b/core/src/test/java/hudson/scheduler/CronTabEventualityTest.java @@ -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); From 7eecfeb261ad76a87eb4f7c24c7872e0afb90540 Mon Sep 17 00:00:00 2001 From: Kenichi Maehashi Date: Wed, 18 Dec 2013 01:10:05 +0900 Subject: [PATCH 40/49] set file.encoding=UTF-8 as default in OS X runner --- osx/Library/Application Support/Jenkins/jenkins-runner.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osx/Library/Application Support/Jenkins/jenkins-runner.sh b/osx/Library/Application Support/Jenkins/jenkins-runner.sh index b493d1c19c..0a8257252a 100755 --- a/osx/Library/Application Support/Jenkins/jenkins-runner.sh +++ b/osx/Library/Application Support/Jenkins/jenkins-runner.sh @@ -14,7 +14,7 @@ defaults="defaults read /Library/Preferences/org.jenkins-ci" war=`$defaults war` || war="/Applications/Jenkins/jenkins.war" -javaArgs="" +javaArgs="-Dfile.encoding=UTF-8" minPermGen=`$defaults minPermGen` && javaArgs="$javaArgs -XX:PermSize=${minPermGen}" permGen=`$defaults permGen` && javaArgs="$javaArgs -XX:MaxPermSize=${permGen}" From ef0b08499514d04c49ea41029d076aefb4d88dc7 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 17 Dec 2013 11:49:51 -0500 Subject: [PATCH 41/49] Moving some help files to mailer-plugin where they belong. --- .../webapp/help/project-config/mailer.html | 16 --------------- .../webapp/help/project-config/mailer_de.html | 17 ---------------- .../webapp/help/project-config/mailer_fr.html | 20 ------------------- .../webapp/help/project-config/mailer_ja.html | 16 --------------- .../help/project-config/mailer_pt_BR.html | 16 --------------- .../webapp/help/project-config/mailer_ru.html | 14 ------------- .../webapp/help/project-config/mailer_tr.html | 15 -------------- .../help/project-config/mailer_zh_TW.html | 12 ----------- .../help/tasks/mailer/sendToindividuals.html | 8 -------- .../tasks/mailer/sendToindividuals_de.html | 13 ------------ .../tasks/mailer/sendToindividuals_fr.html | 11 ---------- .../tasks/mailer/sendToindividuals_ja.html | 6 ------ .../tasks/mailer/sendToindividuals_nl.html | 10 ---------- .../tasks/mailer/sendToindividuals_pt_BR.html | 8 -------- .../tasks/mailer/sendToindividuals_ru.html | 9 --------- .../tasks/mailer/sendToindividuals_tr.html | 10 ---------- .../tasks/mailer/sendToindividuals_zh_CN.html | 8 -------- .../tasks/mailer/sendToindividuals_zh_TW.html | 7 ------- .../webapp/help/tasks/mailer/smtpAuth.html | 4 ---- .../webapp/help/tasks/mailer/smtpAuth_de.html | 4 ---- .../webapp/help/tasks/mailer/smtpAuth_fr.html | 5 ----- .../webapp/help/tasks/mailer/smtpAuth_ja.html | 4 ---- .../webapp/help/tasks/mailer/smtpAuth_nl.html | 4 ---- .../help/tasks/mailer/smtpAuth_pt_BR.html | 4 ---- .../webapp/help/tasks/mailer/smtpAuth_ru.html | 4 ---- .../webapp/help/tasks/mailer/smtpAuth_tr.html | 4 ---- .../help/tasks/mailer/smtpAuth_zh_CN.html | 3 --- .../help/tasks/mailer/smtpAuth_zh_TW.html | 3 --- 28 files changed, 255 deletions(-) delete mode 100644 war/src/main/webapp/help/project-config/mailer.html delete mode 100644 war/src/main/webapp/help/project-config/mailer_de.html delete mode 100644 war/src/main/webapp/help/project-config/mailer_fr.html delete mode 100644 war/src/main/webapp/help/project-config/mailer_ja.html delete mode 100644 war/src/main/webapp/help/project-config/mailer_pt_BR.html delete mode 100644 war/src/main/webapp/help/project-config/mailer_ru.html delete mode 100644 war/src/main/webapp/help/project-config/mailer_tr.html delete mode 100644 war/src/main/webapp/help/project-config/mailer_zh_TW.html delete mode 100644 war/src/main/webapp/help/tasks/mailer/sendToindividuals.html delete mode 100644 war/src/main/webapp/help/tasks/mailer/sendToindividuals_de.html delete mode 100644 war/src/main/webapp/help/tasks/mailer/sendToindividuals_fr.html delete mode 100644 war/src/main/webapp/help/tasks/mailer/sendToindividuals_ja.html delete mode 100644 war/src/main/webapp/help/tasks/mailer/sendToindividuals_nl.html delete mode 100644 war/src/main/webapp/help/tasks/mailer/sendToindividuals_pt_BR.html delete mode 100644 war/src/main/webapp/help/tasks/mailer/sendToindividuals_ru.html delete mode 100644 war/src/main/webapp/help/tasks/mailer/sendToindividuals_tr.html delete mode 100644 war/src/main/webapp/help/tasks/mailer/sendToindividuals_zh_CN.html delete mode 100644 war/src/main/webapp/help/tasks/mailer/sendToindividuals_zh_TW.html delete mode 100644 war/src/main/webapp/help/tasks/mailer/smtpAuth.html delete mode 100644 war/src/main/webapp/help/tasks/mailer/smtpAuth_de.html delete mode 100644 war/src/main/webapp/help/tasks/mailer/smtpAuth_fr.html delete mode 100644 war/src/main/webapp/help/tasks/mailer/smtpAuth_ja.html delete mode 100644 war/src/main/webapp/help/tasks/mailer/smtpAuth_nl.html delete mode 100644 war/src/main/webapp/help/tasks/mailer/smtpAuth_pt_BR.html delete mode 100644 war/src/main/webapp/help/tasks/mailer/smtpAuth_ru.html delete mode 100644 war/src/main/webapp/help/tasks/mailer/smtpAuth_tr.html delete mode 100644 war/src/main/webapp/help/tasks/mailer/smtpAuth_zh_CN.html delete mode 100644 war/src/main/webapp/help/tasks/mailer/smtpAuth_zh_TW.html diff --git a/war/src/main/webapp/help/project-config/mailer.html b/war/src/main/webapp/help/project-config/mailer.html deleted file mode 100644 index ab7067e257..0000000000 --- a/war/src/main/webapp/help/project-config/mailer.html +++ /dev/null @@ -1,16 +0,0 @@ -

        - If configured, Jenkins will send out an e-mail to the specified recipients - when a certain important event occurs. - -
          -
        1. Every failed build triggers a new e-mail. -
        2. A successful build after a failed (or unstable) build triggers a new e-mail, - indicating that a crisis is over. -
        3. An unstable build after a successful build triggers a new e-mail, - indicating that there's a regression. -
        4. Unless configured, every unstable build triggers a new e-mail, - indicating that regression is still there. -
        - - For lazy projects where unstable builds are the norm, Uncheck "Send e-mail for every unstable build". -
        \ No newline at end of file diff --git a/war/src/main/webapp/help/project-config/mailer_de.html b/war/src/main/webapp/help/project-config/mailer_de.html deleted file mode 100644 index fc83f7daa4..0000000000 --- a/war/src/main/webapp/help/project-config/mailer_de.html +++ /dev/null @@ -1,17 +0,0 @@ -
        - Ist diese Option konfiguriert, sendet Jenkins E-Mails an die angegebenen Empfänger - wenn bestimmte wichtige Ereignisse eintreten. - -
          -
        1. Jeder fehlgeschlagene Build löst eine neue E-Mail aus. -
        2. Ein erfolgreicher Build nach einem fehlgeschlagenen (oder instabilen) - löst eine neue E-Mail aus, um über eine überstandene Krise zu informieren. -
        3. Ein instabiler Build nach einem erfolgreichen löst eine neue E-Mail aus, - um über einen Regressionsfehler zu informieren. -
        4. Sofern nicht anders konfiguriert, lost jeder instabile Build eine neue - E-Mail aus, um über weiter anhaltende Regressionsfehler zu informieren. -
        - - Für nachlässige Projekte, in denen instabile Projekte der Regelfall sind, wählen Sie - "E-Mail für jeden instabilen Build senden" ab. -
        \ No newline at end of file diff --git a/war/src/main/webapp/help/project-config/mailer_fr.html b/war/src/main/webapp/help/project-config/mailer_fr.html deleted file mode 100644 index fee081e6b1..0000000000 --- a/war/src/main/webapp/help/project-config/mailer_fr.html +++ /dev/null @@ -1,20 +0,0 @@ -
        - Jenkins a la capacité d'envoyer des emails aux destinaires spécifiés - lorsque certains évènements importants ont eu lieu. - -
          -
        1. Chaque build en échec provoque l'envoi d'un mail. -
        2. Un build qui passe avec succès après un build en échec - provoque l'envoi d'un mail, ce qui permet de savoir qu'une situation - de crise est résolue. -
        3. Un build instable après un build avec succès provoque l'envoi - d'un mail, indiquant ainsi qu'il y a eu une régression. -
        4. Sauf configuration contraire, chaque build instable - provoque l'envoi d'un mail, indiquant ainsi qu'une régression est - toujours d'actualité. -
        - - Pour les projets qui ne suivent pas les bonnes pratiques et - où les builds instables sont la norme, décochez la case - "Envoyer un email à chaque build instable". -
        \ No newline at end of file diff --git a/war/src/main/webapp/help/project-config/mailer_ja.html b/war/src/main/webapp/help/project-config/mailer_ja.html deleted file mode 100644 index 324576e60e..0000000000 --- a/war/src/main/webapp/help/project-config/mailer_ja.html +++ /dev/null @@ -1,16 +0,0 @@ -
        - 設定すると、Jenkinsは特定の重要なイベントが発生した際に、指定した宛先にメールを送信します。 - -
          -
        1. ビルドが失敗するごとに、メールを送信します。 -
        2. ビルドが失敗(もしくは不安定)した直後にビルドが成功すると、 - 危機を脱したことを告げるメールを送信します。 -
        3. ビルドが成功した直後にビルドが不安定になると、 - デグレートがあることを告げるメールを送信します。 -
        4. 設定しなければ、ビルドが不安定になるごとに、 - デグレートがまだ存在することを告げるメールを送信します。 -
        - - 不安定ビルドであることが常である、だらだらしたプロジェクトでは、 - "不安定ビルドも逐一メールを送る"をチェックしないようにします。 -
        diff --git a/war/src/main/webapp/help/project-config/mailer_pt_BR.html b/war/src/main/webapp/help/project-config/mailer_pt_BR.html deleted file mode 100644 index 5e254689a6..0000000000 --- a/war/src/main/webapp/help/project-config/mailer_pt_BR.html +++ /dev/null @@ -1,16 +0,0 @@ -
        - Se configurado, o Jenkins enviará um e-mail para os destinatários especificados - quanod um certo evento importante ocorrer. - -
          -
        1. Toda construção que falha dispara um novo e-mail. -
        2. Uma construção feita com sucesso após uma construção falha (ou instável) dipara um novo e-mail, - indicando que uma crise terminou. -
        3. Uma construção instável após uma construção bem sucedida dispara um novo e-mail, - indicando que há uma regressão. -
        4. A menos que configurado, toda construção instável dipara um novo e-mail, - indicando que a regressão ainda está lá. -
        - - Par projetos preguiçosos (lazy) onde construções instávei são a norma, Marque "Não enviar e-mail para toda construção instável". -
        diff --git a/war/src/main/webapp/help/project-config/mailer_ru.html b/war/src/main/webapp/help/project-config/mailer_ru.html deleted file mode 100644 index 8b11786d9d..0000000000 --- a/war/src/main/webapp/help/project-config/mailer_ru.html +++ /dev/null @@ -1,14 +0,0 @@ -
        - Если указан список получателей, Jenkins будет отправлять уведомления по электронной - почте на эти адреса при наступлении следующих событий: - -
          -
        1. Каждая провалившаяся сборка -
        2. Успешная сборка после провалившихся (или нестабильных) -
        3. Нестабильная сборка после стабильной (сообщает о появлении регрессии) -
        4. Каждая нестабильная сборка (если не запрещено другими настройками) -
        - - Для "ленивых" проектов, где нестабильная сборка считается нормой, установите - флажок "Не отправлять уведомление для каждой нестабильной сборки". -
        \ No newline at end of file diff --git a/war/src/main/webapp/help/project-config/mailer_tr.html b/war/src/main/webapp/help/project-config/mailer_tr.html deleted file mode 100644 index d150881482..0000000000 --- a/war/src/main/webapp/help/project-config/mailer_tr.html +++ /dev/null @@ -1,15 +0,0 @@ -
        - Bu ayar, Husdon'ın önemli bir durum oluştuğunda belirtilen alıcılara mail atmasını sağlar. - -
          -
        1. Her başarısız yapılandırma e-posta atılmasını tetikler. -
        2. Başarısız (veya dengesiz) bir yapılandırmadan sonraki ilk başarılı yapılandırma yeni - bir e-posta atılmasını tetikler, ki bu da kriz durumunun sona erdiğini ifade eder. -
        3. Başarılı bir yapılandırmadan hemen sonraki dengesiz yapılandırma e-posta atılmasını tetikler, - ki bu da bir gerileme olduğunu ifade eder. -
        4. Konfigürasyon yapılmazsa, her dengesiz yapılandırma e-posta atılmasını tetikler, - ki bu da gerilemenin hala mevcut olduğunu ifade eder. -
        - - Dengesiz yapılandırmaların standartlaştığı projelerde, "Her dengesiz yapılandırmada e-posta gönderme" seçeneğini seçiniz. -
        \ No newline at end of file diff --git a/war/src/main/webapp/help/project-config/mailer_zh_TW.html b/war/src/main/webapp/help/project-config/mailer_zh_TW.html deleted file mode 100644 index a4108e44f9..0000000000 --- a/war/src/main/webapp/help/project-config/mailer_zh_TW.html +++ /dev/null @@ -1,12 +0,0 @@ -
        - 設定後,Jenkins 會在特定重大事情發生時,寄送電子郵件給指定的收件人。 - -
          -
        1. 每次建置失敗都會觸發寄送新郵件。 -
        2. 建置失敗 (或不穩定) 後建置成功將會觸發寄送郵件,告訴大家危機已經解除。 -
        3. 建置成功後如果發生建置不穩定也會觸發寄送郵件,昭告天下我們又倒退了一步。 -
        4. 除非另外設定,不然每次不穩定的建置都會觸發寄送郵件,告訴大家狀況還沒解除。 -
        - - 對散漫的專案來說,不穩定的建置是常態,就把「每次建置不穩定都寄送郵件」選項給勾掉吧...。 -
        \ No newline at end of file diff --git a/war/src/main/webapp/help/tasks/mailer/sendToindividuals.html b/war/src/main/webapp/help/tasks/mailer/sendToindividuals.html deleted file mode 100644 index 97d06edb4b..0000000000 --- a/war/src/main/webapp/help/tasks/mailer/sendToindividuals.html +++ /dev/null @@ -1,8 +0,0 @@ -
        - If this option is checked, the notification e-mail will be sent to individuals who have - committed changes for the broken build (by assuming that those changes broke the build). -

        - If e-mail addresses are also specified in the recipient list, then both the individuals - as well as the specified addresses get the notification e-mail. If the recipient list - is empty, then only the individuals will receive e-mails. -

        \ No newline at end of file diff --git a/war/src/main/webapp/help/tasks/mailer/sendToindividuals_de.html b/war/src/main/webapp/help/tasks/mailer/sendToindividuals_de.html deleted file mode 100644 index c4e8aa63d5..0000000000 --- a/war/src/main/webapp/help/tasks/mailer/sendToindividuals_de.html +++ /dev/null @@ -1,13 +0,0 @@ -
        - Schickt E-Mail-Benachrichtigungen an alle "verursachenden" Benutzer, die mit - eingecheckten Änderungen an einem fehlgeschlagenen Build beteiligt waren - (in der Vermutung, daß diese Änderungen den Fehlschlag verursachten). - -

        - - Wenn im Empfänger-Verteiler ebenfalls Adressen angegeben sind, werden - E-Mail-Benachrichtigungen sowohl an alle Adressen des Empfänger-Verteilers - als auch an die "verursachenden" Benutzer geschickt. Ist der E-Mail-Verteiler - hingegen leer, erhalten ausschließlich die "verursachenden" Benutzer - E-Mail-Benachrichtigungen. -

        \ No newline at end of file diff --git a/war/src/main/webapp/help/tasks/mailer/sendToindividuals_fr.html b/war/src/main/webapp/help/tasks/mailer/sendToindividuals_fr.html deleted file mode 100644 index 7e58425c12..0000000000 --- a/war/src/main/webapp/help/tasks/mailer/sendToindividuals_fr.html +++ /dev/null @@ -1,11 +0,0 @@ -
        - Si cette option est choisie, les notifications par email seront envoyées - aux personnes qui ont fait des modifications dans un build en échec - (on suppose que ces changements ont cassé ce build). -

        - Si des adresses email sont aussi spécifiées sur la liste des destinataires, - alors l'email de notification est envoyé à la fois à cette liste et aux - personnes ayant fait des modifications. - Si la liste des destinataires est vide, alors seules les personnes - changeurs recevront des emails. -

        \ No newline at end of file diff --git a/war/src/main/webapp/help/tasks/mailer/sendToindividuals_ja.html b/war/src/main/webapp/help/tasks/mailer/sendToindividuals_ja.html deleted file mode 100644 index 9ba072edae..0000000000 --- a/war/src/main/webapp/help/tasks/mailer/sendToindividuals_ja.html +++ /dev/null @@ -1,6 +0,0 @@ -
        - 壊れたビルドに含まれる変更をコミットした個人にメールを送信します(変更がビルドを壊したとみなします)。 -

        - 宛先にもメールアドレスが指定されている場合、ここに指定された個人と指定されたアドレスにもにメールを送信します。 - 宛先が指定されていない場合、ここに指定した個人にだけメールを送信します。 -

        \ No newline at end of file diff --git a/war/src/main/webapp/help/tasks/mailer/sendToindividuals_nl.html b/war/src/main/webapp/help/tasks/mailer/sendToindividuals_nl.html deleted file mode 100644 index c9d5658dd8..0000000000 --- a/war/src/main/webapp/help/tasks/mailer/sendToindividuals_nl.html +++ /dev/null @@ -1,10 +0,0 @@ -
        - Indien aangevinkt, zal er een e-mail verstuurd worden naar de personen die wijzigingen - opgeladen hebben, in de context van een gefaalde bouwpoging. Hierbij wordt ervan uitgegaan - dat één van die wijziging de bouwpoging heeft doen falen. -

        - Indien u de lijst van geaddresseerden opgeeft, worden zowel de personen die wijzigingen - hebben doorgevoerd als de geaddresseerden, via e-mail op de hoogte gebracht. Indien U geen - geaddresseerden opgeeft worden enkel de personen die wijzigingen hebben doorgevoerd via e-mail - op de hoogte gebracht. -

        \ No newline at end of file diff --git a/war/src/main/webapp/help/tasks/mailer/sendToindividuals_pt_BR.html b/war/src/main/webapp/help/tasks/mailer/sendToindividuals_pt_BR.html deleted file mode 100644 index dedbc9219e..0000000000 --- a/war/src/main/webapp/help/tasks/mailer/sendToindividuals_pt_BR.html +++ /dev/null @@ -1,8 +0,0 @@ -
        - Se esta opção estiver marcada, o e-mail de notificação será enviado para os indivíduos que - comitaram mudanças para a costrução que falhou (assumindo que estas mudanças causaram a falha na construção). -

        - Se os endereços de e-mail também forem especificados na lista de destinatários, então ambos os indivíduos - bem como os endereços especificados na lista receberão e-mails. Se a lista de destinatários - estiver vazia, então apens os indivíduos receberão e-mails. -

        diff --git a/war/src/main/webapp/help/tasks/mailer/sendToindividuals_ru.html b/war/src/main/webapp/help/tasks/mailer/sendToindividuals_ru.html deleted file mode 100644 index 503f14d282..0000000000 --- a/war/src/main/webapp/help/tasks/mailer/sendToindividuals_ru.html +++ /dev/null @@ -1,9 +0,0 @@ -
        - Если эта настройка включена, уведомление будет отправлено тем лицам, - которые вносили изменения в провалившуюся сборку (предполагая, что сборку сломали - именно эти изменения). -

        - Если адреса также указаны в списке получателей, тогда два списка будут объединены. - Если список получателей пуст, уведомления получат только авторы последний изменений - (произошедших от момента предыдущей сборки до текущей). -

        \ No newline at end of file diff --git a/war/src/main/webapp/help/tasks/mailer/sendToindividuals_tr.html b/war/src/main/webapp/help/tasks/mailer/sendToindividuals_tr.html deleted file mode 100644 index 3de016e58f..0000000000 --- a/war/src/main/webapp/help/tasks/mailer/sendToindividuals_tr.html +++ /dev/null @@ -1,10 +0,0 @@ -
        - Bu seçenek, bozuk bir yapılandırmaya değişiklikleri ile katılan bireylere, yapılandırmanın bozuk - olduğu ile ilgili e-posta atılmasını sağlar (yapılandırmayı bozanın, değişiklikleri yapan - bireyler olduğu varsayılarak) - -

        - Eğer alıcı listesinde e-posta adresi belirtilmişse, hem bu alıcılar, hem de değişiklikleri gönderen - bireyler bu e-postayı alacaklardır. Eğer alıcı listesi boşsa, sadece değişiklikleri gönderen - bireylere e-posta gönderilir. -

        \ No newline at end of file diff --git a/war/src/main/webapp/help/tasks/mailer/sendToindividuals_zh_CN.html b/war/src/main/webapp/help/tasks/mailer/sendToindividuals_zh_CN.html deleted file mode 100644 index 67398b4470..0000000000 --- a/war/src/main/webapp/help/tasks/mailer/sendToindividuals_zh_CN.html +++ /dev/null @@ -1,8 +0,0 @@ -
        - If this option is checked, the notification e-mail will be sent to individuals who have - committed changes for the broken build (by assuming that those changes broke the build). -

        - If e-mail addresses are also specified in the recipient list, then both the individuals - as well as the specified addresses get the notification e-mail. If the recipient list - is empty, then only the individuals will receive e-mails. -

        \ No newline at end of file diff --git a/war/src/main/webapp/help/tasks/mailer/sendToindividuals_zh_TW.html b/war/src/main/webapp/help/tasks/mailer/sendToindividuals_zh_TW.html deleted file mode 100644 index 5cc2ce0edc..0000000000 --- a/war/src/main/webapp/help/tasks/mailer/sendToindividuals_zh_TW.html +++ /dev/null @@ -1,7 +0,0 @@ -
        - 選項啟用後,通知信會寄給有 Commit 變更,導致這次建置失敗的每一個人 - (假設是這些變更造成建置失敗)。 -

        - 如果有指定收件人清單,那些有嫌疑的人及指定的人都會收到通知郵件。 - 要是收件人清單是空的,就只有那些人會收到信。 -

        \ No newline at end of file diff --git a/war/src/main/webapp/help/tasks/mailer/smtpAuth.html b/war/src/main/webapp/help/tasks/mailer/smtpAuth.html deleted file mode 100644 index f16780ea8a..0000000000 --- a/war/src/main/webapp/help/tasks/mailer/smtpAuth.html +++ /dev/null @@ -1,4 +0,0 @@ -
        - Use SMTP authentication when sending out e-mails. If your environment requires - the use of SMTP authentication, specify its user name and the password here. -
        \ No newline at end of file diff --git a/war/src/main/webapp/help/tasks/mailer/smtpAuth_de.html b/war/src/main/webapp/help/tasks/mailer/smtpAuth_de.html deleted file mode 100644 index 1ce2e0ad1e..0000000000 --- a/war/src/main/webapp/help/tasks/mailer/smtpAuth_de.html +++ /dev/null @@ -1,4 +0,0 @@ -
        - Verwendet SMTP Authentifizierung beim Verschicken von E-Mails. Wenn Ihr E-Mail-Server - SMTP Authentifizierung verlangt, geben Sie hier Ihren Benutzernamen und Passwort an. -
        \ No newline at end of file diff --git a/war/src/main/webapp/help/tasks/mailer/smtpAuth_fr.html b/war/src/main/webapp/help/tasks/mailer/smtpAuth_fr.html deleted file mode 100644 index c28370169c..0000000000 --- a/war/src/main/webapp/help/tasks/mailer/smtpAuth_fr.html +++ /dev/null @@ -1,5 +0,0 @@ -
        - Cette option provoque l'authentification SMTP lors de l'envoi d'emails. - Si votre environnement nécessite l'utilisation de l'authentification SMTP, - spécifiez ici son nom d'utilisateur et mot de passe. -
        \ No newline at end of file diff --git a/war/src/main/webapp/help/tasks/mailer/smtpAuth_ja.html b/war/src/main/webapp/help/tasks/mailer/smtpAuth_ja.html deleted file mode 100644 index 6f225b14e8..0000000000 --- a/war/src/main/webapp/help/tasks/mailer/smtpAuth_ja.html +++ /dev/null @@ -1,4 +0,0 @@ -
        - メール送信時にSMTP認証を使用します。SMTP認証が必要な環境であれば、 - ユーザー名とパスワードを指定してください。 -
        \ No newline at end of file diff --git a/war/src/main/webapp/help/tasks/mailer/smtpAuth_nl.html b/war/src/main/webapp/help/tasks/mailer/smtpAuth_nl.html deleted file mode 100644 index 5a1d2a661d..0000000000 --- a/war/src/main/webapp/help/tasks/mailer/smtpAuth_nl.html +++ /dev/null @@ -1,4 +0,0 @@ -
        - Gebruikt SMTP authenticatie bij het uitsturen van e-mails. Gelieve, indien uw omgeving - SMTP authenticatie vereist, hier uw gebruikersnaam en paswoord op te geven. -
        \ No newline at end of file diff --git a/war/src/main/webapp/help/tasks/mailer/smtpAuth_pt_BR.html b/war/src/main/webapp/help/tasks/mailer/smtpAuth_pt_BR.html deleted file mode 100644 index 859ea68f24..0000000000 --- a/war/src/main/webapp/help/tasks/mailer/smtpAuth_pt_BR.html +++ /dev/null @@ -1,4 +0,0 @@ -
        - Usa autenticação SMTP quando enviar e-mails. Se seu ambiente requer - o uso de autenticação SMTP, especifique o usuário e senha aqui. -
        diff --git a/war/src/main/webapp/help/tasks/mailer/smtpAuth_ru.html b/war/src/main/webapp/help/tasks/mailer/smtpAuth_ru.html deleted file mode 100644 index 4074932364..0000000000 --- a/war/src/main/webapp/help/tasks/mailer/smtpAuth_ru.html +++ /dev/null @@ -1,4 +0,0 @@ -
        - Использовать аутентификацию SMTP при отправке почты. Если ваш сервер требует - аутентификации, укажите логин и пароль здесь. -
        \ No newline at end of file diff --git a/war/src/main/webapp/help/tasks/mailer/smtpAuth_tr.html b/war/src/main/webapp/help/tasks/mailer/smtpAuth_tr.html deleted file mode 100644 index 2bef640796..0000000000 --- a/war/src/main/webapp/help/tasks/mailer/smtpAuth_tr.html +++ /dev/null @@ -1,4 +0,0 @@ -
        - E-posta gönderilmesi esnasında SMTP doğrulaması kullanılır. Eğer ortamınız SMTP - doğrulaması kullanıyorsa, kullanıcı adı ve şifreyi burada belirtiniz. -
        \ No newline at end of file diff --git a/war/src/main/webapp/help/tasks/mailer/smtpAuth_zh_CN.html b/war/src/main/webapp/help/tasks/mailer/smtpAuth_zh_CN.html deleted file mode 100644 index 6fd8cc8a2c..0000000000 --- a/war/src/main/webapp/help/tasks/mailer/smtpAuth_zh_CN.html +++ /dev/null @@ -1,3 +0,0 @@ -
        - 当发送邮件时使用SMTP认证.如果你的环境需要使用SMTP认证,在这里指定其用户名和密码. -
        \ No newline at end of file diff --git a/war/src/main/webapp/help/tasks/mailer/smtpAuth_zh_TW.html b/war/src/main/webapp/help/tasks/mailer/smtpAuth_zh_TW.html deleted file mode 100644 index b7f19d1bfe..0000000000 --- a/war/src/main/webapp/help/tasks/mailer/smtpAuth_zh_TW.html +++ /dev/null @@ -1,3 +0,0 @@ -
        - 送出電子郵件時使用 SMTP 驗證。如果您的環境要求要 SMTP 驗證,請把使用者名稱及密碼設在這裡。 -
        \ No newline at end of file From 3befec39a3392f0bb6870c5361397b773027bb51 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 17 Dec 2013 12:13:44 -0500 Subject: [PATCH 42/49] optionalBlock.jelly should only set a default value for help when field is set. Otherwise Descriptor.getHelpFile(null) is called, which may produce a help page, but generally the wrong one. (entry.jelly was already correct, so just making it consistent.) --- core/src/main/resources/lib/form/optionalBlock.jelly | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/resources/lib/form/optionalBlock.jelly b/core/src/main/resources/lib/form/optionalBlock.jelly index a8595d7fcb..b4f1bb26f3 100644 --- a/core/src/main/resources/lib/form/optionalBlock.jelly +++ b/core/src/main/resources/lib/form/optionalBlock.jelly @@ -58,7 +58,7 @@ THE SOFTWARE. if present, the foldable section will not be grouped into a separate JSON object upon submission - + From 4364a58c0db552b86434b06a7bc912dfe0fc8b6a Mon Sep 17 00:00:00 2001 From: Alex Earl Date: Tue, 17 Dec 2013 12:30:09 -0700 Subject: [PATCH 43/49] Add note to class javadoc --- core/src/main/java/hudson/triggers/SCMTrigger.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/src/main/java/hudson/triggers/SCMTrigger.java b/core/src/main/java/hudson/triggers/SCMTrigger.java index 0bcea37220..8f1ea3ac08 100644 --- a/core/src/main/java/hudson/triggers/SCMTrigger.java +++ b/core/src/main/java/hudson/triggers/SCMTrigger.java @@ -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 { From 6c9ab145d33c1587979f54a327e27ce11c5210d0 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 17 Dec 2013 16:38:46 -0500 Subject: [PATCH 44/49] copyButton.js uses @include, so there is no need to explicitly include ZeroClipboard here too. --- core/src/main/resources/lib/layout/copyButton.jelly | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/resources/lib/layout/copyButton.jelly b/core/src/main/resources/lib/layout/copyButton.jelly index cd6e74ba1c..3d85c22be7 100644 --- a/core/src/main/resources/lib/layout/copyButton.jelly +++ b/core/src/main/resources/lib/layout/copyButton.jelly @@ -50,5 +50,5 @@ THE SOFTWARE. - + \ No newline at end of file From d81c2406a27cee80542dbaecae31ce1b04e0ab52 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 17 Dec 2013 18:55:29 -0500 Subject: [PATCH 45/49] Updated maven-plugin & mailer dependencies so that HelpLinkTest will pass. --- pom.xml | 2 +- test/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 6a117cd923..5e91e16fa2 100644 --- a/pom.xml +++ b/pom.xml @@ -94,7 +94,7 @@ THE SOFTWARE. jenkins-jira 1.7.4 - 2.0 + 2.1 none ${skipTests} diff --git a/test/pom.xml b/test/pom.xml index a10c7787af..f5e7cd91fd 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -79,7 +79,7 @@ THE SOFTWARE. org.jenkins-ci.plugins mailer - 1.5 + 1.8 org.jenkins-ci.plugins From 358fe7fe3a64fcb113caef608759c724f008a37e Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 18 Dec 2013 11:25:28 -0500 Subject: [PATCH 46/49] Extra trailing newline. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 8737be1df0..f8949fcd67 100644 --- a/README.md +++ b/README.md @@ -26,4 +26,3 @@ All about Jenkins CI can be found on our [website]. Follow us on Twitter @[jenki [GitHub]: https://github.com/jenkinsci/jenkins [website]: http://jenkins-ci.org [jenkinsci]: http://twitter.com/jenkinsci - From a6e01f77c6d3d72f7ac9e99ce061ce04dbf4b515 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 18 Dec 2013 13:39:18 -0500 Subject: [PATCH 47/49] [FIXED JENKINS-21078] Optimizing loadIdOnDisk. --- changelog.html | 3 ++ core/src/main/java/hudson/model/RunMap.java | 19 ++++----- .../model/lazy/AbstractLazyLoadRunMap.java | 42 +++++++++---------- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/changelog.html b/changelog.html index e20c5644f6..f3772de41c 100644 --- a/changelog.html +++ b/changelog.html @@ -61,6 +61,9 @@ Upcoming changes
      • Better robustness against XML deserialization errors. (issue 21024) +
      • + Minimizing disk I/O while loading the names of build records during Jenkins startup. + (issue 21078)
      • Avoiding serializing the owning build as part of a test result action, as this can lead to errors later. (issue 18410) diff --git a/core/src/main/java/hudson/model/RunMap.java b/core/src/main/java/hudson/model/RunMap.java index 7afdabbfbc..a7aa192124 100644 --- a/core/src/main/java/hudson/model/RunMap.java +++ b/core/src/main/java/hudson/model/RunMap.java @@ -194,24 +194,21 @@ public final class RunMap> extends AbstractLazyLoadRunMap 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; } }; diff --git a/core/src/main/java/jenkins/model/lazy/AbstractLazyLoadRunMap.java b/core/src/main/java/jenkins/model/lazy/AbstractLazyLoadRunMap.java index 92561a23a4..a0c50a67a3 100644 --- a/core/src/main/java/jenkins/model/lazy/AbstractLazyLoadRunMap.java +++ b/core/src/main/java/jenkins/model/lazy/AbstractLazyLoadRunMap.java @@ -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 extends AbstractMap 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(new ArrayList(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 buildDirs = new ArrayList(); + 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(buildDirs); list.sort(); numberOnDisk = list; } From 6c71a664b3f3427f975c965a0153b37409d921d5 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Wed, 18 Dec 2013 18:02:27 -0800 Subject: [PATCH 48/49] creating an RC branch --- changelog.html | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/changelog.html b/changelog.html index f3772de41c..399d17018c 100644 --- a/changelog.html +++ b/changelog.html @@ -54,6 +54,14 @@ Upcoming changes + + + - - -

        What's new in 1.544 (2013/12/15)

          From 168c50c4d3e37921f35f2644e24295f1c7e29cae Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Wed, 18 Dec 2013 18:02:32 -0800 Subject: [PATCH 49/49] the trunk is toward 1.546-SNAPSHOT --- cli/pom.xml | 2 +- core/pom.xml | 2 +- plugins/pom.xml | 8 ++++---- pom.xml | 2 +- test/pom.xml | 2 +- war/pom.xml | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 6328a2d6af..99efb2d72a 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ pom org.jenkins-ci.main - 1.545-SNAPSHOT + 1.546-SNAPSHOT cli diff --git a/core/pom.xml b/core/pom.xml index adae6bbacb..de95800900 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 1.545-SNAPSHOT + 1.546-SNAPSHOT ../pom.xml diff --git a/plugins/pom.xml b/plugins/pom.xml index fd0e915227..51f0dfa01f 100644 --- a/plugins/pom.xml +++ b/plugins/pom.xml @@ -11,7 +11,7 @@ org.jenkins-ci.plugins plugin Jenkins plugin POM - 1.545-SNAPSHOT + 1.546-SNAPSHOT pom