Server down?

1 message Options
Embed this post
Permalink
Jesse Glick

Server down?

Reply Threaded More More options
Print post
Permalink
I cannot access either Issuezilla or Subversion right now.

1.332 is still broken with respect to exporting <scm>; do not use it! I have a fix on disk but cannot commit it. (Now is one of those times that a DVCS would be very nice...)

Index: test/src/test/java/hudson/model/ApiTest.java
===================================================================
--- test/src/test/java/hudson/model/ApiTest.java (revision 23458)
+++ test/src/test/java/hudson/model/ApiTest.java (working copy)
@@ -25,6 +25,10 @@
 
 import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
 import com.gargoylesoftware.htmlunit.Page;
+import hudson.scm.CVSSCM;
+import hudson.scm.browsers.ViewCVS;
+import java.lang.reflect.Field;
+import java.net.URL;
 import org.jvnet.hudson.test.HudsonTestCase;
 import org.jvnet.hudson.test.Bug;
 import org.jvnet.hudson.test.Email;
@@ -82,8 +86,16 @@
     }
 
     @Email("https://hudson.dev.java.net/servlets/BrowseList?list=users&by=thread&from=2222483")
+    @Bug(4760)
     public void testProjectExport() throws Exception {
         FreeStyleProject p = createFreeStyleProject();
+        assertBuildStatusSuccess(p.scheduleBuild2(0).get());
+        CVSSCM scm = new CVSSCM(":pserver:nowhere.net/cvs/foo", ".", null, null, true, true, false, null);
+        p.setScm(scm);
+        Field repositoryBrowser = scm.getClass().getDeclaredField("repositoryBrowser");
+        repositoryBrowser.setAccessible(true);
+        repositoryBrowser.set(scm, new ViewCVS(new URL("http://nowhere.net/viewcvs/")));
         new WebClient().goTo(p.getUrl()+"api/xml", "application/xml");
+        new WebClient().goTo(p.getUrl()+"api/xml?depth=999", "application/xml");
     }
 }
Index: core/src/main/java/hudson/scm/SCM.java
===================================================================
--- core/src/main/java/hudson/scm/SCM.java (revision 23458)
+++ core/src/main/java/hudson/scm/SCM.java (working copy)
@@ -98,7 +98,6 @@
      *
      * @see #getEffectiveBrowser()
      */
-    @Exported
     public RepositoryBrowser getBrowser() {
         return null;
     }
@@ -121,7 +120,7 @@
      * This method attempts to find applicable browser
      * from other job configurations.
      */
-    @Exported
+    @Exported(name="browser")
     public final RepositoryBrowser getEffectiveBrowser() {
         RepositoryBrowser b = getBrowser();
         if(b!=null)
Index: core/src/main/java/hudson/scm/RepositoryBrowser.java
===================================================================
--- core/src/main/java/hudson/scm/RepositoryBrowser.java (revision 23457)
+++ core/src/main/java/hudson/scm/RepositoryBrowser.java (working copy)
@@ -26,7 +26,6 @@
 import hudson.ExtensionPoint;
 import hudson.DescriptorExtensionList;
 import hudson.Extension;
-import hudson.tasks.BuildWrapper;
 import hudson.model.Describable;
 import hudson.model.Descriptor;
 import hudson.model.Hudson;
@@ -35,6 +34,7 @@
 import java.io.Serializable;
 import java.net.URL;
 import java.net.MalformedURLException;
+import org.kohsuke.stapler.export.ExportedBean;
 
 /**
  * Connects Hudson to repository browsers like ViewCVS or FishEye,
@@ -55,6 +55,7 @@
  * @since 1.89
  * @see RepositoryBrowsers
  */
+@ExportedBean
 public abstract class RepositoryBrowser<E extends ChangeLogSet.Entry> implements ExtensionPoint, Describable<RepositoryBrowser<?>>, Serializable {
     /**
      * Determines the link to the given change set.

[HUDSON-4760] If you export a RepositoryBrowser, it needs to actually be exportable!
Otherwise get e.g.:
org.kohsuke.stapler.export.NotExportableException: class hudson.plugins.mercurial.browser.HgWeb doesn't have @ExportedBean
        at org.kohsuke.stapler.export.Model.<init>(Model.java:44)
        at org.kohsuke.stapler.export.ModelBuilder.get(ModelBuilder.java:25)
        at org.kohsuke.stapler.export.Property.writeValue(Property.java:173)
        at org.kohsuke.stapler.export.Property.writeValue(Property.java:98)
        at org.kohsuke.stapler.export.Property.writeTo(Property.java:82)
        at org.kohsuke.stapler.export.Model.writeNestedObjectTo(Model.java:142)
        at org.kohsuke.stapler.export.Model.writeNestedObjectTo(Model.java:139)
        at org.kohsuke.stapler.export.Property.writeValue(Property.java:180)
        at org.kohsuke.stapler.export.Property.writeValue(Property.java:98)
        at org.kohsuke.stapler.export.Property.writeTo(Property.java:82)
        at org.kohsuke.stapler.export.Model.writeNestedObjectTo(Model.java:142)
        at org.kohsuke.stapler.export.Model.writeNestedObjectTo(Model.java:139)
        at org.kohsuke.stapler.export.Model.writeNestedObjectTo(Model.java:139)
        at org.kohsuke.stapler.export.Model.writeTo(Model.java:133)
        at hudson.model.Api.doXml(Api.java:94)
--This line, and those below, will be ignored--

M    main/test/src/test/java/hudson/model/ApiTest.java
M    main/core/src/main/java/hudson/scm/SCM.java
M    main/core/src/main/java/hudson/scm/RepositoryBrowser.java

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]