From 8e4e05f18e57f97c7d3fd26b3953881ab75e59c0 Mon Sep 17 00:00:00 2001 From: Pavel_Bortnik Date: Thu, 21 Jul 2022 16:24:40 +0300 Subject: [PATCH 1/4] EPMRPP-77871 || Remove api key confirmation at posting issue --- .../extension/bugtracking/rally/RallyStrategy.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/main/java/com/epam/reportportal/extension/bugtracking/rally/RallyStrategy.java b/src/main/java/com/epam/reportportal/extension/bugtracking/rally/RallyStrategy.java index 0057a1d..860edde 100644 --- a/src/main/java/com/epam/reportportal/extension/bugtracking/rally/RallyStrategy.java +++ b/src/main/java/com/epam/reportportal/extension/bugtracking/rally/RallyStrategy.java @@ -170,7 +170,7 @@ public Optional getTicket(final String id, Integration integration) { @Override public Ticket submitTicket(final PostTicketRQ ticketRQ, Integration integration) { - try (RallyRestApi restApi = getClient(integration.getParams(), ticketRQ)) { + try (RallyRestApi restApi = getClient(integration.getParams())) { List logs = ofNullable(ticketAssembler.get().apply(ticketRQ).getLogs()).orElseGet(Lists::newArrayList); Defect newDefect = postDefect(restApi, ticketRQ, integration); @@ -248,15 +248,6 @@ public RallyRestApi getClient(IntegrationParams params) throws URISyntaxExceptio return new RallyRestApi(new URI(url), apiKey); } - public RallyRestApi getClient(IntegrationParams params, PostTicketRQ postTicketRQ) throws URISyntaxException { - String url = BtsConstants.URL.getParam(params, String.class) - .orElseThrow(() -> new ReportPortalException(UNABLE_INTERACT_WITH_INTEGRATION, "Rally URL value cannot be NULL")); - String apiKey = ofNullable(postTicketRQ.getToken()).orElseThrow(() -> new ReportPortalException(UNABLE_INTERACT_WITH_INTEGRATION, - "OAUTH key cannot be NULL" - )); - return new RallyRestApi(new URI(url), apiKey); - } - private Ticket toTicket(Defect defect, Integration externalSystem) { Ticket ticket = new Ticket(); String link = From fb983d7ba4ee05bd7b642eb9f74881d492f45dec Mon Sep 17 00:00:00 2001 From: APiankouski <109206864+APiankouski@users.noreply.github.com> Date: Tue, 8 Aug 2023 12:49:48 +0300 Subject: [PATCH 2/4] Merge master to develop (#27) * [Gradle Release Plugin] - new version commit: '5.7.1'. * [Gradle Release Plugin] - new version commit: '5.7.2'. * Downgrade gradlew version * [Gradle Release Plugin] - new version commit: '5.7.3'. * 5.7.0 || Update release version * [Gradle Release Plugin] - new version commit: '5.7.1'. * EPMRPP-78476 || Add promote task * [Gradle Release Plugin] - new version commit: '5.7.2'. * EPMRPP-77871 || Remove api key confirmation at posting issue (cherry picked from commit 8e4e05f18e57f97c7d3fd26b3953881ab75e59c0) * Update version * [Gradle Release Plugin] - new version commit: '23.2'. * Update version * [Gradle Release Plugin] - new version commit: '5.7.3'. --------- Co-authored-by: Pavel Bortnik Co-authored-by: reportportal.io Co-authored-by: Andrei Piankouski --- .github/workflows/promote.yml | 101 +++++++++++++++++++++++ build.gradle | 5 +- gradle.properties | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 4 files changed, 106 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/promote.yml diff --git a/.github/workflows/promote.yml b/.github/workflows/promote.yml new file mode 100644 index 0000000..0174d39 --- /dev/null +++ b/.github/workflows/promote.yml @@ -0,0 +1,101 @@ +# Copyright 2021 EPAM Systems +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Promote + +on: + workflow_dispatch: + inputs: + version: + description: 'Release version' + required: true + +env: + REPOSITORY_URL: 'https://maven.pkg.github.com' + UPSTREAM_REPOSITORY_URL: 'https://oss.sonatype.org' + PACKAGE_SUFFIXES: '-javadoc.jar,-javadoc.jar.asc,-sources.jar,-sources.jar.asc,.jar,.jar.asc,.pom,.pom.asc' + PACKAGE: 'com.epam.reportportal' + + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Get variables + run: | + echo "ARTIFACT=`echo ${{ github.repository }} | cut -d/ -f2- | awk '{print tolower($0)}'`" >> $GITHUB_ENV + echo "PACKAGE_PATH=`echo ${{ env.PACKAGE }} | sed 's/\./\//g'`" >> $GITHUB_ENV + - name: Upload package + run: | + IFS=',' read -a files <<< '${{ env.PACKAGE_SUFFIXES }}' + for f in ${files[@]}; do + export URL="${{ env.REPOSITORY_URL }}/${{ github.repository }}/${PACKAGE_PATH}/${ARTIFACT}/${{ github.event.inputs.version }}/${ARTIFACT}-${{ github.event.inputs.version }}${f}" + echo "Downloading artifact: ${URL}" + curl -f -u ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} -s -O -L "${URL}" + done + files=($(ls)) + echo 'Files downloaded:' + echo "${files[@]}" + echo 'Bundle generation' + export BUNDLE_FILE="bundle.jar" + jar -cvf ${BUNDLE_FILE} "${files[@]}" + echo 'Bundle upload' + curl -f -u ${{ secrets.SONATYPE_USER }}:${{ secrets.SONATYPE_PASSWORD }} -L \ + --request POST '${{ env.UPSTREAM_REPOSITORY_URL }}/service/local/staging/bundle_upload' \ + --form "file=@${BUNDLE_FILE}" >response.json + response_type=`jq type response.json || echo ''` + if [ -z "$response_type" ]; then + echo 'ERROR: Response is not JSON!' 1>&2 + cat response.json 1>&2 + exit 1 + fi + repo=`jq -r '.repositoryUris[0]' response.json` + if [ -z "$repo" ]; then + echo 'Unable to upload bundle' 1>&2 + cat response.json 1>&2 + exit 1 + fi + echo "NEXUS_REPOSITORY=${repo}" >> $GITHUB_ENV + - name: Get repository variables + run: | + echo "NEXUS_REPOSITORY_NAME=`echo ${NEXUS_REPOSITORY} | sed -E 's/(.+)\/([^\/]+)$/\2/'`" >> $GITHUB_ENV + - name: Promote package + env: + ATTEMPTS: 60 + SLEEP_TIME: 10 + run: | + verified=false + for i in `seq 0 ${ATTEMPTS}`; do + sleep $SLEEP_TIME + curl -f -s -u ${{ secrets.SONATYPE_USER }}:${{ secrets.SONATYPE_PASSWORD }} -L \ + --header 'Accept: application/json' \ + ${{ env.UPSTREAM_REPOSITORY_URL }}/service/local/staging/repository/${NEXUS_REPOSITORY_NAME} >result.json + is_closed=`jq -r '.type' result.json` + is_transitioning=`jq -r '.transitioning' result.json` + echo "Current repository status: $is_closed; transitioning: $is_transitioning" + if [[ "$is_closed" == "closed" && "$is_transitioning" == "false" ]]; then + verified=true + break + fi + done + if $verified; then + echo "A bundle was verified, releasing" + curl -f -u ${{ secrets.SONATYPE_USER }}:${{ secrets.SONATYPE_PASSWORD }} -L \ + --header 'Content-Type: application/json' \ + --data-raw "{\"data\":{\"stagedRepositoryIds\":[\"${NEXUS_REPOSITORY_NAME}\"], \"description\":\"Releasing ${{ github.event.inputs.version }}\"}}" \ + --request POST ${{ env.UPSTREAM_REPOSITORY_URL }}/service/local/staging/bulk/promote + else + echo 'Verification failed, please check the bundle' 1>&2 + exit 1 + fi diff --git a/build.gradle b/build.gradle index 74935c3..5a9e188 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id "io.spring.dependency-management" version "1.0.8.RELEASE" + id "io.spring.dependency-management" version "1.0.9.RELEASE" id 'java' id 'jacoco' } @@ -64,7 +64,7 @@ dependencies { } wrapper { - gradleVersion = '6.0' + gradleVersion = '5.4.1' } generatePomFileForShadowPublication { pom.packaging = "jar" } @@ -83,6 +83,7 @@ jar { } shadowJar { + archiveClassifier.set(null) zip64 true dependencies { include(dependency('com.google.guava:guava')) diff --git a/gradle.properties b/gradle.properties index 80f5925..0b1d161 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ -version=5.7.0 +version=5.7.3 description=EPAM Report portal. Rally Integration Plugin diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f6bd9eb..803ab1c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ #Sun Feb 16 21:55:33 MSK 2020 -distributionUrl=https\://services.gradle.org/distributions/gradle-6.0-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStorePath=wrapper/dists From bd4a408a888bcdd276c0efc8087ef5a23ef8a466 Mon Sep 17 00:00:00 2001 From: Andrei Piankouski Date: Tue, 29 Aug 2023 14:37:11 +0300 Subject: [PATCH 3/4] EPMRPP-78914 || Redesign integrations. Link updates --- .../extension/bugtracking/rally/RallyStrategy.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/epam/reportportal/extension/bugtracking/rally/RallyStrategy.java b/src/main/java/com/epam/reportportal/extension/bugtracking/rally/RallyStrategy.java index 860edde..8a81eb3 100644 --- a/src/main/java/com/epam/reportportal/extension/bugtracking/rally/RallyStrategy.java +++ b/src/main/java/com/epam/reportportal/extension/bugtracking/rally/RallyStrategy.java @@ -86,6 +86,8 @@ @Component public class RallyStrategy implements ReportPortalExtensionPoint, BtsExtension { + private static final String DOCUMENTATION_LINK_FIELD = "documentationLink"; + private static final String DOCUMENTATION_LINK = "https://reportportal.io/docs/plugins/Rally"; private static final String BUG_TEMPLATE_PATH = "bug_template.ftl"; private static final Logger LOGGER = LoggerFactory.getLogger(RallyStrategy.class); @@ -113,7 +115,9 @@ public class RallyStrategy implements ReportPortalExtensionPoint, BtsExtension { @Override public Map getPluginParams() { - return Collections.emptyMap(); + Map params = new HashMap<>(); + params.put(DOCUMENTATION_LINK_FIELD, DOCUMENTATION_LINK); + return params; } @Override From 70cebfbdb2dacc31267386d81a0a0f1e9495ab4f Mon Sep 17 00:00:00 2001 From: Pavel Bortnik Date: Wed, 20 Dec 2023 17:38:19 +0300 Subject: [PATCH 4/4] rc/5.11.0 || Update release version --- .github/workflows/build.yml | 40 +++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 4 ++-- build.gradle | 21 ++++++------------ gradle.properties | 2 +- 4 files changed, 49 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..a508772 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,40 @@ +name: Build + +on: + pull_request: + push: + branches: + - master + - develop + paths-ignore: + - '.github/**' + - README.md + - gradle.properties + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '11' + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Setup git credentials + uses: oleksiyrudenko/gha-git-credentials@v2 + with: + name: 'reportportal.io' + email: 'support@reportportal.io' + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Build with Gradle + id: build + run: | + ./gradlew build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c077461..b0cb800 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,8 +11,8 @@ on: env: GH_USER_NAME: github.actor - SCRIPTS_VERSION: 5.7.0 - BOM_VERSION: 5.7.0 + SCRIPTS_VERSION: 5.10.0 + BOM_VERSION: 5.11.2 REPOSITORY_URL: 'https://maven.pkg.github.com/' jobs: diff --git a/build.gradle b/build.gradle index 5a9e188..d3e0a53 100644 --- a/build.gradle +++ b/build.gradle @@ -24,25 +24,16 @@ sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 repositories { - mavenCentral() - if (releaseMode) { - dependencyRepos.forEach { path -> - maven { - setUrl("https://maven.pkg.github.com/reportportal/${path}") - credentials { - username = findProperty("githubUserName") - password = findProperty("githubToken") - } - } - } - } else { + mavenCentral { url "https://repo1.maven.org/maven2" } + + if (!releaseMode) { maven { url 'https://jitpack.io' } } } dependencyManagement { imports { - mavenBom(releaseMode ? 'com.epam.reportportal:commons-bom:' + getProperty('bom.version') : 'com.github.reportportal:commons-bom:5.7.0') + mavenBom(releaseMode ? 'com.epam.reportportal:commons-bom:' + getProperty('bom.version') : 'com.epam.reportportal:commons-bom:5.11.2') } } @@ -52,8 +43,8 @@ dependencies { annotationProcessor 'com.epam.reportportal:plugin-api' } else { - implementation 'com.github.reportportal:plugin-api:5.7.0' - annotationProcessor 'com.github.reportportal:plugin-api:5.7.0' + implementation 'com.epam.reportportal:plugin-api' + annotationProcessor 'com.epam.reportportal:plugin-api' } compile 'com.rallydev.rest:rally-rest-api:2.2.1' diff --git a/gradle.properties b/gradle.properties index 0b1d161..353f051 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ -version=5.7.3 +version=5.11.0 description=EPAM Report portal. Rally Integration Plugin