From dd84ca6ea92567eeaed3ed2bae702de822fd9585 Mon Sep 17 00:00:00 2001 From: Zbynek Konecny Date: Thu, 18 Sep 2025 02:54:06 +0200 Subject: [PATCH 1/6] Update gitlab-api dependency --- pom.xml | 19 ++++++++ .../plugins/GitLabAuthenticationToken.java | 2 +- .../plugins/GitLabSecurityRealm.java | 2 +- .../GitLabAuthenticationTokenTest.java | 44 +++++++++++++++++++ 4 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 src/test/java/org/jenkinsci/plugins/GitLabAuthenticationTokenTest.java diff --git a/pom.xml b/pom.xml index d093fcd..6ab4f3f 100644 --- a/pom.xml +++ b/pom.xml @@ -55,6 +55,10 @@ repo.jenkins-ci.org https://repo.jenkins-ci.org/public/ + + incrementals + https://repo.jenkins-ci.org/incrementals/ + @@ -89,6 +93,12 @@ io.jenkins.plugins gitlab-api + 6.1.0-106.v6c0b_5b_df4ee6 + + + io.jenkins.plugins + jakarta-xml-bind-api + 4.0.5-3.v3d5b_a_73965b_9 org.jenkins-ci.plugins @@ -97,6 +107,7 @@ org.jenkins-ci.plugins jackson2-api + 2.20.0-417.va_5311a_823a_b_8 @@ -276,6 +287,14 @@ + + org.apache.maven.plugins + maven-compiler-plugin + + 8 + 8 + + diff --git a/src/main/java/org/jenkinsci/plugins/GitLabAuthenticationToken.java b/src/main/java/org/jenkinsci/plugins/GitLabAuthenticationToken.java index 3872548..cf474a4 100755 --- a/src/main/java/org/jenkinsci/plugins/GitLabAuthenticationToken.java +++ b/src/main/java/org/jenkinsci/plugins/GitLabAuthenticationToken.java @@ -43,12 +43,12 @@ of this software and associated documentation files (the "Software"), to deal import jenkins.model.Jenkins; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.StringUtils; -import org.gitlab4j.api.Constants.TokenType; import org.gitlab4j.api.GitLabApi; import org.gitlab4j.api.GitLabApiException; import org.gitlab4j.api.models.Group; import org.gitlab4j.api.models.Project; import org.gitlab4j.api.models.User; +import org.gitlab4j.models.Constants.TokenType; import org.springframework.security.authentication.AbstractAuthenticationToken; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; diff --git a/src/main/java/org/jenkinsci/plugins/GitLabSecurityRealm.java b/src/main/java/org/jenkinsci/plugins/GitLabSecurityRealm.java index 007c164..5dcc2af 100644 --- a/src/main/java/org/jenkinsci/plugins/GitLabSecurityRealm.java +++ b/src/main/java/org/jenkinsci/plugins/GitLabSecurityRealm.java @@ -72,9 +72,9 @@ import org.apache.http.impl.client.HttpClients; import org.apache.http.message.BasicNameValuePair; import org.apache.http.util.EntityUtils; -import org.gitlab4j.api.Constants.TokenType; import org.gitlab4j.api.GitLabApiException; import org.gitlab4j.api.models.Group; +import org.gitlab4j.models.Constants.TokenType; import org.jfree.util.Log; import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.Header; diff --git a/src/test/java/org/jenkinsci/plugins/GitLabAuthenticationTokenTest.java b/src/test/java/org/jenkinsci/plugins/GitLabAuthenticationTokenTest.java new file mode 100644 index 0000000..03afbe5 --- /dev/null +++ b/src/test/java/org/jenkinsci/plugins/GitLabAuthenticationTokenTest.java @@ -0,0 +1,44 @@ +/* + The MIT License + + Copyright (c) 2025 Jenkins contributors + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + */ + +package org.jenkinsci.plugins; + +import static org.junit.jupiter.api.Assertions.assertThrows; + +import org.gitlab4j.api.GitLabApiException; +import org.gitlab4j.models.Constants; +import org.junit.jupiter.api.Test; + +public class GitLabAuthenticationTokenTest { + + /** + * This checks that we get the correct exception. + */ + @Test + public void testInvalidUrl() { + assertThrows(GitLabApiException.class, + () -> new GitLabAuthenticationToken("42", + "http://localhost/_invalid_url", Constants.TokenType.ACCESS)); + } +} From 5426e0896511f5d996393555c57c18b182fefb3e Mon Sep 17 00:00:00 2001 From: Zbynek Konecny Date: Wed, 12 Nov 2025 07:18:17 +0100 Subject: [PATCH 2/6] Remove accidental maven-compiler-plugin configuration --- pom.xml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/pom.xml b/pom.xml index 782f91d..e3b555a 100644 --- a/pom.xml +++ b/pom.xml @@ -287,14 +287,6 @@ - - org.apache.maven.plugins - maven-compiler-plugin - - 8 - 8 - - From 39566a4cd6e81cc7638da5bb91e82803eefd24ea Mon Sep 17 00:00:00 2001 From: Kris Stern Date: Fri, 14 Nov 2025 21:04:29 +0800 Subject: [PATCH 3/6] Update pom.xml Co-authored-by: Mark Waite --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e3b555a..ae43b64 100644 --- a/pom.xml +++ b/pom.xml @@ -93,7 +93,7 @@ io.jenkins.plugins gitlab-api - 6.1.0-106.v6c0b_5b_df4ee6 + 6.2.0-129.v770352b_103a_6 io.jenkins.plugins From 674bd5bde967a051f961859a61ad3692cda3899d Mon Sep 17 00:00:00 2001 From: Kris Stern Date: Fri, 14 Nov 2025 21:14:17 +0800 Subject: [PATCH 4/6] Update pom.xml Co-authored-by: Mark Waite --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ae43b64..dda7107 100644 --- a/pom.xml +++ b/pom.xml @@ -93,7 +93,7 @@ io.jenkins.plugins gitlab-api - 6.2.0-129.v770352b_103a_6 + 6.2.0-111.vf174d6b_8c12e io.jenkins.plugins From 45c0d710cbe07dbbfc49108685d94f65d9ff53c9 Mon Sep 17 00:00:00 2001 From: Kris Stern Date: Fri, 14 Nov 2025 21:27:28 +0800 Subject: [PATCH 5/6] update jenkins and BOM versions --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index dda7107..f2ff092 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ 1.24 -SNAPSHOT - 2.492 + 2.504 ${jenkins.baseline}.3 Max Low @@ -71,7 +71,7 @@ io.jenkins.tools.bom bom-${jenkins.baseline}.x - 5473.vb_9533d9e5d88 + 5659.vecf9e2dc5a_ed import pom From 03ae902e2cb3abb89e105fef7cdca397f204ca53 Mon Sep 17 00:00:00 2001 From: Kris Stern Date: Fri, 14 Nov 2025 21:32:10 +0800 Subject: [PATCH 6/6] remove jackson2-api and jakarta-xml-bind-api version specifications --- pom.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/pom.xml b/pom.xml index f2ff092..541e76b 100644 --- a/pom.xml +++ b/pom.xml @@ -98,7 +98,6 @@ io.jenkins.plugins jakarta-xml-bind-api - 4.0.5-3.v3d5b_a_73965b_9 org.jenkins-ci.plugins @@ -107,7 +106,6 @@ org.jenkins-ci.plugins jackson2-api - 2.20.0-417.va_5311a_823a_b_8