From b47f527ce9427218aecde544e0d5a196925cb892 Mon Sep 17 00:00:00 2001 From: laurence-h Date: Thu, 15 Nov 2012 17:27:29 +1100 Subject: [PATCH 01/25] [FIXED JENKINS-15576] Label's Load Statistics queue length based on label assigned to job rather than to item in build queue. --- changelog.html | 3 +++ core/src/main/java/hudson/model/LoadStatistics.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index f221bb5d55..05a14c4da5 100644 --- a/changelog.html +++ b/changelog.html @@ -67,6 +67,9 @@ Upcoming changes
  • Jenkins kicks off the wrong downstream builds for Maven. (issue 15367) +
  • + Label's Load Statistics queue length based on label assigned to job rather than to item in build queue. + (issue 15576) diff --git a/core/src/main/java/hudson/model/LoadStatistics.java b/core/src/main/java/hudson/model/LoadStatistics.java index 40185eb042..2fd7a571b0 100644 --- a/core/src/main/java/hudson/model/LoadStatistics.java +++ b/core/src/main/java/hudson/model/LoadStatistics.java @@ -230,7 +230,7 @@ public abstract class LoadStatistics { private int count(List bis, Label l) { int q=0; for (Queue.BuildableItem bi : bis) { - if(bi.task.getAssignedLabel()==l) + if(bi.getAssignedLabel()==l) q++; } return q; From c49420e622facb8cc98e5f4447c0fc8ad6660990 Mon Sep 17 00:00:00 2001 From: laurence-h Date: Tue, 20 Nov 2012 15:40:19 +1100 Subject: [PATCH 02/25] Test cases for [FIXED JENKINS-15576] --- changelog.html | 3 + .../java/hudson/model/LoadStatistics.java | 2 +- test/pom.xml | 2 + .../LabelLoadStatisticsQueueLengthTest.java | 238 ++++++++++++++++++ 4 files changed, 244 insertions(+), 1 deletion(-) create mode 100644 test/src/test/java/hudson/model/LabelLoadStatisticsQueueLengthTest.java diff --git a/changelog.html b/changelog.html index f221bb5d55..05a14c4da5 100644 --- a/changelog.html +++ b/changelog.html @@ -67,6 +67,9 @@ Upcoming changes
  • Jenkins kicks off the wrong downstream builds for Maven. (issue 15367) +
  • + Label's Load Statistics queue length based on label assigned to job rather than to item in build queue. + (issue 15576) diff --git a/core/src/main/java/hudson/model/LoadStatistics.java b/core/src/main/java/hudson/model/LoadStatistics.java index 40185eb042..2fd7a571b0 100644 --- a/core/src/main/java/hudson/model/LoadStatistics.java +++ b/core/src/main/java/hudson/model/LoadStatistics.java @@ -230,7 +230,7 @@ public abstract class LoadStatistics { private int count(List bis, Label l) { int q=0; for (Queue.BuildableItem bi : bis) { - if(bi.task.getAssignedLabel()==l) + if(bi.getAssignedLabel()==l) q++; } return q; diff --git a/test/pom.xml b/test/pom.xml index 9715f24259..40514d23b8 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -246,6 +246,7 @@ THE SOFTWARE. **/UseRecipesWithJenkinsRuleTest.java hudson/model/CauseTest.java hudson/model/UpdateSiteTest.java + hudson/model/LabelLoadStatisticsQueueLengthTest.java hudson/triggers/TriggerStartTest.java @@ -292,6 +293,7 @@ THE SOFTWARE. org/jvnet/hudson/main/UseRecipesWithJenkinsRuleTest.class hudson/model/CauseTest.class hudson/model/UpdateSiteTest.class + hudson/model/LabelLoadStatisticsQueueLengthTest.java hudson/triggers/TriggerStartTest.class diff --git a/test/src/test/java/hudson/model/LabelLoadStatisticsQueueLengthTest.java b/test/src/test/java/hudson/model/LabelLoadStatisticsQueueLengthTest.java new file mode 100644 index 0000000000..0d65d9f8be --- /dev/null +++ b/test/src/test/java/hudson/model/LabelLoadStatisticsQueueLengthTest.java @@ -0,0 +1,238 @@ +package hudson.model; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import hudson.model.Descriptor.FormException; +import hudson.model.LoadStatistics.LoadStatisticsUpdater; +import hudson.model.MultiStageTimeSeries.TimeScale; +import hudson.model.Node.Mode; +import hudson.model.Queue.WaitingItem; +import hudson.model.labels.LabelAssignmentAction; +import hudson.model.queue.SubTask; +import hudson.slaves.DumbSlave; +import hudson.slaves.NodeProperty; +import hudson.slaves.RetentionStrategy; + +import java.io.IOException; +import java.util.Collections; + +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.jvnet.hudson.test.Bug; +import org.jvnet.hudson.test.JenkinsRule; + +/** + * Test that a {@link Label}'s {@link LoadStatistics#queueLength} correctly + * reflects the queued builds. + */ +public class LabelLoadStatisticsQueueLengthTest { + private static final String LABEL_STRING = LabelLoadStatisticsQueueLengthTest.class + .getSimpleName(); + + private static final String ALT_LABEL_STRING = LABEL_STRING + "alt"; + + private static final String PROJECT_NAME = LabelLoadStatisticsQueueLengthTest.class + .getSimpleName(); + + private static final String PARAMETER_NAME = "parameter"; + + private static final Cause CAUSE = new Cause() { + @Override + public String getShortDescription() { + return "Build caused by test."; + } + }; + + @Rule + public JenkinsRule j = new JenkinsRule(); + + /** + * Setup + */ + @Before + public void createNodeWithLabels() throws IOException, FormException { + // Node with this test's labels is required in order for the labels to + // be considered valid. + DumbSlave node = new DumbSlave( + LabelLoadStatisticsQueueLengthTest.class.getSimpleName(), "", + "", "1", Mode.NORMAL, LABEL_STRING + " " + ALT_LABEL_STRING, + null, RetentionStrategy.NOOP, + Collections.> emptyList()); + j.getInstance().addNode(node); + } + + /** + * Teardown + */ + @After + public void clearQueue() { + j.getInstance().getQueue().clear(); + } + + /** + * Verify that when a {@link Label} is assigned to a queued build using a + * {@link LabelAssignmentAction}, that label's + * {@link LoadStatistics#queueLength} reflects the number of items in the + * queue, and continues to do so if the {@link Project}'s label is changed. + */ + @Bug(15576) + @Test + public void queueLengthReflectsBuildableItemsAssignedLabel() + throws Exception { + final Label label = Label.get(LABEL_STRING); + + FreeStyleProject project = createTestProject(); + + // Before queueing the builds the rolling queue length should be 0. + assertTrue( + "Initially the rolling queue length for the label is 0.", + label.loadStatistics.queueLength.getLatest(TimeScale.SEC10) == 0f); + + // Add the job to the build queue several times with an assigned label. + for (int i = 0; i < 3; i++) { + project.scheduleBuild(0, CAUSE, new LabelAssignmentActionImpl(), + new ParametersAction(new StringParameterValue( + PARAMETER_NAME, String.valueOf(i)))); + } + + // Verify that the real queue length is 3. + assertEquals("The job is queued as often as it was scheduled.", 3, j + .getInstance().getQueue().getItems(project).size()); + + maintainQueueAndForceRunOfLoadStatisticsUpdater(project); + + float labelQueueLength = label.loadStatistics.queueLength + .getLatest(TimeScale.SEC10); + assertTrue( + "After LoadStatisticsUpdater runs, the queue length load statistic for the label is greater than 0.", + labelQueueLength > 0f); + + // Assign an alternate label to the project and update the load stats. + project.setAssignedLabel(Label.get(LABEL_STRING + "alt")); + maintainQueueAndForceRunOfLoadStatisticsUpdater(project); + + float labelQueueLengthNew = label.loadStatistics.queueLength + .getLatest(TimeScale.SEC10); + assertTrue( + "After assigning an alternate label to the job, the queue length load statistic for the queued builds should not decrease.", + labelQueueLengthNew >= labelQueueLength); + } + + /** + * Verify that when a {@link Label} is assigned to a {@link Project}, that + * label's {@link LoadStatistics#queueLength} reflects the number of items + * in the queue scheduled for that project, and updates if the project's + * label is changed. + */ + @Test + public void queueLengthReflectsJobsAssignedLabel() throws Exception { + final Label label = Label.get(LABEL_STRING); + final Label altLabel = Label.get(ALT_LABEL_STRING); + + FreeStyleProject project = createTestProject(); + // Assign a label to the job. + project.setAssignedLabel(label); + + // Before queueing the builds the rolling queue lengths should be 0. + assertTrue( + "Initially the rolling queue length for the label is 0.", + label.loadStatistics.queueLength.getLatest(TimeScale.SEC10) == 0f); + assertTrue( + "Initially the rolling queue length for the alt label is 0.", + altLabel.loadStatistics.queueLength.getLatest(TimeScale.SEC10) == 0f); + + // Add the job to the build queue several times. + for (int i = 0; i < 3; i++) { + project.scheduleBuild(0, CAUSE, + new ParametersAction(new StringParameterValue( + PARAMETER_NAME, String.valueOf(i)))); + } + + // Verify that the real queue length is 3. + assertEquals("The job is queued as often as it was scheduled.", 3, j + .getInstance().getQueue().getItems(project).size()); + + maintainQueueAndForceRunOfLoadStatisticsUpdater(project); + + float labelQueueLength = label.loadStatistics.queueLength + .getLatest(TimeScale.SEC10); + assertTrue( + "After LoadStatisticsUpdater runs, the queue length load statistic for the label is greater than 0.", + labelQueueLength > 0f); + + // Assign an alternate label to the job and update the load stats. + project.setAssignedLabel(altLabel); + maintainQueueAndForceRunOfLoadStatisticsUpdater(project); + + float labelQueueLengthNew = label.loadStatistics.queueLength + .getLatest(TimeScale.SEC10); + assertTrue( + "After assigning an alternate label to the job, the queue length load statistic for the queued builds should decrease.", + labelQueueLengthNew < labelQueueLength); + + float altLabelQueueLength = altLabel.loadStatistics.queueLength + .getLatest(TimeScale.SEC10); + assertTrue( + "After assigning an alternate label to the job, the queue length load statistic for the alternate label should be greater than 0.", + altLabelQueueLength > 0f); + } + + private FreeStyleProject createTestProject() throws IOException { + FreeStyleProject project = j.createFreeStyleProject(PROJECT_NAME); + // In order to queue multiple builds of the job it needs to be + // parameterised. + project.addProperty(new ParametersDefinitionProperty( + new StringParameterDefinition(PARAMETER_NAME, "0"))); + // Prevent builds from being queued as blocked by allowing concurrent + // builds. + project.setConcurrentBuild(true); + return project; + } + + private void maintainQueueAndForceRunOfLoadStatisticsUpdater( + FreeStyleProject project) throws InterruptedException { + Queue queue = j.getInstance().getQueue(); + + // ensure the queued items are in the right state, i.e. buildable rather + // than waiting + int count = 0; + while (queue.getItem(project) instanceof WaitingItem && ++count < 100) { + queue.maintain(); + Thread.sleep(10); + } + + assertTrue( + "After waiting there are buildable items in the build queue.", + queue.getBuildableItems().size() > 0); + + // create a LoadStatisticsUpdater, and run it in order to update the + // load stats for all the labels + LoadStatisticsUpdater updater = new LoadStatisticsUpdater(); + updater.doRun(); + } + + private static class LabelAssignmentActionImpl implements + LabelAssignmentAction { + @Override + public String getIconFileName() { + return null; + } + + @Override + public String getDisplayName() { + return LABEL_STRING + " LabelAssignmentAction"; + } + + @Override + public String getUrlName() { + return null; + } + + @Override + public Label getAssignedLabel(SubTask p_task) { + return Label.get(LABEL_STRING); + } + } +} From 89e54ba9ffa4188f72da0a3ba27cdcca1c649ffc Mon Sep 17 00:00:00 2001 From: Laurence Date: Wed, 2 Oct 2013 11:01:07 +1000 Subject: [PATCH 03/25] Small comment changes in LabelLoadStatisticsQueueLengthTest --- .../hudson/model/LabelLoadStatisticsQueueLengthTest.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/src/test/java/hudson/model/LabelLoadStatisticsQueueLengthTest.java b/test/src/test/java/hudson/model/LabelLoadStatisticsQueueLengthTest.java index 0d65d9f8be..caa882828a 100644 --- a/test/src/test/java/hudson/model/LabelLoadStatisticsQueueLengthTest.java +++ b/test/src/test/java/hudson/model/LabelLoadStatisticsQueueLengthTest.java @@ -82,6 +82,7 @@ public class LabelLoadStatisticsQueueLengthTest { public void queueLengthReflectsBuildableItemsAssignedLabel() throws Exception { final Label label = Label.get(LABEL_STRING); + final Label altLabel = Label.get(ALT_LABEL_STRING); FreeStyleProject project = createTestProject(); @@ -110,9 +111,10 @@ public class LabelLoadStatisticsQueueLengthTest { labelQueueLength > 0f); // Assign an alternate label to the project and update the load stats. - project.setAssignedLabel(Label.get(LABEL_STRING + "alt")); + project.setAssignedLabel(altLabel); maintainQueueAndForceRunOfLoadStatisticsUpdater(project); + // Verify that the queue length load stat continues to reflect the labels assigned to the items in the queue. float labelQueueLengthNew = label.loadStatistics.queueLength .getLatest(TimeScale.SEC10); assertTrue( @@ -166,6 +168,7 @@ public class LabelLoadStatisticsQueueLengthTest { project.setAssignedLabel(altLabel); maintainQueueAndForceRunOfLoadStatisticsUpdater(project); + // Verify that the queue length load stats of the labels reflect the newly project's newly assigned label. float labelQueueLengthNew = label.loadStatistics.queueLength .getLatest(TimeScale.SEC10); assertTrue( From 67ac47af0709dde6297dffeb210b03d8b65f6033 Mon Sep 17 00:00:00 2001 From: David Ruhmann Date: Fri, 15 Aug 2014 12:21:15 -0500 Subject: [PATCH 04/25] [FIXED JENKINS-7478] Create Line Ending Conversion utility to convert scripts to proper OS line ending type. Tests included. --- .../src/main/java/hudson/tasks/BatchFile.java | 10 ++- core/src/main/java/hudson/tasks/Shell.java | 34 +++------- .../tools/AbstractCommandInstaller.java | 15 +---- .../hudson/tools/BatchCommandInstaller.java | 8 ++- .../java/hudson/tools/CommandInstaller.java | 8 ++- .../hudson/util/LineEndingConversion.java | 66 +++++++++++++++++++ .../test/java/hudson/tasks/BatchFileTest.java | 30 +++++++++ .../src/test/java/hudson/tasks/ShellTest.java | 43 +++++++++--- .../tools/BatchCommandInstallerTest.java | 22 +++++++ .../hudson/tools/CommandInstallerTest.java | 22 +++++++ .../hudson/util/LineEndingConversionTest.java | 28 ++++++++ 11 files changed, 233 insertions(+), 53 deletions(-) create mode 100644 core/src/main/java/hudson/util/LineEndingConversion.java create mode 100644 test/src/test/java/hudson/tasks/BatchFileTest.java create mode 100644 test/src/test/java/hudson/tools/BatchCommandInstallerTest.java create mode 100644 test/src/test/java/hudson/tools/CommandInstallerTest.java create mode 100644 test/src/test/java/hudson/util/LineEndingConversionTest.java diff --git a/core/src/main/java/hudson/tasks/BatchFile.java b/core/src/main/java/hudson/tasks/BatchFile.java index 0943e9147f..b2506474be 100644 --- a/core/src/main/java/hudson/tasks/BatchFile.java +++ b/core/src/main/java/hudson/tasks/BatchFile.java @@ -26,9 +26,11 @@ package hudson.tasks; import hudson.FilePath; import hudson.Extension; import hudson.model.AbstractProject; +import hudson.util.LineEndingConversion; import net.sf.json.JSONObject; import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.StaplerRequest; +import java.io.ObjectStreamException; /** * Executes commands by using Windows batch file. @@ -38,7 +40,7 @@ import org.kohsuke.stapler.StaplerRequest; public class BatchFile extends CommandInterpreter { @DataBoundConstructor public BatchFile(String command) { - super(command); + super(LineEndingConversion.convertEOL(command, LineEndingConversion.EOLType.Windows)); } public String[] buildCommandLine(FilePath script) { @@ -46,13 +48,17 @@ public class BatchFile extends CommandInterpreter { } protected String getContents() { - return command+"\r\nexit %ERRORLEVEL%"; + return LineEndingConversion.convertEOL(command+"\r\nexit %ERRORLEVEL%",LineEndingConversion.EOLType.Windows); } protected String getFileExtension() { return ".bat"; } + private Object readResolve() throws ObjectStreamException { + return new BatchFile(command); + } + @Extension public static final class DescriptorImpl extends BuildStepDescriptor { @Override diff --git a/core/src/main/java/hudson/tasks/Shell.java b/core/src/main/java/hudson/tasks/Shell.java index 5a3a2053db..17ce0b8819 100644 --- a/core/src/main/java/hudson/tasks/Shell.java +++ b/core/src/main/java/hudson/tasks/Shell.java @@ -32,6 +32,8 @@ import hudson.remoting.Callable; import hudson.remoting.VirtualChannel; import hudson.util.FormValidation; import java.io.IOException; +import java.io.ObjectStreamException; +import hudson.util.LineEndingConversion; import net.sf.json.JSONObject; import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.StaplerRequest; @@ -50,29 +52,7 @@ import java.util.logging.Logger; public class Shell extends CommandInterpreter { @DataBoundConstructor public Shell(String command) { - super(fixCrLf(command)); - } - - /** - * Fix CR/LF and always make it Unix style. - */ - private static String fixCrLf(String s) { - // eliminate CR - int idx; - while((idx=s.indexOf("\r\n"))!=-1) - s = s.substring(0,idx)+s.substring(idx+1); - - //// add CR back if this is for Windows - //if(isWindows()) { - // idx=0; - // while(true) { - // idx = s.indexOf('\n',idx); - // if(idx==-1) break; - // s = s.substring(0,idx)+'\r'+s.substring(idx); - // idx+=2; - // } - //} - return s; + super(LineEndingConversion.convertEOL(command, LineEndingConversion.EOLType.Unix)); } /** @@ -80,7 +60,7 @@ public class Shell extends CommandInterpreter { * makes the shell think the file is a binary file and not a script. Adding * a leading line feed works around this problem. */ - private static String addCrForNonASCII(String s) { + private static String addLineFeedForNonASCII(String s) { if(!s.startsWith("#!")) { if (s.indexOf('\n')!=0) { return "\n" + s; @@ -105,7 +85,7 @@ public class Shell extends CommandInterpreter { } protected String getContents() { - return addCrForNonASCII(fixCrLf(command)); + return addLineFeedForNonASCII(LineEndingConversion.convertEOL(command,LineEndingConversion.EOLType.Unix)); } protected String getFileExtension() { @@ -117,6 +97,10 @@ public class Shell extends CommandInterpreter { return (DescriptorImpl)super.getDescriptor(); } + private Object readResolve() throws ObjectStreamException { + return new Shell(command); + } + @Extension public static class DescriptorImpl extends BuildStepDescriptor { /** diff --git a/core/src/main/java/hudson/tools/AbstractCommandInstaller.java b/core/src/main/java/hudson/tools/AbstractCommandInstaller.java index 07d91c6c0c..18431fcda1 100644 --- a/core/src/main/java/hudson/tools/AbstractCommandInstaller.java +++ b/core/src/main/java/hudson/tools/AbstractCommandInstaller.java @@ -48,7 +48,7 @@ public abstract class AbstractCommandInstaller extends ToolInstaller { public AbstractCommandInstaller(String label, String command, String toolHome) { super(label); - this.command = fixCrLf(command); + this.command = command; this.toolHome = toolHome; } @@ -84,19 +84,6 @@ public abstract class AbstractCommandInstaller extends ToolInstaller { return dir.child(getToolHome()); } - /** - * Fix CR/LF and always make it Unix style. - */ - //TODO: replace by a Windows style - private static String fixCrLf(String s) { - // eliminate CR - int idx; - while ((idx = s.indexOf("\r\n")) != -1) { - s = s.substring(0, idx) + s.substring(idx + 1); - } - return s; - } - public static abstract class Descriptor extends ToolInstallerDescriptor { diff --git a/core/src/main/java/hudson/tools/BatchCommandInstaller.java b/core/src/main/java/hudson/tools/BatchCommandInstaller.java index 415dbb700f..2085fe7fa0 100644 --- a/core/src/main/java/hudson/tools/BatchCommandInstaller.java +++ b/core/src/main/java/hudson/tools/BatchCommandInstaller.java @@ -26,7 +26,9 @@ package hudson.tools; import hudson.Extension; import hudson.FilePath; +import hudson.util.LineEndingConversion; import org.kohsuke.stapler.DataBoundConstructor; +import java.io.ObjectStreamException; /** * Installs tool via script execution of Batch script. @@ -37,7 +39,7 @@ public class BatchCommandInstaller extends AbstractCommandInstaller { @DataBoundConstructor public BatchCommandInstaller(String label, String command, String toolHome) { - super(label, command, toolHome); + super(label, LineEndingConversion.convertEOL(command, LineEndingConversion.EOLType.Windows), toolHome); } @Override @@ -50,6 +52,10 @@ public class BatchCommandInstaller extends AbstractCommandInstaller { String[] cmd = {"cmd", "/c", "call", script.getRemote()}; return cmd; } + + private Object readResolve() throws ObjectStreamException { + return new BatchCommandInstaller(getLabel(), getCommand(), getToolHome()); + } @Extension public static class DescriptorImpl extends Descriptor { diff --git a/core/src/main/java/hudson/tools/CommandInstaller.java b/core/src/main/java/hudson/tools/CommandInstaller.java index b02137f0f5..6f2506dd04 100644 --- a/core/src/main/java/hudson/tools/CommandInstaller.java +++ b/core/src/main/java/hudson/tools/CommandInstaller.java @@ -26,7 +26,9 @@ package hudson.tools; import hudson.Extension; import hudson.FilePath; +import hudson.util.LineEndingConversion; import org.kohsuke.stapler.DataBoundConstructor; +import java.io.ObjectStreamException; /** * Installs a tool by running an arbitrary shell command. @@ -36,7 +38,7 @@ public class CommandInstaller extends AbstractCommandInstaller { @DataBoundConstructor public CommandInstaller(String label, String command, String toolHome) { - super(label, command, toolHome); + super(label, LineEndingConversion.convertEOL(command, LineEndingConversion.EOLType.Unix), toolHome); } @Override @@ -50,6 +52,10 @@ public class CommandInstaller extends AbstractCommandInstaller { return cmd; } + private Object readResolve() throws ObjectStreamException { + return new CommandInstaller(getLabel(), getCommand(), getToolHome()); + } + @Extension public static class DescriptorImpl extends Descriptor { diff --git a/core/src/main/java/hudson/util/LineEndingConversion.java b/core/src/main/java/hudson/util/LineEndingConversion.java new file mode 100644 index 0000000000..744ff4a4ea --- /dev/null +++ b/core/src/main/java/hudson/util/LineEndingConversion.java @@ -0,0 +1,66 @@ +package hudson.util; + +/** + * Converts line endings of a string. + * + * @since TODO + * @author David Ruhmann + */ +public class LineEndingConversion { + + /** + * Supported line ending types for conversion + */ + public enum EOLType { + CR, + CRLF, + LF, + LFCR, + Mac, + Unix, + Windows + } + + /** + * Convert line endings of a string to the given type. Default to Unix type. + * + * @param input + * The string containing line endings to be converted. + * @param type + * Type of line endings to convert the string into. + * @return + * String updated with the new line endings or null if given null. + */ + public static String convertEOL(String input, EOLType type) { + if (null == input || 0 == input.length()) { + return input; + } + // Convert line endings to Unix LF, + // which also sets up the string for other conversions + input = input.replace("\r\n","\n"); + input = input.replace("\r","\n"); + switch (type) { + case CR: + case Mac: + // Convert line endings to CR + input = input.replace("\n", "\r"); + break; + case CRLF: + case Windows: + // Convert line endings to Windows CR/LF + input = input.replace("\n", "\r\n"); + break; + default: + case LF: + case Unix: + // Conversion already completed + return input; + case LFCR: + // Convert line endings to LF/CR + input = input.replace("\n", "\n\r"); + break; + } + return input; + } +} + diff --git a/test/src/test/java/hudson/tasks/BatchFileTest.java b/test/src/test/java/hudson/tasks/BatchFileTest.java new file mode 100644 index 0000000000..8cc16fd10a --- /dev/null +++ b/test/src/test/java/hudson/tasks/BatchFileTest.java @@ -0,0 +1,30 @@ +package hudson.tasks; + +import org.junit.Rule; +import org.junit.Test; +import org.jvnet.hudson.test.Issue; +import org.jvnet.hudson.test.JenkinsRule; + +/** + * Tests for the BatchFile tasks class. + * + * @author David Ruhmann + */ +public class BatchFileTest { + + @Rule + public JenkinsRule rule = new JenkinsRule(); + + @Issue("JENKINS-7478") + @Test + public void validateBatchFileCommandEOL() throws Exception { + BatchFile obj = new BatchFile("echo A\necho B\recho C"); + rule.assertStringContains(obj.getCommand(), "echo A\r\necho B\r\necho C"); + } + + @Test + public void validateBatchFileContents() throws Exception { + BatchFile obj = new BatchFile("echo A\necho B\recho C"); + rule.assertStringContains(obj.getContents(), "echo A\r\necho B\r\necho C\r\nexit %ERRORLEVEL%"); + } +} diff --git a/test/src/test/java/hudson/tasks/ShellTest.java b/test/src/test/java/hudson/tasks/ShellTest.java index e1e0d7d867..8aadb4f4ba 100644 --- a/test/src/test/java/hudson/tasks/ShellTest.java +++ b/test/src/test/java/hudson/tasks/ShellTest.java @@ -7,7 +7,6 @@ import hudson.model.FreeStyleBuild; import hudson.model.FreeStyleProject; import org.apache.commons.io.FileUtils; import org.jvnet.hudson.test.FakeLauncher; -import org.jvnet.hudson.test.HudsonTestCase; import org.jvnet.hudson.test.PretendSlave; import java.io.File; @@ -15,23 +14,47 @@ import java.io.IOException; import java.io.PrintStream; import java.util.List; +import org.junit.Assert; +import org.junit.Rule; +import org.junit.Test; +import org.jvnet.hudson.test.JenkinsRule; + /** + * Tests for the Shell tasks class + * * @author Kohsuke Kawaguchi */ -public class ShellTest extends HudsonTestCase { +public class ShellTest { + + @Rule + public JenkinsRule rule = new JenkinsRule(); + + @Test + public void validateShellCommandEOL() throws Exception { + Shell obj = new Shell("echo A\r\necho B\recho C"); + rule.assertStringContains(obj.getCommand(), "echo A\necho B\necho C"); + } + + @Test + public void validateShellContents() throws Exception { + Shell obj = new Shell("echo A\r\necho B\recho C"); + rule.assertStringContains(obj.getContents(), "\necho A\necho B\necho C"); + } + + @Test public void testBasic() throws Exception { // If we're on Windows, don't bother doing this. if (Functions.isWindows()) return; // TODO: define a FakeLauncher implementation with easymock so that this kind of assertions can be simplified. - PretendSlave s = createPretendSlave(new FakeLauncher() { + PretendSlave s = rule.createPretendSlave(new FakeLauncher() { public Proc onLaunch(ProcStarter p) throws IOException { // test the command line argument. List cmds = p.cmds(); - assertEquals("/bin/sh",cmds.get(0)); - assertEquals("-xe",cmds.get(1)); - assertTrue(new File(cmds.get(2)).exists()); + rule.assertStringContains("/bin/sh",cmds.get(0)); + rule.assertStringContains("-xe",cmds.get(1)); + Assert.assertTrue(new File(cmds.get(2)).exists()); // fake the execution PrintStream ps = new PrintStream(p.stdout()); @@ -41,13 +64,13 @@ public class ShellTest extends HudsonTestCase { return new FinishedProc(0); } }); - FreeStyleProject p = createFreeStyleProject(); + FreeStyleProject p = rule.createFreeStyleProject(); p.getBuildersList().add(new Shell("echo abc")); p.setAssignedNode(s); - FreeStyleBuild b = assertBuildStatusSuccess(p.scheduleBuild2(0).get()); + FreeStyleBuild b = rule.assertBuildStatusSuccess(p.scheduleBuild2(0).get()); - assertEquals(1,s.numLaunch); - assertTrue(FileUtils.readFileToString(b.getLogFile()).contains("Hudson was here")); + Assert.assertEquals(1,s.numLaunch); + Assert.assertTrue(FileUtils.readFileToString(b.getLogFile()).contains("Hudson was here")); } } diff --git a/test/src/test/java/hudson/tools/BatchCommandInstallerTest.java b/test/src/test/java/hudson/tools/BatchCommandInstallerTest.java new file mode 100644 index 0000000000..e14a90b405 --- /dev/null +++ b/test/src/test/java/hudson/tools/BatchCommandInstallerTest.java @@ -0,0 +1,22 @@ +package hudson.tools; + +import org.junit.Rule; +import org.junit.Test; +import org.jvnet.hudson.test.JenkinsRule; + +/** + * Tests for the BatchCommandInstaller tools class. + * + * @author David Ruhmann + */ +public class BatchCommandInstallerTest { + + @Rule + public JenkinsRule rule = new JenkinsRule(); + + @Test + public void validateBatchCommandInstallerCommandEOL() throws Exception { + BatchCommandInstaller obj = new BatchCommandInstaller("", "echo A\necho B\recho C", ""); + rule.assertStringContains(obj.getCommand(), "echo A\r\necho B\r\necho C"); + } +} diff --git a/test/src/test/java/hudson/tools/CommandInstallerTest.java b/test/src/test/java/hudson/tools/CommandInstallerTest.java new file mode 100644 index 0000000000..7a58c1ec8c --- /dev/null +++ b/test/src/test/java/hudson/tools/CommandInstallerTest.java @@ -0,0 +1,22 @@ +package hudson.tools; + +import org.junit.Rule; +import org.junit.Test; +import org.jvnet.hudson.test.JenkinsRule; + +/** + * Tests for the CommandInstaller tools class. + * + * @author David Ruhmann + */ +public class CommandInstallerTest { + + @Rule + public JenkinsRule rule = new JenkinsRule(); + + @Test + public void validateCommandInstallerCommandEOL() throws Exception { + CommandInstaller obj = new CommandInstaller("", "echo A\r\necho B\recho C", ""); + rule.assertStringContains(obj.getCommand(), "echo A\necho B\necho C"); + } +} diff --git a/test/src/test/java/hudson/util/LineEndingConversionTest.java b/test/src/test/java/hudson/util/LineEndingConversionTest.java new file mode 100644 index 0000000000..66773fbbb9 --- /dev/null +++ b/test/src/test/java/hudson/util/LineEndingConversionTest.java @@ -0,0 +1,28 @@ +package hudson.util; + +import org.junit.Rule; +import org.junit.Test; +import org.jvnet.hudson.test.Issue; +import org.jvnet.hudson.test.JenkinsRule; + +/** + * Tests for the LineEndingConversion util class. + * + * @author David Ruhmann + */ +public class LineEndingConversionTest { + + @Rule + public JenkinsRule rule = new JenkinsRule(); + + @Issue("JENKINS-7478") + @Test + public void validateWindowsEOL() throws Exception { + rule.assertStringContains(LineEndingConversion.convertEOL("echo A\necho B\recho C", LineEndingConversion.EOLType.Windows), "echo A\r\necho B\r\necho C"); + } + + @Test + public void validateUnixEOL() throws Exception { + rule.assertStringContains(LineEndingConversion.convertEOL("echo A\r\necho B\recho C", LineEndingConversion.EOLType.Unix), "echo A\necho B\necho C"); + } +} From 259f5e1780a68a76f5ca47f8e5689775e7013a2f Mon Sep 17 00:00:00 2001 From: Dominique Date: Tue, 9 Sep 2014 21:25:10 -0400 Subject: [PATCH 05/25] Updating javadoc of Plugin, LabelAtomProperty, GlobalConfiguration with my observations from working on my plugin --- core/src/main/java/hudson/Plugin.java | 2 +- .../model/labels/LabelAtomProperty.java | 11 +++++++++ .../jenkins/model/GlobalConfiguration.java | 23 ++++++++++++++----- 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/hudson/Plugin.java b/core/src/main/java/hudson/Plugin.java index 20f671e8dc..0c08ecb35b 100644 --- a/core/src/main/java/hudson/Plugin.java +++ b/core/src/main/java/hudson/Plugin.java @@ -48,7 +48,7 @@ import com.thoughtworks.xstream.XStream; * Base class of Hudson plugin. * *

    - * A plugin needs to derive from this class. + * A plugin may derive from this class. * *

    * One instance of a plugin is created by Hudson, and used as the entry point diff --git a/core/src/main/java/hudson/model/labels/LabelAtomProperty.java b/core/src/main/java/hudson/model/labels/LabelAtomProperty.java index e0dfd53259..41a1d7189b 100644 --- a/core/src/main/java/hudson/model/labels/LabelAtomProperty.java +++ b/core/src/main/java/hudson/model/labels/LabelAtomProperty.java @@ -40,6 +40,17 @@ import java.util.Collections; * Plugins can contribute this extension point to add additional data or UI actions to {@link LabelAtom}. * {@link LabelAtomProperty}s show up in the configuration screen of a label, and they are persisted * with the {@link LabelAtom} object. + * + *

    Implementation hints

    + *
      + *
    • extend this class and define a static inner class extending {@link hudson.model.labels.LabelAtomPropertyDescriptor}
    • + *
    • in the inner class override getDisplayName(). This function returns the name of the option shown in the label + * configuration page to activate your extension
    • + *
    • if you need additional parameters in this page when activating your extension, provide a config.jelly file
    • + *
    • when the user saves the label configuration page with your extension activated, Jenkins calls the corresponding + * {@link org.kohsuke.stapler.DataBoundConstructor}-annotated constructor in your LabelAtomProperty subclass
    • + *
    • override the getActions() function to return your additional {@link hudson.model.Action}(s)
    • + *
    * * @author Kohsuke Kawaguchi * @since 1.373 diff --git a/core/src/main/java/jenkins/model/GlobalConfiguration.java b/core/src/main/java/jenkins/model/GlobalConfiguration.java index b6e873f952..92eabc4ea7 100644 --- a/core/src/main/java/jenkins/model/GlobalConfiguration.java +++ b/core/src/main/java/jenkins/model/GlobalConfiguration.java @@ -6,17 +6,28 @@ import hudson.model.Describable; import hudson.model.Descriptor; /** - * Convenient base class for extensions that contributes to the system configuration page but nothing else. + * Convenient base class for extensions that contributes to the system configuration page but nothing + * else, or to manage the global configuration of a plugin implementing several extension points. * *

    - * All {@link Descriptor}s are capable of contributing fragment to the system config page, so - * this extension point is is really only for those who don't want to contribute anything else. - * If you are implementing other extension points and that would like to expose some global configuration, - * you can do so with global.groovy from your {@link Descriptor} instance. + * All {@link Descriptor}s are capable of contributing fragment to the system config page. If you are + * implementing other extension points that need to expose some global configuration, you can do so + * with global.groovy or global.jelly from your {@link Descriptor} instance. However + * each global.* file will appear as its own section in the global configuration page. + * + *

    + * An option to present a single section for your plugin in the Jenkins global configuration page is + * to use this class to manage the configuration for your plugin and its extension points. To access + * properties defined in your GlobalConfiguration subclass, here are two possibilities: + *

    • @{@link javax.inject.Inject} into your other {@link hudson.Extension}s (so this does not work + * for classes not annotated with {@link hudson.Extension})
    • + *
    • access it via a call to GlobalConfiguration.all().get(<your GlobalConfiguration subclass>.class) + *
    * *

    Views

    *

    - * Subtypes of this class should define config.groovy that gets pulled into the system configuration page. + * Subtypes of this class should define a config.groovy file or config.jelly file + * that gets pulled into the system configuration page. * * * @author Kohsuke Kawaguchi From fb547c127ec89649997649254c4138f2299dfdce Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 14 Sep 2014 17:56:14 -0700 Subject: [PATCH 06/25] the trunk is toward 1.582-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 2237c4a533..01b2dc12af 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ pom org.jenkins-ci.main - 1.581-SNAPSHOT + 1.582-SNAPSHOT cli diff --git a/core/pom.xml b/core/pom.xml index cc9cddc1dc..8601914aa7 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 1.581-SNAPSHOT + 1.582-SNAPSHOT ../pom.xml diff --git a/plugins/pom.xml b/plugins/pom.xml index 043dda4b07..1ad16ab63d 100644 --- a/plugins/pom.xml +++ b/plugins/pom.xml @@ -11,7 +11,7 @@ org.jenkins-ci.plugins plugin Jenkins plugin POM - 1.581-SNAPSHOT + 1.582-SNAPSHOT pom

    diff --git a/pom.xml b/pom.xml index 33d220e55c..be8e956e54 100644 --- a/pom.xml +++ b/pom.xml @@ -173,7 +173,7 @@ THE SOFTWARE. org.jenkins-ci.main remoting - 2.44 + 2.45 From 680c54887ba9c847fcb992196dc375d5a7a86588 Mon Sep 17 00:00:00 2001 From: Dominique Date: Tue, 16 Sep 2014 21:12:59 -0400 Subject: [PATCH 10/25] Updating javadoc based on PR feedback --- core/src/main/java/hudson/Plugin.java | 5 ++++- .../java/hudson/model/labels/LabelAtomProperty.java | 12 +----------- .../model/labels/LabelAtomPropertyDescriptor.java | 5 +++++ 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/core/src/main/java/hudson/Plugin.java b/core/src/main/java/hudson/Plugin.java index 0c08ecb35b..e2a061fbda 100644 --- a/core/src/main/java/hudson/Plugin.java +++ b/core/src/main/java/hudson/Plugin.java @@ -48,7 +48,10 @@ import com.thoughtworks.xstream.XStream; * Base class of Hudson plugin. * *

    - * A plugin may derive from this class. + * A plugin may derive from this class, or it may directly define extension + * points annotated with {@link hudson.Extension}. For a list of extension + * points, see + * https://wiki.jenkins-ci.org/display/JENKINS/Extension+points. * *

    * One instance of a plugin is created by Hudson, and used as the entry point diff --git a/core/src/main/java/hudson/model/labels/LabelAtomProperty.java b/core/src/main/java/hudson/model/labels/LabelAtomProperty.java index 41a1d7189b..efaad2ab77 100644 --- a/core/src/main/java/hudson/model/labels/LabelAtomProperty.java +++ b/core/src/main/java/hudson/model/labels/LabelAtomProperty.java @@ -40,19 +40,9 @@ import java.util.Collections; * Plugins can contribute this extension point to add additional data or UI actions to {@link LabelAtom}. * {@link LabelAtomProperty}s show up in the configuration screen of a label, and they are persisted * with the {@link LabelAtom} object. - * - *

    Implementation hints

    - *
      - *
    • extend this class and define a static inner class extending {@link hudson.model.labels.LabelAtomPropertyDescriptor}
    • - *
    • in the inner class override getDisplayName(). This function returns the name of the option shown in the label - * configuration page to activate your extension
    • - *
    • if you need additional parameters in this page when activating your extension, provide a config.jelly file
    • - *
    • when the user saves the label configuration page with your extension activated, Jenkins calls the corresponding - * {@link org.kohsuke.stapler.DataBoundConstructor}-annotated constructor in your LabelAtomProperty subclass
    • - *
    • override the getActions() function to return your additional {@link hudson.model.Action}(s)
    • - *
    * * @author Kohsuke Kawaguchi + * @see hudson.model.labels.LabelAtomPropertyDescriptor * @since 1.373 */ @ExportedBean diff --git a/core/src/main/java/hudson/model/labels/LabelAtomPropertyDescriptor.java b/core/src/main/java/hudson/model/labels/LabelAtomPropertyDescriptor.java index 43724c73c4..82312097dc 100644 --- a/core/src/main/java/hudson/model/labels/LabelAtomPropertyDescriptor.java +++ b/core/src/main/java/hudson/model/labels/LabelAtomPropertyDescriptor.java @@ -31,6 +31,11 @@ import hudson.model.Descriptor; * *

    * Put {@link Extension} on your descriptor implementation to have it auto-registered. + * + *

    + * When extending this class, override Descriptor.getDisplayName(). In the + * context of LabelAtomPropertyDescriptor, this function is used to determine the label of + * the checkbox shown in the label's configuration page to activate the extension. * * @author Kohsuke Kawaguchi * @since 1.373 From 71600d8b37581ea367937e0cda6dbc31b13c6904 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 17 Sep 2014 10:01:13 -0400 Subject: [PATCH 11/25] @DataBoundConstructor makes no sense on an abstract class. --- core/src/main/java/hudson/model/Slave.java | 2 -- .../java/hudson/node_monitors/AbstractDiskSpaceMonitor.java | 2 -- 2 files changed, 4 deletions(-) diff --git a/core/src/main/java/hudson/model/Slave.java b/core/src/main/java/hudson/model/Slave.java index d29ed99a13..625cea4b05 100644 --- a/core/src/main/java/hudson/model/Slave.java +++ b/core/src/main/java/hudson/model/Slave.java @@ -62,7 +62,6 @@ import jenkins.model.Jenkins; import jenkins.slaves.WorkspaceLocator; import org.apache.commons.io.IOUtils; -import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.HttpResponse; import org.kohsuke.stapler.QueryParameter; import org.kohsuke.stapler.StaplerRequest; @@ -134,7 +133,6 @@ public abstract class Slave extends Node implements Serializable { */ private String userId; - @DataBoundConstructor public Slave(String name, String nodeDescription, String remoteFS, String numExecutors, Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy retentionStrategy, List> nodeProperties) throws FormException, IOException { this(name,nodeDescription,remoteFS,Util.tryParseNumber(numExecutors, 1).intValue(),mode,labelString,launcher,retentionStrategy, nodeProperties); diff --git a/core/src/main/java/hudson/node_monitors/AbstractDiskSpaceMonitor.java b/core/src/main/java/hudson/node_monitors/AbstractDiskSpaceMonitor.java index be90b91d0e..384133b937 100644 --- a/core/src/main/java/hudson/node_monitors/AbstractDiskSpaceMonitor.java +++ b/core/src/main/java/hudson/node_monitors/AbstractDiskSpaceMonitor.java @@ -5,7 +5,6 @@ import hudson.node_monitors.DiskSpaceMonitorDescriptor.DiskSpace; import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.NoExternalUse; -import org.kohsuke.stapler.DataBoundConstructor; import java.text.ParseException; import java.util.logging.Logger; @@ -21,7 +20,6 @@ public abstract class AbstractDiskSpaceMonitor extends NodeMonitor { */ public final String freeSpaceThreshold; - @DataBoundConstructor public AbstractDiskSpaceMonitor(String threshold) throws ParseException { this.freeSpaceThreshold = threshold; DiskSpace.parse(threshold); // make sure it parses From 5e649c24032d0e0cf9371a7176b585aa8cea0bb3 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Wed, 17 Sep 2014 16:25:55 +0200 Subject: [PATCH 12/25] Noting #1370, #620 --- changelog.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/changelog.html b/changelog.html index 2f749666a2..ba00204bf6 100644 --- a/changelog.html +++ b/changelog.html @@ -56,11 +56,17 @@ Upcoming changes

    From 16cbab5e480dbf73625d43fc9e3e73104312ddbc Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 17 Sep 2014 14:26:38 -0400 Subject: [PATCH 13/25] Better toString. --- core/src/main/java/hudson/model/Slave.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/main/java/hudson/model/Slave.java b/core/src/main/java/hudson/model/Slave.java index 625cea4b05..0393914e12 100644 --- a/core/src/main/java/hudson/model/Slave.java +++ b/core/src/main/java/hudson/model/Slave.java @@ -208,6 +208,10 @@ public abstract class Slave extends Node implements Serializable { return name; } + @Override public String toString() { + return getClass().getName() + "[" + name + "]"; + } + public void setNodeName(String name) { this.name = name; } From 739b81450a45f54f618e2b2789b42b7b6aca9d44 Mon Sep 17 00:00:00 2001 From: Paul Kilgo Date: Wed, 17 Sep 2014 17:10:49 -0400 Subject: [PATCH 14/25] Explicitly set the umask for daemon As discovered by danielbeck in #jenkins, daemon(1) does not inherit the parent process's umask. The --umask flag is the means to set it explicitly. --- debian/debian/jenkins.init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/debian/jenkins.init b/debian/debian/jenkins.init index 8d10398358..554172deac 100644 --- a/debian/debian/jenkins.init +++ b/debian/debian/jenkins.init @@ -23,7 +23,7 @@ SCRIPTNAME=/etc/init.d/$NAME #DAEMON=$JENKINS_SH DAEMON=/usr/bin/daemon -DAEMON_ARGS="--name=$NAME --inherit --env=JENKINS_HOME=$JENKINS_HOME --output=$JENKINS_LOG --pidfile=$PIDFILE" +DAEMON_ARGS="--name=$NAME --inherit --umask=$UMASK --env=JENKINS_HOME=$JENKINS_HOME --output=$JENKINS_LOG --pidfile=$PIDFILE" SU=/bin/su From fdf4163550073452eef810bc7a7d9ded6bea1294 Mon Sep 17 00:00:00 2001 From: Paul Kilgo Date: Wed, 17 Sep 2014 17:27:53 -0400 Subject: [PATCH 15/25] only set umask if set in /etc/default/jenkins --- debian/debian/jenkins.init | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/debian/jenkins.init b/debian/debian/jenkins.init index 554172deac..8566c7c3ce 100644 --- a/debian/debian/jenkins.init +++ b/debian/debian/jenkins.init @@ -23,7 +23,11 @@ SCRIPTNAME=/etc/init.d/$NAME #DAEMON=$JENKINS_SH DAEMON=/usr/bin/daemon -DAEMON_ARGS="--name=$NAME --inherit --umask=$UMASK --env=JENKINS_HOME=$JENKINS_HOME --output=$JENKINS_LOG --pidfile=$PIDFILE" +DAEMON_ARGS="--name=$NAME --inherit --env=JENKINS_HOME=$JENKINS_HOME --output=$JENKINS_LOG --pidfile=$PIDFILE" + +if [ -n "$UMASK" ]; then + DAEMON_ARGS="$DAEMON_ARGS --umask=$UMASK" +fi SU=/bin/su From c57f9ed577b9635f01aa5affabf1f770b689a115 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Wed, 17 Sep 2014 15:35:22 -0700 Subject: [PATCH 16/25] [JENKINS-24458 JENKINS-11543] integrated the newer version of stapler with reduced log level --- changelog.html | 6 ++++++ core/pom.xml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index ba00204bf6..8f8a669fc6 100644 --- a/changelog.html +++ b/changelog.html @@ -67,6 +67,12 @@ Upcoming changes
  • Use Windows line endings for batch file build steps. (issue 7478) +
  • + Reduced the logging clutter about the lack of @ExportedBean + (issue 24458) +
  • + Character encoding problem in form submission when file parameters are present + (issue 11543) diff --git a/core/pom.xml b/core/pom.xml index 8601914aa7..480b2e3318 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -42,7 +42,7 @@ THE SOFTWARE. true - 1.228 + 1.229 2.5.6.SEC03 1.8.9 From 2b5890b27b6bd5153d16ae18da38273ababcb8d3 Mon Sep 17 00:00:00 2001 From: Paul Kilgo Date: Wed, 17 Sep 2014 19:05:35 -0400 Subject: [PATCH 17/25] remove useless call to umask --- debian/debian/jenkins.init | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/debian/debian/jenkins.init b/debian/debian/jenkins.init index 8566c7c3ce..669b4f39d2 100644 --- a/debian/debian/jenkins.init +++ b/debian/debian/jenkins.init @@ -112,10 +112,9 @@ do_start() ulimit -n $MAXOPENFILES fi - # honor umask setting + # notify of explicit umask if [ -n "$UMASK" ]; then [ "$VERBOSE" != no ] && echo Setting umask to $UMASK - umask $UMASK fi # --user in daemon doesn't prepare environment variables like HOME, USER, LOGNAME or USERNAME, From a75c3cbacf4b5ca0fbf5a1cad5a18dcedde41d8a Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Wed, 17 Sep 2014 16:40:41 -0700 Subject: [PATCH 18/25] [JENKINS-23665] integrated newer version of Winstone --- changelog.html | 3 +++ war/pom.xml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index 8f8a669fc6..77423f0ca7 100644 --- a/changelog.html +++ b/changelog.html @@ -73,6 +73,9 @@ Upcoming changes
  • Character encoding problem in form submission when file parameters are present (issue 11543) +
  • + Winstone 2.4: reverse proxy support in the logging, request header size limit control, and different private key password from keystore password. + (issue 23665) diff --git a/war/pom.xml b/war/pom.xml index e361f8f5a9..063bb92094 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -103,7 +103,7 @@ THE SOFTWARE. --> org.jenkins-ci winstone - 2.3 + 2.4 test From 67b3e64d68b881456439a2c1aaffdc9053231bcb Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Wed, 17 Sep 2014 17:19:32 -0700 Subject: [PATCH 19/25] Bundling new slave-installer module for better progress UI feedback --- changelog.html | 2 ++ war/pom.xml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index 77423f0ca7..e89512c43a 100644 --- a/changelog.html +++ b/changelog.html @@ -73,6 +73,8 @@ Upcoming changes
  • Character encoding problem in form submission when file parameters are present (issue 11543) +
  • + Improved error handling and "in-progress" UI feedback in JNLP slave to service installation
  • Winstone 2.4: reverse proxy support in the logging, request header size limit control, and different private key password from keystore password. (issue 23665) diff --git a/war/pom.xml b/war/pom.xml index 063bb92094..1309c5f5ab 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -119,7 +119,7 @@ THE SOFTWARE. org.jenkins-ci.modules slave-installer - 1.3 + 1.5 org.jenkins-ci.modules From cd8c8e00722595b0ab182b291b348b1d0257deb6 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Thu, 18 Sep 2014 11:26:31 +0200 Subject: [PATCH 20/25] Noting #1397 --- changelog.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/changelog.html b/changelog.html index e89512c43a..14c3450867 100644 --- a/changelog.html +++ b/changelog.html @@ -68,16 +68,19 @@ Upcoming changes Use Windows line endings for batch file build steps. (issue 7478)
  • - Reduced the logging clutter about the lack of @ExportedBean + Reduced the logging clutter about the lack of @ExportedBean. (issue 24458)
  • - Character encoding problem in form submission when file parameters are present + Character encoding problem in form submission when file parameters are present. (issue 11543)
  • - Improved error handling and "in-progress" UI feedback in JNLP slave to service installation + Improved error handling and "in-progress" UI feedback in JNLP slave to service installation.
  • Winstone 2.4: reverse proxy support in the logging, request header size limit control, and different private key password from keystore password. (issue 23665) +
  • + umask setting on Debian did not work. + (pull 1397) From 0a9dd730e76717c335f92557b0b87ce1af65fc05 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 21 Sep 2014 20:57:39 -0700 Subject: [PATCH 21/25] [maven-release-plugin] prepare release jenkins-1.581 --- cli/pom.xml | 2 +- core/pom.xml | 2 +- plugins/pom.xml | 10 +++++----- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 2237c4a533..fba50ed9b7 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ pom org.jenkins-ci.main - 1.581-SNAPSHOT + 1.581 cli diff --git a/core/pom.xml b/core/pom.xml index cc9cddc1dc..42a1d9614e 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 1.581-SNAPSHOT + 1.581 ../pom.xml diff --git a/plugins/pom.xml b/plugins/pom.xml index 043dda4b07..3e47988f02 100644 --- a/plugins/pom.xml +++ b/plugins/pom.xml @@ -11,7 +11,7 @@ org.jenkins-ci.plugins plugin Jenkins plugin POM - 1.581-SNAPSHOT + 1.581 pom +

    What's new in 1.581 (2014/09/21)

    • Use slightly larger Jenkins head icon. @@ -76,7 +79,6 @@ Upcoming changes Wrong Hebrew localization resulted in broken console output since 1.539. (issue 24614)
    -

    What's new in 1.580 (2014/09/14)

    • From 4a3286af141c29427839d49e1e32524e7efad935 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Mon, 22 Sep 2014 07:50:12 -0700 Subject: [PATCH 24/25] 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 d964ffbcbd..318c8f2af8 100644 --- a/debian/debian/changelog +++ b/debian/debian/changelog @@ -1,3 +1,9 @@ +jenkins (1.581) unstable; urgency=low + + * See http://jenkins-ci.org/changelog for more details. + + -- Kohsuke Kawaguchi Sun, 21 Sep 2014 21:52:50 -0700 + jenkins (1.580) unstable; urgency=low * See http://jenkins-ci.org/changelog for more details. From eb191593cf04592ee42e722e9200aebb482141b4 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Mon, 22 Sep 2014 07:52:41 -0700 Subject: [PATCH 25/25] creating an RC branch --- changelog.html | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/changelog.html b/changelog.html index 4486bb563e..227928481b 100644 --- a/changelog.html +++ b/changelog.html @@ -54,6 +54,14 @@ Upcoming changes + + + - - -

      What's new in 1.581 (2014/09/21)