From 539d1c8c1d0608ae78380ecc1e3eb774a2d17a4f Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Mon, 6 Mar 2023 08:10:09 -0800 Subject: [PATCH] Drop support for git:// URLs --- .../tools/test/PluginCompatTester.java | 89 ++++++++++++++++++- 1 file changed, 88 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jenkins/tools/test/PluginCompatTester.java b/src/main/java/org/jenkins/tools/test/PluginCompatTester.java index a26a29364..1af5364d1 100644 --- a/src/main/java/org/jenkins/tools/test/PluginCompatTester.java +++ b/src/main/java/org/jenkins/tools/test/PluginCompatTester.java @@ -444,8 +444,95 @@ public static void cloneFromScm( if (StringUtils.startsWith(connectionURL, "scm:git:")) { connectionURL = StringUtils.substringAfter(connectionURL, "scm:git:"); } + // See: https://github.blog/2021-09-01-improving-git-protocol-security-github/ - connectionURL = connectionURL.replace("git://", "https://"); + + // TODO pending release of + // https://github.com/jenkinsci/antisamy-markup-formatter-plugin/pull/106 + connectionURL = + connectionURL.replace( + "git://github.com/jenkinsci/antisamy-markup-formatter-plugin", + "https://github.com/jenkinsci/antisamy-markup-formatter-plugin"); + + // TODO pending release of + // https://github.com/jenkinsci/bootstrap5-api-plugin/commit/8c5f60ab5e21c03b68d696e7b760caa991b25aa9 + connectionURL = + connectionURL.replace( + "git://github.com/jenkinsci/bootstrap5-api-plugin", + "https://github.com/jenkinsci/bootstrap5-api-plugin"); + + // TODO pending backport of + // https://github.com/jenkinsci/cloudbees-folder-plugin/pull/260 + connectionURL = + connectionURL.replace( + "git://github.com/jenkinsci/cloudbees-folder-plugin", + "https://github.com/jenkinsci/cloudbees-folder-plugin"); + + // TODO pending release of + // https://github.com/jenkinsci/configuration-as-code-plugin/pull/2166 + connectionURL = + connectionURL.replace( + "git://github.com/jenkinsci/configuration-as-code-plugin", + "https://github.com/jenkinsci/configuration-as-code-plugin"); + + // TODO pending release of + // https://github.com/jenkinsci/data-tables-api-plugin/commit/97dc7555017e6c7ea17f0b67cc292773f1114a54 + connectionURL = + connectionURL.replace( + "git://github.com/jenkinsci/data-tables-api-plugin", + "https://github.com/jenkinsci/data-tables-api-plugin"); + + // TODO pending backport of + // https://github.com/jenkinsci/echarts-api-plugin/commit/d6951a26e6f1c27b82c8308359f7f76e182de3e3 + connectionURL = + connectionURL.replace( + "git://github.com/jenkinsci/echarts-api-plugin", + "https://github.com/jenkinsci/echarts-api-plugin"); + + // TODO pending release of + // https://github.com/jenkinsci/file-parameters-plugin/pull/142 + connectionURL = + connectionURL.replace( + "git://github.com/jenkinsci/file-parameters-plugin", + "https://github.com/jenkinsci/file-parameters-plugin"); + + // TODO pending release of https://github.com/jenkinsci/github-api-plugin/pull/182 + connectionURL = + connectionURL.replace( + "git://github.com/jenkinsci/github-api-plugin", + "https://github.com/jenkinsci/github-api-plugin"); + + // TODO pending adoption of https://github.com/jenkinsci/matrix-auth-plugin/pull/131 + connectionURL = + connectionURL.replace( + "git://github.com/jenkinsci/matrix-auth-plugin", + "https://github.com/jenkinsci/matrix-auth-plugin"); + + // TODO pending release of + // https://github.com/jenkinsci/popper2-api-plugin/commit/bf781e31b072103f3f72d7195e9071863f7f4dd9 + connectionURL = + connectionURL.replace( + "git://github.com/jenkinsci/popper2-api-plugin", + "https://github.com/jenkinsci/popper2-api-plugin"); + + // TODO pending release of https://github.com/jenkinsci/ssh-agent-plugin/pull/116 + connectionURL = + connectionURL.replace( + "git://github.com/jenkinsci/ssh-agent-plugin", + "https://github.com/jenkinsci/ssh-agent-plugin"); + + // TODO pending release of https://github.com/jenkinsci/ssh-slaves-plugin/pull/352 + connectionURL = + connectionURL.replace( + "git://github.com/jenkinsci/ssh-slaves-plugin", + "https://github.com/jenkinsci/ssh-slaves-plugin"); + + // TODO pending release of + // https://github.com/jenkinsci/theme-manager-plugin/pull/154 + connectionURL = + connectionURL.replace( + "git://github.com/jenkinsci/theme-manager-plugin", + "https://github.com/jenkinsci/theme-manager-plugin"); } try { cloneImpl(connectionURL, scmTag, checkoutDirectory);