diff --git a/core/pom.xml b/core/pom.xml index 92f1f50754ba090dc5f34ffe04dff5ee29eccb62..41c8573c83d37a306c799327ca1033a7e12d663e 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -27,7 +27,7 @@ THE SOFTWARE. org.jvnet.hudson.main pom - 1.294-SNAPSHOT + 1.295-SNAPSHOT ../pom.xml diff --git a/core/src/main/java/hudson/scm/CVSSCM.java b/core/src/main/java/hudson/scm/CVSSCM.java index b7fdbf767c2e1cc37af6b75c6e3bb113543d5a3d..b020d36c6a3e5bd3db48016b0c10d6556f771582 100644 --- a/core/src/main/java/hudson/scm/CVSSCM.java +++ b/core/src/main/java/hudson/scm/CVSSCM.java @@ -1118,10 +1118,10 @@ public class CVSSCM extends SCM implements Serializable { // web methods // - public FormValidation doCvsPassCheck(@AncestorInPath AbstractProject project, @QueryParameter String value) { + public FormValidation doCvsPassCheck(@QueryParameter String value) { // this method can be used to check if a file exists anywhere in the file system, // so it should be protected. - if(!project.hasPermission(Item.CONFIGURE)) + if(!Hudson.getInstance().hasPermission(Hudson.ADMINISTER)) return FormValidation.ok(); value = fixEmpty(value); diff --git a/debian/changelog b/debian/changelog index 08eb9ff70c3f6c78f3c400733ccc304a20ff8206..fc08d1feccaec49e9555edea83d3164622b8a5b3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +hudson (1.294) unstable; urgency=low + + * See http://hudson.dev.java.net/changelog.html for more details. + + -- Kohsuke Kawaguchi Sat, 28 Mar 2009 14:43:37 -0700 + hudson (1.293) unstable; urgency=low * See http://hudson.dev.java.net/changelog.html for more details. diff --git a/maven-agent/pom.xml b/maven-agent/pom.xml index 2dabe6195d9d45332b4b4d90bbe0830f1afc5e79..69019469019cab93d20477bb709249276a38e79d 100644 --- a/maven-agent/pom.xml +++ b/maven-agent/pom.xml @@ -27,7 +27,7 @@ THE SOFTWARE. org.jvnet.hudson.main pom - 1.294-SNAPSHOT + 1.295-SNAPSHOT ../pom.xml diff --git a/maven-interceptor/pom.xml b/maven-interceptor/pom.xml index 5d984e4bf960477952014f4b2967a38b9c58e18c..caaeb02734ceaabd8c789ef77e815292dc1337de 100644 --- a/maven-interceptor/pom.xml +++ b/maven-interceptor/pom.xml @@ -27,7 +27,7 @@ THE SOFTWARE. org.jvnet.hudson.main pom - 1.294-SNAPSHOT + 1.295-SNAPSHOT ../pom.xml diff --git a/pom.xml b/pom.xml index 5f3dfcf5afe974be6880189454cacd1c1614da65..35cd5c1271b0d6b303d6bd2ca76073ea2afad4bb 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jvnet.hudson.main pom - 1.294-SNAPSHOT + 1.295-SNAPSHOT pom Hudson main module diff --git a/remoting/pom.xml b/remoting/pom.xml index 89bfafabc649607936b8324df3ab3bcb08c56fa6..96ff77bbf9fb6a982933e878ddbf16719dc64047 100644 --- a/remoting/pom.xml +++ b/remoting/pom.xml @@ -27,7 +27,7 @@ THE SOFTWARE. org.jvnet.hudson.main pom - 1.294-SNAPSHOT + 1.295-SNAPSHOT ../pom.xml diff --git a/test/pom.xml b/test/pom.xml index 24967da794da25e58934311cf53fba091b861114..69c8bad31811720a2a6def22fbc6f0d6e38fa525 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -27,7 +27,7 @@ THE SOFTWARE. pom org.jvnet.hudson.main - 1.294-SNAPSHOT + 1.295-SNAPSHOT 4.0.0 org.jvnet.hudson.main diff --git a/test/src/test/java/hudson/util/FormFieldValidatorTest.java b/test/src/test/java/hudson/util/FormFieldValidatorTest.java index 396df9a99ef400ec5654b914412a6f94fcaf39d5..bb5cd12d05ef79c5a725218513d2ddfe145cd196 100644 --- a/test/src/test/java/hudson/util/FormFieldValidatorTest.java +++ b/test/src/test/java/hudson/util/FormFieldValidatorTest.java @@ -24,6 +24,10 @@ package hudson.util; import hudson.model.FreeStyleProject; +import hudson.tasks.Builder; +import hudson.tasks.BuildStepDescriptor; +import hudson.tasks.Publisher; +import hudson.util.FormFieldValidatorTest.BrokenFormValidatorBuilder.DescriptorImpl; import org.jvnet.hudson.test.Bug; import org.jvnet.hudson.test.HudsonTestCase; import org.jvnet.hudson.test.recipes.WithPlugin; @@ -38,4 +42,42 @@ public class FormFieldValidatorTest extends HudsonTestCase { FreeStyleProject p = createFreeStyleProject(); new WebClient().getPage(p,"configure"); } + + public static class BrokenFormValidatorBuilder extends Builder { + public static final class DescriptorImpl extends BuildStepDescriptor { + public boolean isApplicable(Class jobType) { + return true; + } + + public void doCheckXyz() { + throw new Error("doCheckXyz is broken"); + } + + public String getDisplayName() { + return "I have broken form field validation"; + } + } + } + + /** + * Make sure that the validation methods are really called by testing a negative case. + */ + @Bug(3382) + public void testNegative() throws Exception { + DescriptorImpl d = new DescriptorImpl(); + Publisher.all().add(d); + try { + FreeStyleProject p = createFreeStyleProject(); + new WebClient().getPage(p,"configure"); + fail("should have failed"); + } catch(AssertionError e) { + if(e.getMessage().contains("doCheckXyz is broken")) + ; // expected + else + throw e; + } finally { + Publisher.all().remove(d); + } + } + } diff --git a/test/src/test/resources/hudson/util/FormFieldValidatorTest/BrokenFormValidatorBuilder/config.jelly b/test/src/test/resources/hudson/util/FormFieldValidatorTest/BrokenFormValidatorBuilder/config.jelly new file mode 100644 index 0000000000000000000000000000000000000000..8adf661b404b194a4c7ff9c2b80d617e34dc797f --- /dev/null +++ b/test/src/test/resources/hudson/util/FormFieldValidatorTest/BrokenFormValidatorBuilder/config.jelly @@ -0,0 +1,29 @@ + + + + + + + \ No newline at end of file diff --git a/war/pom.xml b/war/pom.xml index d686eb2acc8c99340ab92e33ed3c63cba75d5247..6022c9fede08fba08d4e76fc93004761d24eb901 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -27,7 +27,7 @@ THE SOFTWARE. org.jvnet.hudson.main pom - 1.294-SNAPSHOT + 1.295-SNAPSHOT ../pom.xml diff --git a/war/resources/scripts/hudson-behavior.js b/war/resources/scripts/hudson-behavior.js index c623cd5e7bb74fdc171f51b32245642bf4da8d97..579bc50654325e12bbe2b9f572b51bab57e32427 100644 --- a/war/resources/scripts/hudson-behavior.js +++ b/war/resources/scripts/hudson-behavior.js @@ -44,7 +44,12 @@ var FormChecker = { // pending requests queue : [], - inProgress : false, + // conceptually boolean, but doing so create concurrency problem. + // that is, during unit tests, the AJAX.send works synchronously, so + // the onComplete happens before the send method returns. On a real environment, + // more likely it's the other way around. So setting a boolean flag to true or false + // won't work. + inProgress : 0, /** * Schedules a form field check. Executions are serialized to reduce the bandwidth impact. @@ -73,7 +78,7 @@ var FormChecker = { }, schedule : function() { - if (this.inProgress) return; + if (this.inProgress>0) return; if (this.queue.length == 0) return; var next = this.queue.shift(); @@ -81,11 +86,11 @@ var FormChecker = { method : next.method, onComplete : function(x) { next.target.innerHTML = x.responseText; - FormChecker.inProgress = false; + FormChecker.inProgress--; FormChecker.schedule(); } }); - this.inProgress = true; + this.inProgress++; } }