From 32162e48b36700770e15fb5688dfaefb4b8848e0 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 13 Oct 2020 12:13:10 -0400 Subject: [PATCH] [JENKINS-62669] Removing Bitbucket support --- README.md | 3 +- .../plugins/mercurial/browser/BitBucket.java | 81 ------------------ .../mercurial/browser/BitBucket/config.jelly | 6 -- .../mercurial/browser/BitBucket/help-url.html | 3 - src/main/resources/index.jelly | 2 +- .../mercurial/browser/BitBucketTest.java | 33 ------- .../browser/HgBrowserSelectionTest.java | 14 +-- .../browsersAvailableInDropDown.zip | Bin 1548 -> 1557 bytes .../pickingUpAlternativeBrowser.zip | Bin 1230 -> 1239 bytes 9 files changed, 9 insertions(+), 133 deletions(-) delete mode 100644 src/main/java/hudson/plugins/mercurial/browser/BitBucket.java delete mode 100644 src/main/resources/hudson/plugins/mercurial/browser/BitBucket/config.jelly delete mode 100644 src/main/resources/hudson/plugins/mercurial/browser/BitBucket/help-url.html delete mode 100644 src/test/java/hudson/plugins/mercurial/browser/BitBucketTest.java diff --git a/README.md b/README.md index 1a546d10..a4d4fdaf 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,7 @@ manner, polling will check if the upstream repository contains any new changes, and use that as the triggering condition of the new build.  This plugin is currently intended to support Mercurial 1.0 and later. -Viewers included are `bitbucket`, `fisheye`, `google-code`, `hgweb`, -`kiln`, and `rhodecode`. +Viewers are included for various hosted services. ### Push Notifications diff --git a/src/main/java/hudson/plugins/mercurial/browser/BitBucket.java b/src/main/java/hudson/plugins/mercurial/browser/BitBucket.java deleted file mode 100644 index 65eb7318..00000000 --- a/src/main/java/hudson/plugins/mercurial/browser/BitBucket.java +++ /dev/null @@ -1,81 +0,0 @@ -package hudson.plugins.mercurial.browser; - -import hudson.Extension; -import hudson.plugins.mercurial.MercurialChangeSet; -import hudson.util.FormValidation; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; - - -import org.kohsuke.stapler.DataBoundConstructor; -import org.kohsuke.stapler.QueryParameter; - -/** - * Mercurial web interface served using a BitBucket repository. - */ -public class BitBucket extends HgBrowser { - - @DataBoundConstructor - public BitBucket(String url) throws MalformedURLException { - super(url); - } - - /** - * {@inheritDoc} - */ - @Override - public URL getChangeSetLink(MercurialChangeSet changeSet) - throws IOException { - current = changeSet; - return new URL(getUrl(), "changeset/" + changeSet.getShortNode() + "/"); - } - - /** - * {@inheritDoc} - * - * Throws {@link IllegalStateException} when this method is called before at least one call - * to {@literal getChangeSetLink(MercurialChangeSet)}. - */ - @Override - public URL getFileLink(String path) throws MalformedURLException { - checkCurrentIsNotNull(); - // http://bitbucket.org/mfriedenhagen/hudson-mercurial/src/d736d15e5389/src/main/java/hudson/plugins/mercurial/browser/HgBrowser.java - return new URL(getUrl(), "src/" + current.getShortNode() + "/" + path); - } - - /** - * {@inheritDoc} - * - * Throws {@link IllegalStateException} when this method is called before at least one call - * to {@literal getChangeSetLink(MercurialChangeSet)}. - */ - @Override - public URL getDiffLink(String path) throws MalformedURLException { - checkCurrentIsNotNull(); - // http://bitbucket.org/mfriedenhagen/hudson-mercurial/changeset/d736d15e5389/#chg-src/main/java/hudson/plugins/mercurial/browser/HgBrowser.java - return new URL(getUrl(), "changeset/" + current.getShortNode() + "/#chg-" + path); - } - - @Extension - public static class DescriptorImpl extends HgBrowserDescriptor { - public String getDisplayName() { - return "bitbucket"; - } - - @Override public FormValidation doCheckUrl(@QueryParameter String url) { - return _doCheckUrl(url); - } - - @Override protected FormValidation check(URL url) { - if (url.toString().matches("https?://bitbucket[.]org/[^/]+/[^/]+/")) { - return FormValidation.ok(); - } else { - return FormValidation.warning("Possibly incorrect root URL; expected http://bitbucket.org/USERNAME/REPOS/"); - } - } - } - - private static final long serialVersionUID = 1L; -} diff --git a/src/main/resources/hudson/plugins/mercurial/browser/BitBucket/config.jelly b/src/main/resources/hudson/plugins/mercurial/browser/BitBucket/config.jelly deleted file mode 100644 index 140cf940..00000000 --- a/src/main/resources/hudson/plugins/mercurial/browser/BitBucket/config.jelly +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/src/main/resources/hudson/plugins/mercurial/browser/BitBucket/help-url.html b/src/main/resources/hudson/plugins/mercurial/browser/BitBucket/help-url.html deleted file mode 100644 index 017c7f3e..00000000 --- a/src/main/resources/hudson/plugins/mercurial/browser/BitBucket/help-url.html +++ /dev/null @@ -1,3 +0,0 @@ -
- Specify the root URL serving this repository (such as this). -
\ No newline at end of file diff --git a/src/main/resources/index.jelly b/src/main/resources/index.jelly index 73827207..ad171878 100644 --- a/src/main/resources/index.jelly +++ b/src/main/resources/index.jelly @@ -2,7 +2,7 @@
This plugin integrates Mercurial SCM with Jenkins. It includes repository browsing support for hg serve/hgweb, - Google Code, Bitbucket, FishEye, KilnHG and RhodeCode. Features include guaranteed clean builds, named branch + as well as hosted services like Google Code. Features include guaranteed clean builds, named branch support, module lists, Mercurial tool installation, and automatic caching.
diff --git a/src/test/java/hudson/plugins/mercurial/browser/BitBucketTest.java b/src/test/java/hudson/plugins/mercurial/browser/BitBucketTest.java deleted file mode 100644 index e7671a88..00000000 --- a/src/test/java/hudson/plugins/mercurial/browser/BitBucketTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * BitBucketTest.java 07.09.2009 - */ -package hudson.plugins.mercurial.browser; - -import java.io.IOException; -import java.net.MalformedURLException; - -import org.junit.Test; - -public class BitBucketTest extends AbstractBrowserTestBase { - - private static final String REPO_URL = "http://www.example.org/hg/repos"; - - public BitBucketTest() throws MalformedURLException { - super(new BitBucket(REPO_URL)); - } - - @Test - public void testGetChangeSetLinkMercurialChangeSet() throws IOException { - testGetChangeSetLinkMercurialChangeSet(REPO_URL+ "/changeset/6704efde8754/"); - } - - @Test - public void testGetFileLink() throws IOException { - testGetFileLink(REPO_URL + "/src/6704efde8754/src/main/java/hudson/plugins/mercurial/browser/HgBrowser.java"); - } - - @Test - public void testGetDiffLink() throws IOException { - testGetDiffLink(REPO_URL + "/changeset/6704efde8754/#chg-src/main/java/hudson/plugins/mercurial/browser/HgBrowser.java"); - } -} diff --git a/src/test/java/hudson/plugins/mercurial/browser/HgBrowserSelectionTest.java b/src/test/java/hudson/plugins/mercurial/browser/HgBrowserSelectionTest.java index 967bf830..85b97bc8 100644 --- a/src/test/java/hudson/plugins/mercurial/browser/HgBrowserSelectionTest.java +++ b/src/test/java/hudson/plugins/mercurial/browser/HgBrowserSelectionTest.java @@ -36,9 +36,9 @@ public class HgBrowserSelectionTest { FreeStyleProject p = (FreeStyleProject) j.jenkins.getItem("foo"); MercurialSCM ms = (MercurialSCM) p.getScm(); final HgBrowser browser = ms.getBrowser(); - assertEquals("wrong url", "http://bitbucket.org/", browser.getUrl().toString()); - assertTrue("class:" + browser.getClass(), browser instanceof BitBucket); - j.assertEqualBeans(new BitBucket("http://bitbucket.org/"), browser, "url"); + assertEquals("wrong url", "http://code.google.com/p/xxx/source/", browser.getUrl().toString()); + assertTrue("class:" + browser.getClass(), browser instanceof GoogleCode); + j.assertEqualBeans(new GoogleCode("http://code.google.com/p/xxx/source/"), browser, "url"); } @Issue("JENKINS-4514") @@ -47,11 +47,11 @@ public class HgBrowserSelectionTest { FreeStyleProject p = (FreeStyleProject) j.jenkins.getItem("foo"); MercurialSCM ms = (MercurialSCM) p.getScm(); final HgBrowser browser = ms.getBrowser(); - assertEquals("wrong url", "http://bitbucket.org/", browser.getUrl().toString()); - assertTrue("class:" + browser.getClass(), browser instanceof BitBucket); - j.assertEqualBeans(new BitBucket("http://bitbucket.org/"), browser, "url"); + assertEquals("wrong url", "http://code.google.com/p/xxx/source/", browser.getUrl().toString()); + assertTrue("class:" + browser.getClass(), browser instanceof GoogleCode); + j.assertEqualBeans(new GoogleCode("http://code.google.com/p/xxx/source/"), browser, "url"); final List>> browserDescriptors = ms.getDescriptor().getBrowserDescriptors(); - assertTrue("Could not find BitBucket in " + browserDescriptors, browserDescriptors.contains(browser.getDescriptor())); + assertTrue("Could not find GoogleCode in " + browserDescriptors, browserDescriptors.contains(browser.getDescriptor())); } @Issue("JENKINS-20186") diff --git a/src/test/resources/hudson/plugins/mercurial/browser/HgBrowserSelectionTest/browsersAvailableInDropDown.zip b/src/test/resources/hudson/plugins/mercurial/browser/HgBrowserSelectionTest/browsersAvailableInDropDown.zip index 5efb129df87a116b2a2a1b9eb0e93c738a18a699..cefe2439452650780a0d06e247f22aec6990cc7e 100644 GIT binary patch delta 414 zcmeC-naZ0C^hmfjLElPxvX2$Vd?9mKS6EcT$#T=ReYHt zlJCpj^6t))E;yC_xGnbguTKS~x8LpV<#=K5a5V3-iPNeXM~|d0XcUwx;mI5ntQ-`~|x3Dz*KP6r`Pmm$GZL8_Zje%i8Z?`R9a?)BXN2*8JjA>PiTU1%h z;^&78qgQ#&^JU)6$|ZRyW_ceK1{Bnd-Rf zYBlTB7Z>XVAIvusm#v;tE3;|o(VTY^FZ{cl9eB-UXHBNXe&O@{rtDt3)b)?+C284- zo5Y`-@J9DVX*;)Gii^2%3-SdnS6&;i|sBjycrk(+FG(v delta 399 zcmbQr)5Ei2JtObdEymVYHqW}G!pOj2J$VnKe7%_CRxc1Pt>9*0WcdaZ2NSJ9zWzrP z1opmPpYiR|WY_#-7xFeqvkcjWpML@9xcS)i=vB|3wc{byi(Q mvB?`*lqQ$6N->KuGfcK&mY%$x)s!)L@>5nVwkymGKmY)|EU#z) diff --git a/src/test/resources/hudson/plugins/mercurial/browser/HgBrowserSelectionTest/pickingUpAlternativeBrowser.zip b/src/test/resources/hudson/plugins/mercurial/browser/HgBrowserSelectionTest/pickingUpAlternativeBrowser.zip index 0636acb9439f98b62e14bc93b2c469dbe61ef431..898473cba026c204f6abfe37a21b09547ae9bde6 100644 GIT binary patch delta 449 zcmX@dd7X2EC}X{0qHmz<+h2Qi85tO&m>3v@8Dto;@{@}7)AIB6lk@Y^GSl@ca&tmM zI2oAjF1E&laA^fM10%}|W(Ec@(Hmszf5d?2?)&hN?IlW$ybELUEm$t=)^u3<`shzk zn>bhI?@txqYNw=zv*+L6tm{+$b~$6Vv4Z6LvbVhTyY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