From bbcebfbff720e5e72b2dfdc4f0b45137e7a9ce00 Mon Sep 17 00:00:00 2001 From: Max Shaposhnik Date: Fri, 21 May 2021 12:27:02 +0300 Subject: [PATCH] Provide scm info in factory v2 --- .../che/api/core/model/factory/ScmInfo.java | 21 ++ .../pom.xml | 6 +- ...rAuthorizingFactoryParametersResolver.java | 16 +- .../server/bitbucket/BitbucketUrl.java | 9 +- .../bitbucket/server/BitbucketUser.java | 2 +- ...horizingFactoryParametersResolverTest.java | 33 +++- wsmaster/che-core-api-factory-github/pom.xml | 6 +- .../GithubFactoryParametersResolver.java | 19 +- .../api/factory/server/github/GithubUrl.java | 11 +- .../GithubFactoryParametersResolverTest.java | 33 +++- .../factory/server/github/GithubUrlTest.java | 4 +- wsmaster/che-core-api-factory-gitlab/pom.xml | 6 +- .../GitlabFactoryParametersResolver.java | 16 +- .../api/factory/server/gitlab/GitlabUrl.java | 9 +- .../GitlabFactoryParametersResolverTest.java | 183 ++++++++++++++++++ .../shared/dto/FactoryDevfileV2Dto.java | 10 +- .../api/factory/shared/dto/ScmInfoDto.java | 43 ++++ .../server/urlfactory/DefaultFactoryUrl.java | 12 +- .../server/urlfactory/RemoteFactoryUrl.java | 8 +- .../urlfactory/URLFactoryBuilderTest.java | 12 +- 20 files changed, 438 insertions(+), 21 deletions(-) create mode 100644 core/che-core-api-model/src/main/java/org/eclipse/che/api/core/model/factory/ScmInfo.java create mode 100644 wsmaster/che-core-api-factory-gitlab/src/test/java/org/eclipse/che/api/factory/server/gitlab/GitlabFactoryParametersResolverTest.java create mode 100644 wsmaster/che-core-api-factory-shared/src/main/java/org/eclipse/che/api/factory/shared/dto/ScmInfoDto.java diff --git a/core/che-core-api-model/src/main/java/org/eclipse/che/api/core/model/factory/ScmInfo.java b/core/che-core-api-model/src/main/java/org/eclipse/che/api/core/model/factory/ScmInfo.java new file mode 100644 index 0000000000..85c2cb9c30 --- /dev/null +++ b/core/che-core-api-model/src/main/java/org/eclipse/che/api/core/model/factory/ScmInfo.java @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2012-2018 Red Hat, Inc. + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Red Hat, Inc. - initial API and implementation + */ +package org.eclipse.che.api.core.model.factory; + +/** Defines the contract for the SCM information. */ +public interface ScmInfo { + String getScmProviderName(); + + String getRepositoryUrl(); + + String getBranch(); +} diff --git a/wsmaster/che-core-api-factory-bitbucket-server/pom.xml b/wsmaster/che-core-api-factory-bitbucket-server/pom.xml index 9a82347dc0..c21b9cf206 100644 --- a/wsmaster/che-core-api-factory-bitbucket-server/pom.xml +++ b/wsmaster/che-core-api-factory-bitbucket-server/pom.xml @@ -1,7 +1,7 @@