From 2969ddf70aad111a46bd94018773ad25bd3f3793 Mon Sep 17 00:00:00 2001 From: Aurelien Poscia Date: Thu, 19 Oct 2023 11:43:28 +0200 Subject: [PATCH] SONAR-20700 Move GitHubPermissionConverter to sonar-alm-client --- .../sonar/alm/client}/github/GithubPermissionConverter.java | 3 ++- .../alm/client}/github/GithubPermissionConverterTest.java | 3 ++- .../almintegration/ws/github/ImportGithubProjectActionIT.java | 2 +- .../org/sonar/server/almsettings/ws/GithubProjectCreator.java | 2 +- .../server/almsettings/ws/GithubProjectCreatorFactory.java | 2 +- .../server/almsettings/ws/GithubProjectCreatorFactoryTest.java | 2 +- .../sonar/server/almsettings/ws/GithubProjectCreatorTest.java | 2 +- .../sonar/server/platform/platformlevel/PlatformLevel4.java | 2 +- 8 files changed, 10 insertions(+), 8 deletions(-) rename server/{sonar-auth-github/src/main/java/org/sonar/auth => sonar-alm-client/src/main/java/org/sonar/alm/client}/github/GithubPermissionConverter.java (98%) rename server/{sonar-auth-github/src/test/java/org/sonar/auth => sonar-alm-client/src/test/java/org/sonar/alm/client}/github/GithubPermissionConverterTest.java (98%) diff --git a/server/sonar-auth-github/src/main/java/org/sonar/auth/github/GithubPermissionConverter.java b/server/sonar-alm-client/src/main/java/org/sonar/alm/client/github/GithubPermissionConverter.java similarity index 98% rename from server/sonar-auth-github/src/main/java/org/sonar/auth/github/GithubPermissionConverter.java rename to server/sonar-alm-client/src/main/java/org/sonar/alm/client/github/GithubPermissionConverter.java index e2833370654..7317ea5816b 100644 --- a/server/sonar-auth-github/src/main/java/org/sonar/auth/github/GithubPermissionConverter.java +++ b/server/sonar-alm-client/src/main/java/org/sonar/alm/client/github/GithubPermissionConverter.java @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package org.sonar.auth.github; +package org.sonar.alm.client.github; import java.util.List; import java.util.Map; @@ -27,6 +27,7 @@ import java.util.stream.Collectors; import javax.annotation.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.sonar.auth.github.GsonRepositoryPermissions; import org.sonar.db.provisioning.GithubPermissionsMappingDto; import static java.util.function.Function.identity; diff --git a/server/sonar-auth-github/src/test/java/org/sonar/auth/github/GithubPermissionConverterTest.java b/server/sonar-alm-client/src/test/java/org/sonar/alm/client/github/GithubPermissionConverterTest.java similarity index 98% rename from server/sonar-auth-github/src/test/java/org/sonar/auth/github/GithubPermissionConverterTest.java rename to server/sonar-alm-client/src/test/java/org/sonar/alm/client/github/GithubPermissionConverterTest.java index 13e912777cf..c548b9faa91 100644 --- a/server/sonar-auth-github/src/test/java/org/sonar/auth/github/GithubPermissionConverterTest.java +++ b/server/sonar-alm-client/src/test/java/org/sonar/alm/client/github/GithubPermissionConverterTest.java @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package org.sonar.auth.github; +package org.sonar.alm.client.github; import java.util.Arrays; import java.util.Set; @@ -25,6 +25,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Suite; +import org.sonar.auth.github.GsonRepositoryPermissions; import org.sonar.db.provisioning.GithubPermissionsMappingDto; import static org.assertj.core.api.Assertions.assertThat; diff --git a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/almintegration/ws/github/ImportGithubProjectActionIT.java b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/almintegration/ws/github/ImportGithubProjectActionIT.java index ad6d8530366..1d0ec3fe34d 100644 --- a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/almintegration/ws/github/ImportGithubProjectActionIT.java +++ b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/almintegration/ws/github/ImportGithubProjectActionIT.java @@ -33,7 +33,7 @@ import org.sonar.api.resources.Qualifiers; import org.sonar.api.server.ws.WebService; import org.sonar.api.utils.System2; import org.sonar.auth.github.GitHubSettings; -import org.sonar.auth.github.GithubPermissionConverter; +import org.sonar.alm.client.github.GithubPermissionConverter; import org.sonar.auth.github.GsonRepositoryPermissions; import org.sonar.core.i18n.I18n; import org.sonar.core.platform.EditionProvider; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/GithubProjectCreator.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/GithubProjectCreator.java index 78375ca81e8..d3e56a58f28 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/GithubProjectCreator.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/GithubProjectCreator.java @@ -29,7 +29,7 @@ import org.sonar.alm.client.github.api.GsonRepositoryCollaborator; import org.sonar.alm.client.github.api.GsonRepositoryTeam; import org.sonar.alm.client.github.security.AccessToken; import org.sonar.api.web.UserRole; -import org.sonar.auth.github.GithubPermissionConverter; +import org.sonar.alm.client.github.GithubPermissionConverter; import org.sonar.auth.github.GsonRepositoryPermissions; import org.sonar.db.DbClient; import org.sonar.db.DbSession; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/GithubProjectCreatorFactory.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/GithubProjectCreatorFactory.java index 3e53735d8e1..5a4245117f4 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/GithubProjectCreatorFactory.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/GithubProjectCreatorFactory.java @@ -30,7 +30,7 @@ import org.sonar.alm.client.github.config.GithubAppConfiguration; import org.sonar.alm.client.github.security.AccessToken; import org.sonar.api.server.ServerSide; import org.sonar.auth.github.GitHubSettings; -import org.sonar.auth.github.GithubPermissionConverter; +import org.sonar.alm.client.github.GithubPermissionConverter; import org.sonar.db.DbClient; import org.sonar.db.DbSession; import org.sonar.db.alm.setting.ALM; diff --git a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/almsettings/ws/GithubProjectCreatorFactoryTest.java b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/almsettings/ws/GithubProjectCreatorFactoryTest.java index 4bd1b777dfe..f5fc66ed371 100644 --- a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/almsettings/ws/GithubProjectCreatorFactoryTest.java +++ b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/almsettings/ws/GithubProjectCreatorFactoryTest.java @@ -32,7 +32,7 @@ import org.sonar.alm.client.github.AppInstallationToken; import org.sonar.alm.client.github.GithubApplicationClient; import org.sonar.alm.client.github.GithubGlobalSettingsValidator; import org.sonar.auth.github.GitHubSettings; -import org.sonar.auth.github.GithubPermissionConverter; +import org.sonar.alm.client.github.GithubPermissionConverter; import org.sonar.db.DbClient; import org.sonar.db.DbSession; import org.sonar.db.alm.setting.ALM; diff --git a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/almsettings/ws/GithubProjectCreatorTest.java b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/almsettings/ws/GithubProjectCreatorTest.java index 6e8d4411f57..a39261b2945 100644 --- a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/almsettings/ws/GithubProjectCreatorTest.java +++ b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/almsettings/ws/GithubProjectCreatorTest.java @@ -38,7 +38,7 @@ import org.sonar.alm.client.github.api.GsonRepositoryTeam; import org.sonar.alm.client.github.security.AccessToken; import org.sonar.api.resources.Qualifiers; import org.sonar.api.web.UserRole; -import org.sonar.auth.github.GithubPermissionConverter; +import org.sonar.alm.client.github.GithubPermissionConverter; import org.sonar.auth.github.GsonRepositoryPermissions; import org.sonar.db.DbClient; import org.sonar.db.alm.setting.ALM; diff --git a/server/sonar-webserver/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java b/server/sonar-webserver/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java index 06af9331eb1..c55b30243a9 100644 --- a/server/sonar-webserver/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java +++ b/server/sonar-webserver/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java @@ -41,7 +41,7 @@ import org.sonar.api.server.rule.RulesDefinitionXmlLoader; import org.sonar.auth.bitbucket.BitbucketModule; import org.sonar.auth.github.GitHubModule; import org.sonar.auth.github.GitHubSettings; -import org.sonar.auth.github.GithubPermissionConverter; +import org.sonar.alm.client.github.GithubPermissionConverter; import org.sonar.auth.gitlab.GitLabModule; import org.sonar.auth.ldap.LdapModule; import org.sonar.auth.saml.SamlModule; -- 2.39.5