From 5766ddede901dc26f25a349adf82fcc7404c94a8 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Fri, 21 Jun 2024 19:13:00 +0200 Subject: [PATCH 01/44] chore(build):[#222] remove "Push image (GHCR)" --- .github/workflows/irs-build.yml | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/.github/workflows/irs-build.yml b/.github/workflows/irs-build.yml index 21cdfb8d3b..184ddf0e10 100644 --- a/.github/workflows/irs-build.yml +++ b/.github/workflows/irs-build.yml @@ -125,25 +125,7 @@ jobs: # This is where you will update the PAT to GITHUB_TOKEN run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - name: Push image (GHCR) - env: - DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }} - if: >- - env.DOCKER_HUB_USER == '' && - (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && - github.actor != 'dependabot[bot]' - run: | - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/${{ matrix.image }} - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - echo IMAGE_ID=$IMAGE_ID - docker tag ${{ matrix.image }} $IMAGE_ID:${{ steps.version.outputs.image_tag }} - docker push $IMAGE_ID:${{ steps.version.outputs.image_tag }} - - docker tag ${{ matrix.image }} $IMAGE_ID:$GITHUB_SHA - docker push $IMAGE_ID:$GITHUB_SHA - - name: Login to Docker Hub env: DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }} @@ -162,6 +144,9 @@ jobs: run: | docker tag ${{ matrix.image }} ${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.image_tag }} docker push ${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.image_tag }} + + docker tag ${{ matrix.image }} $IMAGE_ID:$GITHUB_SHA + docker push $IMAGE_ID:$GITHUB_SHA # https://github.com/peter-evans/dockerhub-description - name: Update Docker Hub description From 27e9923f910beba03cc1e8faba0e7d31776dbca8 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Mon, 24 Jun 2024 17:15:17 +0200 Subject: [PATCH 02/44] chore(build):[#222] update documentation --- .github/workflows/irs-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/irs-build.yml b/.github/workflows/irs-build.yml index 184ddf0e10..406741cf2c 100644 --- a/.github/workflows/irs-build.yml +++ b/.github/workflows/irs-build.yml @@ -122,7 +122,7 @@ jobs: env.DOCKER_HUB_USER == '' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && github.actor != 'dependabot[bot]' - # This is where you will update the PAT to GITHUB_TOKEN + # This is where you will update the personal access token to GITHUB_TOKEN run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin From 790eef14fa13020a6c675cf4e3f5d24dc774e426 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Mon, 24 Jun 2024 17:29:06 +0200 Subject: [PATCH 03/44] chore(build):[#222] analyze_with_Sonar only if tokens available --- .github/workflows/irs-build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/irs-build.yml b/.github/workflows/irs-build.yml index 406741cf2c..6f406502fc 100644 --- a/.github/workflows/irs-build.yml +++ b/.github/workflows/irs-build.yml @@ -46,8 +46,9 @@ jobs: analyze_with_Sonar: # No need to run if we cannot use the sonar token if: >- - (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && - github.actor != 'dependabot[bot]' + (secrets.GITHUB_TOKEN != '' && secrets.SONAR_TOKEN != '') + && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) + && github.actor != 'dependabot[bot]' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From d93869069ff3a639535057aeb1fe4eadf340ec7f Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Mon, 24 Jun 2024 17:46:20 +0200 Subject: [PATCH 04/44] chore(build):[#222] fix previous commit - fix "Unrecognized named-value: 'secrets'." - set env on job level to make it available in all steps - analyze_with_Sonar only if relevant secrets available --- .github/workflows/irs-build.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/irs-build.yml b/.github/workflows/irs-build.yml index 6f406502fc..72043040e3 100644 --- a/.github/workflows/irs-build.yml +++ b/.github/workflows/irs-build.yml @@ -44,9 +44,14 @@ jobs: mvn clean verify --batch-mode analyze_with_Sonar: + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_PROJECT_KEY: ${{ secret.SONAR_PROJECT_KEY }} + SONAR_ORGANIZATION: ${{ secrets.SONAR_ORGANIZATION }} # No need to run if we cannot use the sonar token if: >- - (secrets.GITHUB_TOKEN != '' && secrets.SONAR_TOKEN != '') + (env.GITHUB_TOKEN != '' && env.SONAR_TOKEN != '' && SONAR_PROJECT_KEY != '' && SONAR_ORGANIZATION != '') && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && github.actor != 'dependabot[bot]' runs-on: ubuntu-latest @@ -76,9 +81,6 @@ jobs: restore-keys: ${{ runner.os }}-sonar - name: Analyze with Sonar - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: | mvn --batch-mode --update-snapshots verify \ org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ From 881304e55a1ba93fd819f729f29eb2e1c1eb0490 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Mon, 24 Jun 2024 17:48:09 +0200 Subject: [PATCH 05/44] chore(build):[#222] fix previous commit - fix "Unrecognized named-value: 'secret'." --- .github/workflows/irs-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/irs-build.yml b/.github/workflows/irs-build.yml index 72043040e3..77c4694add 100644 --- a/.github/workflows/irs-build.yml +++ b/.github/workflows/irs-build.yml @@ -47,7 +47,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - SONAR_PROJECT_KEY: ${{ secret.SONAR_PROJECT_KEY }} + SONAR_PROJECT_KEY: ${{ secrets.SONAR_PROJECT_KEY }} SONAR_ORGANIZATION: ${{ secrets.SONAR_ORGANIZATION }} # No need to run if we cannot use the sonar token if: >- From 6013edfcf2dec103fda986a81643b8d50e3a9be5 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Mon, 24 Jun 2024 17:51:17 +0200 Subject: [PATCH 06/44] chore(build):[#222] fix previous commit - missing env prefix --- .github/workflows/irs-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/irs-build.yml b/.github/workflows/irs-build.yml index 77c4694add..18f76f67bb 100644 --- a/.github/workflows/irs-build.yml +++ b/.github/workflows/irs-build.yml @@ -51,7 +51,7 @@ jobs: SONAR_ORGANIZATION: ${{ secrets.SONAR_ORGANIZATION }} # No need to run if we cannot use the sonar token if: >- - (env.GITHUB_TOKEN != '' && env.SONAR_TOKEN != '' && SONAR_PROJECT_KEY != '' && SONAR_ORGANIZATION != '') + (env.GITHUB_TOKEN != '' && env.SONAR_TOKEN != '' && env.SONAR_PROJECT_KEY != '' && env.SONAR_ORGANIZATION != '') && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && github.actor != 'dependabot[bot]' runs-on: ubuntu-latest From 67b1d1f823854357ba434bf69896b45e8f79bb27 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Mon, 24 Jun 2024 18:03:50 +0200 Subject: [PATCH 07/44] chore(build):[#222] trial to fix previous commit - move by env to workflow level - deduplicate --- .github/workflows/irs-build.yml | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/.github/workflows/irs-build.yml b/.github/workflows/irs-build.yml index 18f76f67bb..ef65fb6bfb 100644 --- a/.github/workflows/irs-build.yml +++ b/.github/workflows/irs-build.yml @@ -18,6 +18,14 @@ on: tags: - '**' +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_PROJECT_KEY: ${{ secrets.SONAR_PROJECT_KEY }} + SONAR_ORGANIZATION: ${{ secrets.SONAR_ORGANIZATION }} + DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }} + IMAGE_NAMESPACE: tractusx + IMAGE_NAME: irs-api jobs: build: @@ -44,11 +52,6 @@ jobs: mvn clean verify --batch-mode analyze_with_Sonar: - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - SONAR_PROJECT_KEY: ${{ secrets.SONAR_PROJECT_KEY }} - SONAR_ORGANIZATION: ${{ secrets.SONAR_ORGANIZATION }} # No need to run if we cannot use the sonar token if: >- (env.GITHUB_TOKEN != '' && env.SONAR_TOKEN != '' && env.SONAR_PROJECT_KEY != '' && env.SONAR_ORGANIZATION != '') @@ -119,8 +122,6 @@ jobs: echo "::set-output name=image_tag::$VERSION" - name: Log in to registry - env: - DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }} if: >- env.DOCKER_HUB_USER == '' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && @@ -130,8 +131,6 @@ jobs: - name: Login to Docker Hub - env: - DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }} if: env.DOCKER_HUB_USER != '' uses: docker/login-action@v3 with: @@ -139,10 +138,6 @@ jobs: password: ${{ secrets.DOCKER_HUB_TOKEN }} - name: Push image (DockerHub) - env: - DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }} - IMAGE_NAMESPACE: tractusx - IMAGE_NAME: irs-api if: env.DOCKER_HUB_USER != '' run: | docker tag ${{ matrix.image }} ${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.image_tag }} @@ -153,10 +148,6 @@ jobs: # https://github.com/peter-evans/dockerhub-description - name: Update Docker Hub description - env: - DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }} - IMAGE_NAMESPACE: tractusx - IMAGE_NAME: irs-api if: env.DOCKER_HUB_USER != '' && github.event_name != 'pull_request' uses: peter-evans/dockerhub-description@v4 with: From 8962323a8f94af84f04d599a89f69e9fe886402c Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Mon, 24 Jun 2024 18:08:38 +0200 Subject: [PATCH 08/44] chore(build):[#222] trial to fix previous commit --- .github/workflows/irs-build.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/irs-build.yml b/.github/workflows/irs-build.yml index ef65fb6bfb..f8405854cd 100644 --- a/.github/workflows/irs-build.yml +++ b/.github/workflows/irs-build.yml @@ -53,10 +53,7 @@ jobs: analyze_with_Sonar: # No need to run if we cannot use the sonar token - if: >- - (env.GITHUB_TOKEN != '' && env.SONAR_TOKEN != '' && env.SONAR_PROJECT_KEY != '' && env.SONAR_ORGANIZATION != '') - && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) - && github.actor != 'dependabot[bot]' + if: (env.GITHUB_TOKEN != '' && env.SONAR_TOKEN != '' && env.SONAR_PROJECT_KEY != '' && env.SONAR_ORGANIZATION != '') && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && github.actor != 'dependabot[bot]' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From ca6fe1d123ab59781045276b84353019b623bc66 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Mon, 24 Jun 2024 20:39:51 +0200 Subject: [PATCH 09/44] chore(build):[#222] trial to fix "Unrecognized named-value: 'env'" --- .github/workflows/irs-build.yml | 44 +++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/.github/workflows/irs-build.yml b/.github/workflows/irs-build.yml index f8405854cd..2db25c7287 100644 --- a/.github/workflows/irs-build.yml +++ b/.github/workflows/irs-build.yml @@ -24,10 +24,22 @@ env: SONAR_PROJECT_KEY: ${{ secrets.SONAR_PROJECT_KEY }} SONAR_ORGANIZATION: ${{ secrets.SONAR_ORGANIZATION }} DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }} - IMAGE_NAMESPACE: tractusx - IMAGE_NAME: irs-api jobs: + init: + runs-on: ubuntu-latest + steps: + - run: echo "Preparing variables" + outputs: + image_namespace: tractusx + image_name: irs-api + github_token: ${{ env.GITHUB_TOKEN }} + sonar_token: ${{ env.SONAR_TOKEN }} + sonar_project_key: ${{ env.SONAR_PROJECT_KEY }} + sonar_organization: ${{ env.SONAR_ORGANIZATION }} + docker_hub_user: ${{ env.DOCKER_HUB_USER }} + + build: runs-on: ubuntu-latest steps: @@ -52,8 +64,13 @@ jobs: mvn clean verify --batch-mode analyze_with_Sonar: + needs: [init] # No need to run if we cannot use the sonar token - if: (env.GITHUB_TOKEN != '' && env.SONAR_TOKEN != '' && env.SONAR_PROJECT_KEY != '' && env.SONAR_ORGANIZATION != '') && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && github.actor != 'dependabot[bot]' + if: >- + (needs.init.outputs.github_token != '' && needs.init.outputs.sonar_token != '' + && needs.init.outputs.sonar_project_key != '' && needs.init.outputs.sonar_organization != '') + && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) + && github.actor != 'dependabot[bot]' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -84,10 +101,11 @@ jobs: run: | mvn --batch-mode --update-snapshots verify \ org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ - -Dsonar.projectKey=${{ secrets.SONAR_PROJECT_KEY }} -Dsonar.organization=${{ secrets.SONAR_ORGANIZATION }} \ + -Dsonar.projectKey=${{ needs.init.outputs.sonar_project_key }} -Dsonar.organization=${{ needs.init.outputs.sonar_organization }} \ -Dcheckstyle.skip -Dpmd.skip=true build_images: + needs: [init] strategy: matrix: image: @@ -120,7 +138,7 @@ jobs: - name: Log in to registry if: >- - env.DOCKER_HUB_USER == '' && + needs.init.outputs.docker_hub_user == '' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && github.actor != 'dependabot[bot]' # This is where you will update the personal access token to GITHUB_TOKEN @@ -128,29 +146,29 @@ jobs: - name: Login to Docker Hub - if: env.DOCKER_HUB_USER != '' + if: needs.init.outputs.docker_hub_user != '' uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKER_HUB_USER }} - password: ${{ secrets.DOCKER_HUB_TOKEN }} + username: ${{ needs.init.outputs.docker_hub_user }} + password: ${{ needs.init.outputs.docker_hub_token }} - name: Push image (DockerHub) - if: env.DOCKER_HUB_USER != '' + if: needs.init.outputs.DOCKER_HUB_USER != '' run: | - docker tag ${{ matrix.image }} ${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.image_tag }} - docker push ${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.image_tag }} + docker tag ${{ matrix.image }} ${{ needs.init.outputs.image_namespace }}/${{ needs.init.outputs.image_name }}:${{ steps.version.outputs.image_tag }} + docker push ${{ needs.init.outputs.image_namespace }}/${{ needs.init.outputs.image_name }}:${{ steps.version.outputs.image_tag }} docker tag ${{ matrix.image }} $IMAGE_ID:$GITHUB_SHA docker push $IMAGE_ID:$GITHUB_SHA # https://github.com/peter-evans/dockerhub-description - name: Update Docker Hub description - if: env.DOCKER_HUB_USER != '' && github.event_name != 'pull_request' + if: needs.init.outputs.DOCKER_HUB_USER != '' && github.event_name != 'pull_request' uses: peter-evans/dockerhub-description@v4 with: username: ${{ secrets.DOCKER_HUB_USER }} password: ${{ secrets.DOCKER_HUB_TOKEN }} - repository: ${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }} + repository: ${{ needs.init.outputs.image_namespace }}/${{ needs.init.outputs.image_name }} readme-filepath: ./DOCKER_NOTICE.md trigger-trivy-image-scan: From 8138eb24ef5349817f72dc29903160f16269124f Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Mon, 24 Jun 2024 22:26:05 +0200 Subject: [PATCH 10/44] chore(build):[#222] trial to fix "Skip output 'github_token' since it may contain secret." --- .github/workflows/irs-build.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/irs-build.yml b/.github/workflows/irs-build.yml index 2db25c7287..7ea9ccee3b 100644 --- a/.github/workflows/irs-build.yml +++ b/.github/workflows/irs-build.yml @@ -19,11 +19,11 @@ on: - '**' env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_PROJECT_KEY: ${{ secrets.SONAR_PROJECT_KEY }} SONAR_ORGANIZATION: ${{ secrets.SONAR_ORGANIZATION }} DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }} + SONAR_TOKEN_AVAILABLE: ${{ secrets.SONAR_TOKEN != '' }} + GITHUB_TOKEN_AVAILABLE: ${{ secrets.GITHUB_TOKEN != '' }} jobs: init: @@ -33,13 +33,10 @@ jobs: outputs: image_namespace: tractusx image_name: irs-api - github_token: ${{ env.GITHUB_TOKEN }} - sonar_token: ${{ env.SONAR_TOKEN }} sonar_project_key: ${{ env.SONAR_PROJECT_KEY }} sonar_organization: ${{ env.SONAR_ORGANIZATION }} docker_hub_user: ${{ env.DOCKER_HUB_USER }} - build: runs-on: ubuntu-latest steps: @@ -67,7 +64,7 @@ jobs: needs: [init] # No need to run if we cannot use the sonar token if: >- - (needs.init.outputs.github_token != '' && needs.init.outputs.sonar_token != '' + (GITHUB_TOKEN_AVAILABLE && SONAR_TOKEN_AVAILABLE && needs.init.outputs.sonar_project_key != '' && needs.init.outputs.sonar_organization != '') && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && github.actor != 'dependabot[bot]' @@ -98,10 +95,13 @@ jobs: restore-keys: ${{ runner.os }}-sonar - name: Analyze with Sonar + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: | mvn --batch-mode --update-snapshots verify \ org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ - -Dsonar.projectKey=${{ needs.init.outputs.sonar_project_key }} -Dsonar.organization=${{ needs.init.outputs.sonar_organization }} \ + -Dsonar.projectKey=${{ secrets.SONAR_PROJECT_KEY }} -Dsonar.organization=${{ secrets.SONAR_ORGANIZATION }} \ -Dcheckstyle.skip -Dpmd.skip=true build_images: @@ -149,11 +149,11 @@ jobs: if: needs.init.outputs.docker_hub_user != '' uses: docker/login-action@v3 with: - username: ${{ needs.init.outputs.docker_hub_user }} - password: ${{ needs.init.outputs.docker_hub_token }} + username: ${{ secrets.DOCKER_HUB_USER }} + password: ${{ secrets.DOCKER_HUB_TOKEN }} - name: Push image (DockerHub) - if: needs.init.outputs.DOCKER_HUB_USER != '' + if: needs.init.outputs.docker_hub_user != '' run: | docker tag ${{ matrix.image }} ${{ needs.init.outputs.image_namespace }}/${{ needs.init.outputs.image_name }}:${{ steps.version.outputs.image_tag }} docker push ${{ needs.init.outputs.image_namespace }}/${{ needs.init.outputs.image_name }}:${{ steps.version.outputs.image_tag }} @@ -163,7 +163,7 @@ jobs: # https://github.com/peter-evans/dockerhub-description - name: Update Docker Hub description - if: needs.init.outputs.DOCKER_HUB_USER != '' && github.event_name != 'pull_request' + if: needs.init.outputs.docker_hub_user != '' && github.event_name != 'pull_request' uses: peter-evans/dockerhub-description@v4 with: username: ${{ secrets.DOCKER_HUB_USER }} From 77c7447c6d3901b2eedb6c6407ed1e898b2b0bdc Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Tue, 25 Jun 2024 00:48:34 +0200 Subject: [PATCH 11/44] chore(build):[#222] trial to fix previous commit --- .github/workflows/irs-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/irs-build.yml b/.github/workflows/irs-build.yml index 7ea9ccee3b..2171f9ce96 100644 --- a/.github/workflows/irs-build.yml +++ b/.github/workflows/irs-build.yml @@ -64,7 +64,7 @@ jobs: needs: [init] # No need to run if we cannot use the sonar token if: >- - (GITHUB_TOKEN_AVAILABLE && SONAR_TOKEN_AVAILABLE + (env.GITHUB_TOKEN_AVAILABLE && env.SONAR_TOKEN_AVAILABLE && needs.init.outputs.sonar_project_key != '' && needs.init.outputs.sonar_organization != '') && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && github.actor != 'dependabot[bot]' From 28b92291debf719633e83a4bedfbebbbd4868bd1 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Tue, 25 Jun 2024 00:50:43 +0200 Subject: [PATCH 12/44] chore(build):[#222] trial to fix previous commit --- .github/workflows/irs-build.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/irs-build.yml b/.github/workflows/irs-build.yml index 2171f9ce96..dd033b3cb5 100644 --- a/.github/workflows/irs-build.yml +++ b/.github/workflows/irs-build.yml @@ -22,8 +22,8 @@ env: SONAR_PROJECT_KEY: ${{ secrets.SONAR_PROJECT_KEY }} SONAR_ORGANIZATION: ${{ secrets.SONAR_ORGANIZATION }} DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }} - SONAR_TOKEN_AVAILABLE: ${{ secrets.SONAR_TOKEN != '' }} - GITHUB_TOKEN_AVAILABLE: ${{ secrets.GITHUB_TOKEN != '' }} +# SONAR_TOKEN_AVAILABLE: ${{ secrets.SONAR_TOKEN != '' }} +# GITHUB_TOKEN_AVAILABLE: ${{ secrets.GITHUB_TOKEN != '' }} jobs: init: @@ -36,6 +36,8 @@ jobs: sonar_project_key: ${{ env.SONAR_PROJECT_KEY }} sonar_organization: ${{ env.SONAR_ORGANIZATION }} docker_hub_user: ${{ env.DOCKER_HUB_USER }} + sonar_token_available: ${{ secrets.SONAR_TOKEN != '' }} + github_token_available: ${{ secrets.GITHUB_TOKEN != '' }} build: runs-on: ubuntu-latest @@ -64,7 +66,7 @@ jobs: needs: [init] # No need to run if we cannot use the sonar token if: >- - (env.GITHUB_TOKEN_AVAILABLE && env.SONAR_TOKEN_AVAILABLE + (needs.init.outputs.github_token_available && needs.init.outputs.sonar_token_available && needs.init.outputs.sonar_project_key != '' && needs.init.outputs.sonar_organization != '') && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && github.actor != 'dependabot[bot]' From f13aa5c89e3a0bbf7b505af299edc67ba58b3e96 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Tue, 25 Jun 2024 01:37:24 +0200 Subject: [PATCH 13/44] chore(build):[#222] fixes / improvements - trial to fix "Skip output 'sonar_project_key' since it may contain secret." - trial to fix " Skip output 'sonar_organization' since it may contain secret." --- .github/workflows/irs-build.yml | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/.github/workflows/irs-build.yml b/.github/workflows/irs-build.yml index dd033b3cb5..9c1416fc90 100644 --- a/.github/workflows/irs-build.yml +++ b/.github/workflows/irs-build.yml @@ -18,13 +18,6 @@ on: tags: - '**' -env: - SONAR_PROJECT_KEY: ${{ secrets.SONAR_PROJECT_KEY }} - SONAR_ORGANIZATION: ${{ secrets.SONAR_ORGANIZATION }} - DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }} -# SONAR_TOKEN_AVAILABLE: ${{ secrets.SONAR_TOKEN != '' }} -# GITHUB_TOKEN_AVAILABLE: ${{ secrets.GITHUB_TOKEN != '' }} - jobs: init: runs-on: ubuntu-latest @@ -33,10 +26,8 @@ jobs: outputs: image_namespace: tractusx image_name: irs-api - sonar_project_key: ${{ env.SONAR_PROJECT_KEY }} - sonar_organization: ${{ env.SONAR_ORGANIZATION }} - docker_hub_user: ${{ env.DOCKER_HUB_USER }} - sonar_token_available: ${{ secrets.SONAR_TOKEN != '' }} + docker_hub_user: ${{ secrets.DOCKER_HUB_USER }} + sonar_configured: ${{ secrets.SONAR_TOKEN != '' && secrets.SONAR_PROJECT_KEY != '' && secrets.SONAR_ORGANIZATION != '' }} github_token_available: ${{ secrets.GITHUB_TOKEN != '' }} build: @@ -66,8 +57,7 @@ jobs: needs: [init] # No need to run if we cannot use the sonar token if: >- - (needs.init.outputs.github_token_available && needs.init.outputs.sonar_token_available - && needs.init.outputs.sonar_project_key != '' && needs.init.outputs.sonar_organization != '') + needs.init.outputs.sonar_configured && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && github.actor != 'dependabot[bot]' runs-on: ubuntu-latest @@ -141,8 +131,8 @@ jobs: - name: Log in to registry if: >- needs.init.outputs.docker_hub_user == '' && - (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && - github.actor != 'dependabot[bot]' + (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) + && github.actor != 'dependabot[bot]' # This is where you will update the personal access token to GITHUB_TOKEN run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin @@ -179,3 +169,4 @@ jobs: needs: - build_images uses: ./.github/workflows/trivy-docker-hub-scan.yml + From af59c31657da4684d3dffa5078b89319e48261dc Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Tue, 25 Jun 2024 02:35:53 +0200 Subject: [PATCH 14/44] chore(build):[#222] add debug output --- .github/workflows/irs-build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/irs-build.yml b/.github/workflows/irs-build.yml index 9c1416fc90..765853cae3 100644 --- a/.github/workflows/irs-build.yml +++ b/.github/workflows/irs-build.yml @@ -22,7 +22,9 @@ jobs: init: runs-on: ubuntu-latest steps: - - run: echo "Preparing variables" + - run: | + echo "Preparing variables" + echo "needs.init.outputs.sonar_configured: ${{ needs.init.outputs.sonar_configured }}" outputs: image_namespace: tractusx image_name: irs-api From c3f67aff31960cca1e4921e99f07fd4d46eb9899 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Tue, 25 Jun 2024 02:39:22 +0200 Subject: [PATCH 15/44] chore(build):[#222] add debug output --- .github/workflows/irs-build.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/irs-build.yml b/.github/workflows/irs-build.yml index 765853cae3..23740c8e04 100644 --- a/.github/workflows/irs-build.yml +++ b/.github/workflows/irs-build.yml @@ -24,7 +24,6 @@ jobs: steps: - run: | echo "Preparing variables" - echo "needs.init.outputs.sonar_configured: ${{ needs.init.outputs.sonar_configured }}" outputs: image_namespace: tractusx image_name: irs-api @@ -32,6 +31,13 @@ jobs: sonar_configured: ${{ secrets.SONAR_TOKEN != '' && secrets.SONAR_PROJECT_KEY != '' && secrets.SONAR_ORGANIZATION != '' }} github_token_available: ${{ secrets.GITHUB_TOKEN != '' }} + dbg: + runs-on: ubuntu-latest + needs: [init] + steps: + - run: | + echo "needs.init.outputs.sonar_configured: ${{ needs.init.outputs.sonar_configured }}" + build: runs-on: ubuntu-latest steps: From 9c08e48c2c1a4a73c26c515c18f7bd5129b22342 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Tue, 25 Jun 2024 02:44:59 +0200 Subject: [PATCH 16/44] chore(build):[#222] trial to fix boolean --- .github/workflows/irs-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/irs-build.yml b/.github/workflows/irs-build.yml index 23740c8e04..5278cce9ca 100644 --- a/.github/workflows/irs-build.yml +++ b/.github/workflows/irs-build.yml @@ -65,7 +65,7 @@ jobs: needs: [init] # No need to run if we cannot use the sonar token if: >- - needs.init.outputs.sonar_configured + needs.init.outputs.sonar_configured == true && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && github.actor != 'dependabot[bot]' runs-on: ubuntu-latest From 00462432fd84a083ee2756b47f12ba1617c1b1a9 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Tue, 25 Jun 2024 03:12:47 +0200 Subject: [PATCH 17/44] chore(build):[#222] trial to fix / debug --- .github/workflows/irs-build.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/irs-build.yml b/.github/workflows/irs-build.yml index 5278cce9ca..ed27c25a52 100644 --- a/.github/workflows/irs-build.yml +++ b/.github/workflows/irs-build.yml @@ -21,15 +21,24 @@ on: jobs: init: runs-on: ubuntu-latest - steps: - - run: | - echo "Preparing variables" + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN != '' }} + SONAR_PROJECT_KEY: ${{ secrets.SONAR_PROJECT_KEY != '' }} + SONAR_ORGANIZATION: ${{ secrets.SONAR_ORGANIZATION != '' }} + SONAR_CONFIGURED: ${{ secrets.SONAR_TOKEN != '' && secrets.SONAR_PROJECT_KEY != '' && secrets.SONAR_ORGANIZATION != '' }} outputs: image_namespace: tractusx image_name: irs-api docker_hub_user: ${{ secrets.DOCKER_HUB_USER }} sonar_configured: ${{ secrets.SONAR_TOKEN != '' && secrets.SONAR_PROJECT_KEY != '' && secrets.SONAR_ORGANIZATION != '' }} - github_token_available: ${{ secrets.GITHUB_TOKEN != '' }} + github_token_available: ${{ env.SONAR_CONFIGURED }} + steps: + - run: | + echo "Preparing variables" + echo "SONAR_CONFIGURED: ${{ env.SONAR_CONFIGURED }}" + echo "SONAR_CONFIGURED: ${{ env.SONAR_ORGANIZATION }}" + echo "SONAR_CONFIGURED: ${{ env.SONAR_PROJECT_KEY }}" + echo "SONAR_CONFIGURED: ${{ env.SONAR_TOKEN }}" dbg: runs-on: ubuntu-latest From 86d82f94773e954301fc17dd6afcbf2978bf2b30 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Tue, 25 Jun 2024 03:20:54 +0200 Subject: [PATCH 18/44] chore(build):[#222] trial to fix / debug --- .github/workflows/irs-build.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/irs-build.yml b/.github/workflows/irs-build.yml index ed27c25a52..27d15ad387 100644 --- a/.github/workflows/irs-build.yml +++ b/.github/workflows/irs-build.yml @@ -22,9 +22,9 @@ jobs: init: runs-on: ubuntu-latest env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN != '' }} - SONAR_PROJECT_KEY: ${{ secrets.SONAR_PROJECT_KEY != '' }} - SONAR_ORGANIZATION: ${{ secrets.SONAR_ORGANIZATION != '' }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_PROJECT_KEY: ${{ secrets.SONAR_PROJECT_KEY }} + SONAR_ORGANIZATION: ${{ secrets.SONAR_ORGANIZATION }} SONAR_CONFIGURED: ${{ secrets.SONAR_TOKEN != '' && secrets.SONAR_PROJECT_KEY != '' && secrets.SONAR_ORGANIZATION != '' }} outputs: image_namespace: tractusx @@ -36,9 +36,9 @@ jobs: - run: | echo "Preparing variables" echo "SONAR_CONFIGURED: ${{ env.SONAR_CONFIGURED }}" - echo "SONAR_CONFIGURED: ${{ env.SONAR_ORGANIZATION }}" - echo "SONAR_CONFIGURED: ${{ env.SONAR_PROJECT_KEY }}" - echo "SONAR_CONFIGURED: ${{ env.SONAR_TOKEN }}" + echo "SONAR_ORGANIZATION: ${{ env.SONAR_ORGANIZATION }}" + echo "SONAR_PROJECT_KEY: ${{ env.SONAR_PROJECT_KEY }}" + echo "SONAR_TOKEN: ${{ env.SONAR_TOKEN }}" dbg: runs-on: ubuntu-latest @@ -74,7 +74,7 @@ jobs: needs: [init] # No need to run if we cannot use the sonar token if: >- - needs.init.outputs.sonar_configured == true + needs.init.outputs.sonar_configured == 'true' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && github.actor != 'dependabot[bot]' runs-on: ubuntu-latest From 6ccb3c1d7eba02f8ab6c66eca416fe29163f3ab7 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Tue, 25 Jun 2024 03:29:58 +0200 Subject: [PATCH 19/44] chore(build):[#222] cleanup --- .github/workflows/irs-build.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/irs-build.yml b/.github/workflows/irs-build.yml index 27d15ad387..3d78ffd15b 100644 --- a/.github/workflows/irs-build.yml +++ b/.github/workflows/irs-build.yml @@ -31,14 +31,11 @@ jobs: image_name: irs-api docker_hub_user: ${{ secrets.DOCKER_HUB_USER }} sonar_configured: ${{ secrets.SONAR_TOKEN != '' && secrets.SONAR_PROJECT_KEY != '' && secrets.SONAR_ORGANIZATION != '' }} - github_token_available: ${{ env.SONAR_CONFIGURED }} steps: - run: | echo "Preparing variables" echo "SONAR_CONFIGURED: ${{ env.SONAR_CONFIGURED }}" - echo "SONAR_ORGANIZATION: ${{ env.SONAR_ORGANIZATION }}" - echo "SONAR_PROJECT_KEY: ${{ env.SONAR_PROJECT_KEY }}" - echo "SONAR_TOKEN: ${{ env.SONAR_TOKEN }}" + dbg: runs-on: ubuntu-latest @@ -46,6 +43,7 @@ jobs: steps: - run: | echo "needs.init.outputs.sonar_configured: ${{ needs.init.outputs.sonar_configured }}" + build: runs-on: ubuntu-latest From c6eebfdaf2e657cb752ffbbfab4ec62d5377ae98 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Tue, 25 Jun 2024 03:35:20 +0200 Subject: [PATCH 20/44] chore(build):[#222] cleanup --- .github/workflows/irs-build.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/irs-build.yml b/.github/workflows/irs-build.yml index 3d78ffd15b..73e346af40 100644 --- a/.github/workflows/irs-build.yml +++ b/.github/workflows/irs-build.yml @@ -37,14 +37,6 @@ jobs: echo "SONAR_CONFIGURED: ${{ env.SONAR_CONFIGURED }}" - dbg: - runs-on: ubuntu-latest - needs: [init] - steps: - - run: | - echo "needs.init.outputs.sonar_configured: ${{ needs.init.outputs.sonar_configured }}" - - build: runs-on: ubuntu-latest steps: From d5534ca16dd2088db0c242ecbb2bcd22269a86a7 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Tue, 25 Jun 2024 15:01:13 +0200 Subject: [PATCH 21/44] chore(build):[#222] cleanup --- .github/workflows/irs-build.yml | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/.github/workflows/irs-build.yml b/.github/workflows/irs-build.yml index 73e346af40..ce5c6c1541 100644 --- a/.github/workflows/irs-build.yml +++ b/.github/workflows/irs-build.yml @@ -21,21 +21,16 @@ on: jobs: init: runs-on: ubuntu-latest - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - SONAR_PROJECT_KEY: ${{ secrets.SONAR_PROJECT_KEY }} - SONAR_ORGANIZATION: ${{ secrets.SONAR_ORGANIZATION }} - SONAR_CONFIGURED: ${{ secrets.SONAR_TOKEN != '' && secrets.SONAR_PROJECT_KEY != '' && secrets.SONAR_ORGANIZATION != '' }} outputs: image_namespace: tractusx image_name: irs-api docker_hub_user: ${{ secrets.DOCKER_HUB_USER }} + # In order to skip sonar if not configured sonar_configured: ${{ secrets.SONAR_TOKEN != '' && secrets.SONAR_PROJECT_KEY != '' && secrets.SONAR_ORGANIZATION != '' }} steps: - run: | echo "Preparing variables" - echo "SONAR_CONFIGURED: ${{ env.SONAR_CONFIGURED }}" - + echo "sonar_configured: ${{ secrets.SONAR_TOKEN != '' && secrets.SONAR_PROJECT_KEY != '' && secrets.SONAR_ORGANIZATION != '' }}" build: runs-on: ubuntu-latest @@ -135,15 +130,6 @@ jobs: echo VERSION=$VERSION echo "::set-output name=image_tag::$VERSION" - - name: Log in to registry - if: >- - needs.init.outputs.docker_hub_user == '' && - (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) - && github.actor != 'dependabot[bot]' - # This is where you will update the personal access token to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Login to Docker Hub if: needs.init.outputs.docker_hub_user != '' uses: docker/login-action@v3 @@ -153,6 +139,7 @@ jobs: - name: Push image (DockerHub) if: needs.init.outputs.docker_hub_user != '' + # nur pushen wenn nicht auf pull request run: | docker tag ${{ matrix.image }} ${{ needs.init.outputs.image_namespace }}/${{ needs.init.outputs.image_name }}:${{ steps.version.outputs.image_tag }} docker push ${{ needs.init.outputs.image_namespace }}/${{ needs.init.outputs.image_name }}:${{ steps.version.outputs.image_tag }} From 80307b2b3a4564cf924ee5fb476289b0f152688c Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Tue, 25 Jun 2024 21:50:09 +0200 Subject: [PATCH 22/44] chore(build):[#222] do not push image in pull requests --- .github/workflows/irs-build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/irs-build.yml b/.github/workflows/irs-build.yml index ce5c6c1541..c726df7446 100644 --- a/.github/workflows/irs-build.yml +++ b/.github/workflows/irs-build.yml @@ -138,8 +138,7 @@ jobs: password: ${{ secrets.DOCKER_HUB_TOKEN }} - name: Push image (DockerHub) - if: needs.init.outputs.docker_hub_user != '' - # nur pushen wenn nicht auf pull request + if: needs.init.outputs.docker_hub_user != '' && github.event_name != 'pull_request' run: | docker tag ${{ matrix.image }} ${{ needs.init.outputs.image_namespace }}/${{ needs.init.outputs.image_name }}:${{ steps.version.outputs.image_tag }} docker push ${{ needs.init.outputs.image_namespace }}/${{ needs.init.outputs.image_name }}:${{ steps.version.outputs.image_tag }} From 971f72538d4e80dfdbb5fcc0956e0791703d4d65 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Wed, 26 Jun 2024 11:13:52 +0200 Subject: [PATCH 23/44] chore(build):[#222] add message if secrets not defined --- .../cucumber-integration-test-INT.yaml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/cucumber-integration-test-INT.yaml b/.github/workflows/cucumber-integration-test-INT.yaml index 4e0ead9325..fc491a7980 100644 --- a/.github/workflows/cucumber-integration-test-INT.yaml +++ b/.github/workflows/cucumber-integration-test-INT.yaml @@ -9,6 +9,26 @@ concurrency: cancel-in-progress: true jobs: + + check-config: + runs-on: ubuntu-latest + steps: + - name: Check if required secrets are defined + run: | + if [[ -z "${{ secrets.INT_REGULAR_USER_API_KEY }}" ]]; then + echo "Error: Secret INT_REGULAR_USER_API_KEY is not defined." + exit 1 + fi + if [[ -z "${{ secrets.INT_ADMIN_USER_API_KEY }}" ]]; then + echo "Error: Secret INT_ADMIN_USER_API_KEY is not defined." + exit 1 + fi + if [[ -z "${{ secrets.IRS_CUCUMBER_PUBLISH_TOKEN }}" ]]; then + echo "Error: Secret IRS_CUCUMBER_PUBLISH_TOKEN is not defined." + exit 1 + fi + shell: bash + trigger-integration-test: uses: ./.github/workflows/cucumber-integration-test.yaml secrets: From 37246b499c704c48a2633f446a788dab7f241e0a Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Wed, 26 Jun 2024 11:17:47 +0200 Subject: [PATCH 24/44] chore(build):[#222] add message if secrets not defined --- .github/workflows/cucumber-integration-test-INT.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/cucumber-integration-test-INT.yaml b/.github/workflows/cucumber-integration-test-INT.yaml index fc491a7980..c972dc4c50 100644 --- a/.github/workflows/cucumber-integration-test-INT.yaml +++ b/.github/workflows/cucumber-integration-test-INT.yaml @@ -19,10 +19,14 @@ jobs: echo "Error: Secret INT_REGULAR_USER_API_KEY is not defined." exit 1 fi + - name: Check if INT_ADMIN_USER_API_KEY is defined + run: | if [[ -z "${{ secrets.INT_ADMIN_USER_API_KEY }}" ]]; then echo "Error: Secret INT_ADMIN_USER_API_KEY is not defined." exit 1 fi + - name: Check if IRS_CUCUMBER_PUBLISH_TOKEN is defined + run: | if [[ -z "${{ secrets.IRS_CUCUMBER_PUBLISH_TOKEN }}" ]]; then echo "Error: Secret IRS_CUCUMBER_PUBLISH_TOKEN is not defined." exit 1 @@ -30,6 +34,7 @@ jobs: shell: bash trigger-integration-test: + needs: check-config uses: ./.github/workflows/cucumber-integration-test.yaml secrets: regularUserApiKey: ${{ secrets.INT_REGULAR_USER_API_KEY }} From f632f7d559e8e004aff0477e6c43ea76db4deee6 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Wed, 26 Jun 2024 11:26:29 +0200 Subject: [PATCH 25/44] chore(build):[#222] add message if secrets not defined --- .../cucumber-integration-test-INT.yaml | 24 --------------- .../workflows/cucumber-integration-test.yaml | 29 +++++++++++++++++++ 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/.github/workflows/cucumber-integration-test-INT.yaml b/.github/workflows/cucumber-integration-test-INT.yaml index c972dc4c50..722b2526bf 100644 --- a/.github/workflows/cucumber-integration-test-INT.yaml +++ b/.github/workflows/cucumber-integration-test-INT.yaml @@ -10,31 +10,7 @@ concurrency: jobs: - check-config: - runs-on: ubuntu-latest - steps: - - name: Check if required secrets are defined - run: | - if [[ -z "${{ secrets.INT_REGULAR_USER_API_KEY }}" ]]; then - echo "Error: Secret INT_REGULAR_USER_API_KEY is not defined." - exit 1 - fi - - name: Check if INT_ADMIN_USER_API_KEY is defined - run: | - if [[ -z "${{ secrets.INT_ADMIN_USER_API_KEY }}" ]]; then - echo "Error: Secret INT_ADMIN_USER_API_KEY is not defined." - exit 1 - fi - - name: Check if IRS_CUCUMBER_PUBLISH_TOKEN is defined - run: | - if [[ -z "${{ secrets.IRS_CUCUMBER_PUBLISH_TOKEN }}" ]]; then - echo "Error: Secret IRS_CUCUMBER_PUBLISH_TOKEN is not defined." - exit 1 - fi - shell: bash - trigger-integration-test: - needs: check-config uses: ./.github/workflows/cucumber-integration-test.yaml secrets: regularUserApiKey: ${{ secrets.INT_REGULAR_USER_API_KEY }} diff --git a/.github/workflows/cucumber-integration-test.yaml b/.github/workflows/cucumber-integration-test.yaml index 6e417a74fe..c8827a232d 100644 --- a/.github/workflows/cucumber-integration-test.yaml +++ b/.github/workflows/cucumber-integration-test.yaml @@ -15,7 +15,36 @@ on: type: string jobs: + + check-config: + runs-on: ubuntu-latest + steps: + - name: Check for required secrets + run: | + CONFIG_OK=false + + if [[ -z "${{ secrets.regularUserApiKey }}" ]]; then + echo "Error: Secret regularUserApiKey is not defined." + CONFIG_OK=true + fi + + if [[ -z "${{ secrets.adminUserApiKey }}" ]]; then + echo "Error: Secret adminUserApiKey is not defined." + CONFIG_OK=true + fi + + if [[ -z "${{ secrets.cucumberPublishToken }}" ]]; then + echo "Error: Secret cucumberPublishToken is not defined." + CONFIG_OK=true + fi + + if [ "$CONFIG_OK" = true ]; then + exit 1 + fi + shell: bash + build: + needs: check-config runs-on: ubuntu-latest steps: From f2cfb8acdd1993e3a447c4ce647b825140c52fa7 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Wed, 26 Jun 2024 11:39:55 +0200 Subject: [PATCH 26/44] chore(build):[#222] add message if secrets not defined --- .github/workflows/cucumber-integration-test.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cucumber-integration-test.yaml b/.github/workflows/cucumber-integration-test.yaml index c8827a232d..ff09b6b443 100644 --- a/.github/workflows/cucumber-integration-test.yaml +++ b/.github/workflows/cucumber-integration-test.yaml @@ -24,17 +24,17 @@ jobs: CONFIG_OK=false if [[ -z "${{ secrets.regularUserApiKey }}" ]]; then - echo "Error: Secret regularUserApiKey is not defined." + echo "Missing secret: Please configure the regular user API key." CONFIG_OK=true fi if [[ -z "${{ secrets.adminUserApiKey }}" ]]; then - echo "Error: Secret adminUserApiKey is not defined." + echo "Missing secret: Please configure the admin user API key." CONFIG_OK=true fi if [[ -z "${{ secrets.cucumberPublishToken }}" ]]; then - echo "Error: Secret cucumberPublishToken is not defined." + echo "Missing secret: Please confifure the cucumber publish token." CONFIG_OK=true fi From df80db20df4ba7e8ad2c870421f5cf70917880e2 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Wed, 26 Jun 2024 11:50:43 +0200 Subject: [PATCH 27/44] chore(build):[#222] add message if secrets not defined --- .../cucumber-integration-test-DIL.yaml | 26 +++++++++++++++++ .../cucumber-integration-test-INT.yaml | 25 ++++++++++++++++ .../workflows/cucumber-integration-test.yaml | 28 ------------------ .github/workflows/integration-test-DEV.yaml | 29 +++++++++++++++++++ 4 files changed, 80 insertions(+), 28 deletions(-) diff --git a/.github/workflows/cucumber-integration-test-DIL.yaml b/.github/workflows/cucumber-integration-test-DIL.yaml index b3469503b0..bccbe5e15f 100644 --- a/.github/workflows/cucumber-integration-test-DIL.yaml +++ b/.github/workflows/cucumber-integration-test-DIL.yaml @@ -9,7 +9,33 @@ concurrency: cancel-in-progress: true jobs: + + check-config: + runs-on: ubuntu-latest + steps: + - name: Check if DIL_REGULAR_USER_API_KEY is defined + run: | + if [[ -z "${{ secrets.DIL_REGULAR_USER_API_KEY }}" ]]; then + echo "Error: Missing secret: Please configure DIL_REGULAR_USER_API_KEY." + exit 1 + fi + - name: Check if DIL_ADMIN_USER_API_KEY is defined + run: | + if [[ -z "${{ secrets.DIL_ADMIN_USER_API_KEY }}" ]]; then + echo "Error: Missing secret: Please configure DIL_ADMIN_USER_API_KEY." + exit 1 + fi +# TODO it this really required? +# - name: Check if IRS_CUCUMBER_PUBLISH_TOKEN is defined +# run: | +# if [[ -z "${{ secrets.IRS_CUCUMBER_PUBLISH_TOKEN }}" ]]; then +# echo "Error: Missing secret: Please configure IRS_CUCUMBER_PUBLISH_TOKEN." +# exit 1 +# fi +# shell: bash + trigger-integration-test: + needs: check-config uses: ./.github/workflows/cucumber-integration-test.yaml secrets: regularUserApiKey: ${{ secrets.DIL_REGULAR_USER_API_KEY }} diff --git a/.github/workflows/cucumber-integration-test-INT.yaml b/.github/workflows/cucumber-integration-test-INT.yaml index 722b2526bf..4f616db948 100644 --- a/.github/workflows/cucumber-integration-test-INT.yaml +++ b/.github/workflows/cucumber-integration-test-INT.yaml @@ -10,7 +10,32 @@ concurrency: jobs: + check-config: + runs-on: ubuntu-latest + steps: + - name: Check if INT_REGULAR_USER_API_KEY is defined + run: | + if [[ -z "${{ secrets.INT_REGULAR_USER_API_KEY }}" ]]; then + echo "Error: Missing secret: Please configure INT_REGULAR_USER_API_KEY." + exit 1 + fi + - name: Check if INT_ADMIN_USER_API_KEY is defined + run: | + if [[ -z "${{ secrets.INT_ADMIN_USER_API_KEY }}" ]]; then + echo "Error: Missing secret: Please configure INT_ADMIN_USER_API_KEY." + exit 1 + fi +# TODO it this really required? +# - name: Check if IRS_CUCUMBER_PUBLISH_TOKEN is defined +# run: | +# if [[ -z "${{ secrets.IRS_CUCUMBER_PUBLISH_TOKEN }}" ]]; then +# echo "Error: Missing secret: Please configure IRS_CUCUMBER_PUBLISH_TOKEN." +# exit 1 +# fi +# shell: bash + trigger-integration-test: + needs: check-config uses: ./.github/workflows/cucumber-integration-test.yaml secrets: regularUserApiKey: ${{ secrets.INT_REGULAR_USER_API_KEY }} diff --git a/.github/workflows/cucumber-integration-test.yaml b/.github/workflows/cucumber-integration-test.yaml index ff09b6b443..16f6bc7c7e 100644 --- a/.github/workflows/cucumber-integration-test.yaml +++ b/.github/workflows/cucumber-integration-test.yaml @@ -16,35 +16,7 @@ on: jobs: - check-config: - runs-on: ubuntu-latest - steps: - - name: Check for required secrets - run: | - CONFIG_OK=false - - if [[ -z "${{ secrets.regularUserApiKey }}" ]]; then - echo "Missing secret: Please configure the regular user API key." - CONFIG_OK=true - fi - - if [[ -z "${{ secrets.adminUserApiKey }}" ]]; then - echo "Missing secret: Please configure the admin user API key." - CONFIG_OK=true - fi - - if [[ -z "${{ secrets.cucumberPublishToken }}" ]]; then - echo "Missing secret: Please confifure the cucumber publish token." - CONFIG_OK=true - fi - - if [ "$CONFIG_OK" = true ]; then - exit 1 - fi - shell: bash - build: - needs: check-config runs-on: ubuntu-latest steps: diff --git a/.github/workflows/integration-test-DEV.yaml b/.github/workflows/integration-test-DEV.yaml index d2498bb84d..dd95e31c51 100644 --- a/.github/workflows/integration-test-DEV.yaml +++ b/.github/workflows/integration-test-DEV.yaml @@ -19,8 +19,37 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true + + + jobs: + + check-config: + runs-on: ubuntu-latest + steps: + - name: Check if DEV_REGULAR_USER_API_KEY is defined + run: | + if [[ -z "${{ secrets.DEV_REGULAR_USER_API_KEY }}" ]]; then + echo "Error: Missing secret: Please configure DEV_REGULAR_USER_API_KEY." + exit 1 + fi + - name: Check if DEV_ADMIN_USER_API_KEY is defined + run: | + if [[ -z "${{ secrets.DEV_ADMIN_USER_API_KEY }}" ]]; then + echo "Error: Missing secret: Please configure DEV_ADMIN_USER_API_KEY." + exit 1 + fi + # TODO it this really required? + # - name: Check if IRS_CUCUMBER_PUBLISH_TOKEN is defined + # run: | + # if [[ -z "${{ secrets.IRS_CUCUMBER_PUBLISH_TOKEN }}" ]]; then + # echo "Error: Missing secret: Please configure IRS_CUCUMBER_PUBLISH_TOKEN." + # exit 1 + # fi + # shell: bash + trigger-integration-test: + needs: check-config uses: ./.github/workflows/cucumber-integration-test.yaml secrets: regularUserApiKey: ${{ secrets.DEV_REGULAR_USER_API_KEY }} From eea4be12a4b8ebb971acd95bc29740128b64c4b6 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Wed, 26 Jun 2024 12:00:21 +0200 Subject: [PATCH 28/44] chore(build):[#222] allow additonal execution filter on DEV --- .github/workflows/integration-test-DEV.yaml | 23 +++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-test-DEV.yaml b/.github/workflows/integration-test-DEV.yaml index dd95e31c51..1389710f42 100644 --- a/.github/workflows/integration-test-DEV.yaml +++ b/.github/workflows/integration-test-DEV.yaml @@ -48,12 +48,31 @@ jobs: # fi # shell: bash - trigger-integration-test: + + prepare-execution-filter: + runs-on: ubuntu-latest needs: check-config + outputs: + executionFilter: ${{ steps.set-filter.outputs.executionFilter }} + steps: + - name: Set execution filter + id: set-filter + run: | + base_filter="!Ignore & !INACTIVE & INTEGRATION_TEST & DEV" + if [ -n "${{ github.event.inputs.additionalFilter }}" ]; then + execution_filter="${base_filter} & ${{ github.event.inputs.additionalFilter }}" + else + execution_filter="${base_filter}" + fi + echo "::set-output name=executionFilter::${execution_filter}" + + + trigger-integration-test: + needs: prepare-execution-filter uses: ./.github/workflows/cucumber-integration-test.yaml secrets: regularUserApiKey: ${{ secrets.DEV_REGULAR_USER_API_KEY }} adminUserApiKey: ${{ secrets.DEV_ADMIN_USER_API_KEY }} cucumberPublishToken: ${{ secrets.IRS_CUCUMBER_PUBLISH_TOKEN }} with: - executionFilter: "!Ignore & !INACTIVE & INTEGRATION_TEST & DEV" + executionFilter: ${{ needs.prepare-execution-filter.outputs.executionFilter }} From a89cb78ca2415704f1c9cc666fd12ea698d8562a Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Wed, 26 Jun 2024 12:01:44 +0200 Subject: [PATCH 29/44] chore(build):[#222] allow additonal execution filter on DEV --- .github/workflows/integration-test-DEV.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/integration-test-DEV.yaml b/.github/workflows/integration-test-DEV.yaml index 1389710f42..577414ccf7 100644 --- a/.github/workflows/integration-test-DEV.yaml +++ b/.github/workflows/integration-test-DEV.yaml @@ -2,6 +2,11 @@ name: IRS DEV Cucumber Integration test execution on: workflow_dispatch: # Trigger manually + inputs: + additionalFilter: + description: 'Additional execution filter' + required: false + default: '' push: branches: - 'main' From d7b254f2ba097fa53ec3cff6dba6aa9594c21388 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Wed, 26 Jun 2024 12:49:27 +0200 Subject: [PATCH 30/44] chore(build):[#222] trial to make publishing cucumber report optional --- .../irs/cucumber/RunCucumberTest.java | 18 +++++++++-- .../irs/cucumber/features/dummy.feature | 30 +++++++++++++++++++ 2 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 irs-cucumber-tests/src/test/resources/org/eclipse/tractusx/irs/cucumber/features/dummy.feature diff --git a/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java b/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java index ac1fd087f3..046c0eca07 100644 --- a/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java +++ b/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java @@ -24,6 +24,7 @@ import static io.cucumber.junit.platform.engine.Constants.PLUGIN_PROPERTY_NAME; import static io.cucumber.junit.platform.engine.Constants.PLUGIN_PUBLISH_TOKEN_PROPERTY_NAME; +import org.junit.platform.commons.util.StringUtils; import org.junit.platform.suite.api.ConfigurationParameter; import org.junit.platform.suite.api.IncludeEngines; import org.junit.platform.suite.api.SelectPackages; @@ -33,9 +34,20 @@ @IncludeEngines("cucumber") @SelectPackages("org.eclipse.tractusx.irs.cucumber") @ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "org.eclipse.tractusx.irs.cucumber") -@ConfigurationParameter(key = PLUGIN_PUBLISH_TOKEN_PROPERTY_NAME, value = "CUCUMBER_TOKEN_IRS_PLACEHOLDER") +//@ConfigurationParameter(key = PLUGIN_PUBLISH_TOKEN_PROPERTY_NAME, value = "CUCUMBER_TOKEN_IRS_PLACEHOLDER") @ConfigurationParameter(key = ANSI_COLORS_DISABLED_PROPERTY_NAME, value = "true") -@ConfigurationParameter(key = PLUGIN_PROPERTY_NAME, - value = "pretty,junit:target/cucumber-junit-report.xml,html:target/report.html") +//@ConfigurationParameter(key = PLUGIN_PROPERTY_NAME, +// value = "pretty,junit:target/cucumber-junit-report.xml,html:target/report.html") public class RunCucumberTest { + + private static final String PUBLISH_REPORT_PROPERTY = "publish.report"; + + static { + String token = "CUCUMBER_TOKEN_IRS_PLACEHOLDER"; + if (StringUtils.isNotBlank(token)) { + System.setProperty(PLUGIN_PROPERTY_NAME, + "pretty,junit:target/cucumber-junit-report.xml,html:target/report.html"); + System.setProperty(PLUGIN_PUBLISH_TOKEN_PROPERTY_NAME, token); + } + } } diff --git a/irs-cucumber-tests/src/test/resources/org/eclipse/tractusx/irs/cucumber/features/dummy.feature b/irs-cucumber-tests/src/test/resources/org/eclipse/tractusx/irs/cucumber/features/dummy.feature new file mode 100644 index 0000000000..446c42c6c5 --- /dev/null +++ b/irs-cucumber-tests/src/test/resources/org/eclipse/tractusx/irs/cucumber/features/dummy.feature @@ -0,0 +1,30 @@ +# +# Copyright (c) 2022,2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +# Copyright (c) 2021,2024 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License, Version 2.0 which is available at +# https://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. +# +# SPDX-License-Identifier: Apache-2.0 + +Feature: Dummy (just for testing during dev) + + Background: + Given the IRS URL "https://irs.dev.demo.catena-x.net/" -- policystore + And the admin user api key -- policystore + + @DEV @INTEGRATION_TEST + @DUMMY + Scenario: Asdf + # just do something for testing workflow here + When I successfully fetch all policies From b627e15be7f85113d39906dc10a61ebcf254aa5a Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Wed, 26 Jun 2024 12:56:14 +0200 Subject: [PATCH 31/44] chore(build):[#222] undo does not seem to work --- .../irs/cucumber/RunCucumberTest.java | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java b/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java index 046c0eca07..faac7fda2f 100644 --- a/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java +++ b/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java @@ -24,7 +24,6 @@ import static io.cucumber.junit.platform.engine.Constants.PLUGIN_PROPERTY_NAME; import static io.cucumber.junit.platform.engine.Constants.PLUGIN_PUBLISH_TOKEN_PROPERTY_NAME; -import org.junit.platform.commons.util.StringUtils; import org.junit.platform.suite.api.ConfigurationParameter; import org.junit.platform.suite.api.IncludeEngines; import org.junit.platform.suite.api.SelectPackages; @@ -34,20 +33,20 @@ @IncludeEngines("cucumber") @SelectPackages("org.eclipse.tractusx.irs.cucumber") @ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "org.eclipse.tractusx.irs.cucumber") -//@ConfigurationParameter(key = PLUGIN_PUBLISH_TOKEN_PROPERTY_NAME, value = "CUCUMBER_TOKEN_IRS_PLACEHOLDER") +@ConfigurationParameter(key = PLUGIN_PUBLISH_TOKEN_PROPERTY_NAME, value = "CUCUMBER_TOKEN_IRS_PLACEHOLDER") @ConfigurationParameter(key = ANSI_COLORS_DISABLED_PROPERTY_NAME, value = "true") -//@ConfigurationParameter(key = PLUGIN_PROPERTY_NAME, -// value = "pretty,junit:target/cucumber-junit-report.xml,html:target/report.html") +@ConfigurationParameter(key = PLUGIN_PROPERTY_NAME, + value = "pretty,junit:target/cucumber-junit-report.xml,html:target/report.html") public class RunCucumberTest { - private static final String PUBLISH_REPORT_PROPERTY = "publish.report"; - - static { - String token = "CUCUMBER_TOKEN_IRS_PLACEHOLDER"; - if (StringUtils.isNotBlank(token)) { - System.setProperty(PLUGIN_PROPERTY_NAME, - "pretty,junit:target/cucumber-junit-report.xml,html:target/report.html"); - System.setProperty(PLUGIN_PUBLISH_TOKEN_PROPERTY_NAME, token); - } - } + // private static final String PUBLISH_REPORT_PROPERTY = "publish.report"; + // + // static { + // String token = "CUCUMBER_TOKEN_IRS_PLACEHOLDER"; + // if (StringUtils.isNotBlank(token)) { + // System.setProperty(PLUGIN_PROPERTY_NAME, + // "pretty,junit:target/cucumber-junit-report.xml,html:target/report.html"); + // System.setProperty(PLUGIN_PUBLISH_TOKEN_PROPERTY_NAME, token); + // } + // } } From ef5e88cf5d1d32fb2fcdad27854ed043a8852960 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Wed, 26 Jun 2024 13:35:01 +0200 Subject: [PATCH 32/44] chore(build):[#222] cumcumber publish token is mandatory (currently) --- .../workflows/cucumber-integration-test-DIL.yaml | 15 +++++++-------- .../workflows/cucumber-integration-test-INT.yaml | 15 +++++++-------- .github/workflows/integration-test-DEV.yaml | 15 +++++++-------- .../tractusx/irs/cucumber/RunCucumberTest.java | 11 ----------- 4 files changed, 21 insertions(+), 35 deletions(-) diff --git a/.github/workflows/cucumber-integration-test-DIL.yaml b/.github/workflows/cucumber-integration-test-DIL.yaml index bccbe5e15f..53a8375ab4 100644 --- a/.github/workflows/cucumber-integration-test-DIL.yaml +++ b/.github/workflows/cucumber-integration-test-DIL.yaml @@ -25,14 +25,13 @@ jobs: echo "Error: Missing secret: Please configure DIL_ADMIN_USER_API_KEY." exit 1 fi -# TODO it this really required? -# - name: Check if IRS_CUCUMBER_PUBLISH_TOKEN is defined -# run: | -# if [[ -z "${{ secrets.IRS_CUCUMBER_PUBLISH_TOKEN }}" ]]; then -# echo "Error: Missing secret: Please configure IRS_CUCUMBER_PUBLISH_TOKEN." -# exit 1 -# fi -# shell: bash + - name: Check if IRS_CUCUMBER_PUBLISH_TOKEN is defined + run: | + if [[ -z "${{ secrets.IRS_CUCUMBER_PUBLISH_TOKEN }}" ]]; then + echo "Error: Missing secret: Please configure IRS_CUCUMBER_PUBLISH_TOKEN." + exit 1 + fi + shell: bash trigger-integration-test: needs: check-config diff --git a/.github/workflows/cucumber-integration-test-INT.yaml b/.github/workflows/cucumber-integration-test-INT.yaml index 4f616db948..85ac6f3e04 100644 --- a/.github/workflows/cucumber-integration-test-INT.yaml +++ b/.github/workflows/cucumber-integration-test-INT.yaml @@ -25,14 +25,13 @@ jobs: echo "Error: Missing secret: Please configure INT_ADMIN_USER_API_KEY." exit 1 fi -# TODO it this really required? -# - name: Check if IRS_CUCUMBER_PUBLISH_TOKEN is defined -# run: | -# if [[ -z "${{ secrets.IRS_CUCUMBER_PUBLISH_TOKEN }}" ]]; then -# echo "Error: Missing secret: Please configure IRS_CUCUMBER_PUBLISH_TOKEN." -# exit 1 -# fi -# shell: bash + - name: Check if IRS_CUCUMBER_PUBLISH_TOKEN is defined + run: | + if [[ -z "${{ secrets.IRS_CUCUMBER_PUBLISH_TOKEN }}" ]]; then + echo "Error: Missing secret: Please configure IRS_CUCUMBER_PUBLISH_TOKEN." + exit 1 + fi + shell: bash trigger-integration-test: needs: check-config diff --git a/.github/workflows/integration-test-DEV.yaml b/.github/workflows/integration-test-DEV.yaml index 577414ccf7..274db2d2ef 100644 --- a/.github/workflows/integration-test-DEV.yaml +++ b/.github/workflows/integration-test-DEV.yaml @@ -44,14 +44,13 @@ jobs: echo "Error: Missing secret: Please configure DEV_ADMIN_USER_API_KEY." exit 1 fi - # TODO it this really required? - # - name: Check if IRS_CUCUMBER_PUBLISH_TOKEN is defined - # run: | - # if [[ -z "${{ secrets.IRS_CUCUMBER_PUBLISH_TOKEN }}" ]]; then - # echo "Error: Missing secret: Please configure IRS_CUCUMBER_PUBLISH_TOKEN." - # exit 1 - # fi - # shell: bash + - name: Check if IRS_CUCUMBER_PUBLISH_TOKEN is defined + run: | + if [[ -z "${{ secrets.IRS_CUCUMBER_PUBLISH_TOKEN }}" ]]; then + echo "Error: Missing secret: Please configure IRS_CUCUMBER_PUBLISH_TOKEN." + exit 1 + fi + shell: bash prepare-execution-filter: diff --git a/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java b/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java index faac7fda2f..ac1fd087f3 100644 --- a/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java +++ b/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java @@ -38,15 +38,4 @@ @ConfigurationParameter(key = PLUGIN_PROPERTY_NAME, value = "pretty,junit:target/cucumber-junit-report.xml,html:target/report.html") public class RunCucumberTest { - - // private static final String PUBLISH_REPORT_PROPERTY = "publish.report"; - // - // static { - // String token = "CUCUMBER_TOKEN_IRS_PLACEHOLDER"; - // if (StringUtils.isNotBlank(token)) { - // System.setProperty(PLUGIN_PROPERTY_NAME, - // "pretty,junit:target/cucumber-junit-report.xml,html:target/report.html"); - // System.setProperty(PLUGIN_PUBLISH_TOKEN_PROPERTY_NAME, token); - // } - // } } From 2997b883195eaf5725034aaca9a219e575f344e4 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Wed, 26 Jun 2024 13:58:19 +0200 Subject: [PATCH 33/44] chore(build):[#222] cleanup --- .../irs/cucumber/features/dummy.feature | 30 ------------------- 1 file changed, 30 deletions(-) delete mode 100644 irs-cucumber-tests/src/test/resources/org/eclipse/tractusx/irs/cucumber/features/dummy.feature diff --git a/irs-cucumber-tests/src/test/resources/org/eclipse/tractusx/irs/cucumber/features/dummy.feature b/irs-cucumber-tests/src/test/resources/org/eclipse/tractusx/irs/cucumber/features/dummy.feature deleted file mode 100644 index 446c42c6c5..0000000000 --- a/irs-cucumber-tests/src/test/resources/org/eclipse/tractusx/irs/cucumber/features/dummy.feature +++ /dev/null @@ -1,30 +0,0 @@ -# -# Copyright (c) 2022,2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) -# Copyright (c) 2021,2024 Contributors to the Eclipse Foundation -# -# See the NOTICE file(s) distributed with this work for additional -# information regarding copyright ownership. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://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. -# -# SPDX-License-Identifier: Apache-2.0 - -Feature: Dummy (just for testing during dev) - - Background: - Given the IRS URL "https://irs.dev.demo.catena-x.net/" -- policystore - And the admin user api key -- policystore - - @DEV @INTEGRATION_TEST - @DUMMY - Scenario: Asdf - # just do something for testing workflow here - When I successfully fetch all policies From 21e4405d201971934dc3e941ec8387f6ea2539c4 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Wed, 26 Jun 2024 13:59:56 +0200 Subject: [PATCH 34/44] chore(build):[#222] simplify --- .github/workflows/integration-test-DEV.yaml | 29 ++++----------------- 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/.github/workflows/integration-test-DEV.yaml b/.github/workflows/integration-test-DEV.yaml index 274db2d2ef..25db785288 100644 --- a/.github/workflows/integration-test-DEV.yaml +++ b/.github/workflows/integration-test-DEV.yaml @@ -3,10 +3,10 @@ name: IRS DEV Cucumber Integration test execution on: workflow_dispatch: # Trigger manually inputs: - additionalFilter: - description: 'Additional execution filter' + executionFilter: + description: 'Execution filter' required: false - default: '' + default: '!Ignore & !INACTIVE & INTEGRATION_TEST & DEV' push: branches: - 'main' @@ -52,31 +52,12 @@ jobs: fi shell: bash - - prepare-execution-filter: - runs-on: ubuntu-latest - needs: check-config - outputs: - executionFilter: ${{ steps.set-filter.outputs.executionFilter }} - steps: - - name: Set execution filter - id: set-filter - run: | - base_filter="!Ignore & !INACTIVE & INTEGRATION_TEST & DEV" - if [ -n "${{ github.event.inputs.additionalFilter }}" ]; then - execution_filter="${base_filter} & ${{ github.event.inputs.additionalFilter }}" - else - execution_filter="${base_filter}" - fi - echo "::set-output name=executionFilter::${execution_filter}" - - trigger-integration-test: - needs: prepare-execution-filter + needs: check-config uses: ./.github/workflows/cucumber-integration-test.yaml secrets: regularUserApiKey: ${{ secrets.DEV_REGULAR_USER_API_KEY }} adminUserApiKey: ${{ secrets.DEV_ADMIN_USER_API_KEY }} cucumberPublishToken: ${{ secrets.IRS_CUCUMBER_PUBLISH_TOKEN }} with: - executionFilter: ${{ needs.prepare-execution-filter.outputs.executionFilter }} + executionFilter: ${{ github.event.inputs.executionFilter }} From b115727cf7b276f73137e9327e68440c9b08e744 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Wed, 26 Jun 2024 15:08:17 +0200 Subject: [PATCH 35/44] chore(build):[#222] try to make publish optional --- .github/workflows/cucumber-integration-test.yaml | 11 +++++++++-- .../tractusx/irs/cucumber/RunCucumberTest.java | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cucumber-integration-test.yaml b/.github/workflows/cucumber-integration-test.yaml index 16f6bc7c7e..07c7953ea1 100644 --- a/.github/workflows/cucumber-integration-test.yaml +++ b/.github/workflows/cucumber-integration-test.yaml @@ -41,9 +41,16 @@ jobs: ADMIN_USER_API_KEY: ${{ secrets.adminUserApiKey }} ISSUE_FILTER: ${{ inputs.executionFilter }} CUCUMBER_PUBLISH_TOKEN: ${{ secrets.cucumberPublishToken }} - # workaround replacement since injecting the token via environment variable does not work run: | - sed -i "s/CUCUMBER_TOKEN_IRS_PLACEHOLDER/${CUCUMBER_PUBLISH_TOKEN}/g" irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java + if [ -z "${{ secrets.cucumberPublishToken }}" ]; then + echo "Publish cucumber report disabled" + sed -i "s/PUBLISH_ENABLED_FLAG/false/g" irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java + else + echo "Publish cucumber report enabled" + sed -i "s/PUBLISH_ENABLED_FLAG/true/g" irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java + # workaround replacement since injecting the token via environment variable does not work + sed -i "s/CUCUMBER_TOKEN_IRS_PLACEHOLDER/${CUCUMBER_PUBLISH_TOKEN}/g" irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java + fi mvn clean verify -P cucumber -Dgroups="$ISSUE_FILTER" -pl irs-cucumber-tests -am --batch-mode 2> irs-cucumber-tests/report-banner.txt diff --git a/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java b/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java index ac1fd087f3..d7a4f61fab 100644 --- a/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java +++ b/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java @@ -22,6 +22,7 @@ import static io.cucumber.junit.platform.engine.Constants.ANSI_COLORS_DISABLED_PROPERTY_NAME; import static io.cucumber.junit.platform.engine.Constants.GLUE_PROPERTY_NAME; import static io.cucumber.junit.platform.engine.Constants.PLUGIN_PROPERTY_NAME; +import static io.cucumber.junit.platform.engine.Constants.PLUGIN_PUBLISH_ENABLED_PROPERTY_NAME; import static io.cucumber.junit.platform.engine.Constants.PLUGIN_PUBLISH_TOKEN_PROPERTY_NAME; import org.junit.platform.suite.api.ConfigurationParameter; @@ -33,6 +34,7 @@ @IncludeEngines("cucumber") @SelectPackages("org.eclipse.tractusx.irs.cucumber") @ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "org.eclipse.tractusx.irs.cucumber") +@ConfigurationParameter(key = PLUGIN_PUBLISH_ENABLED_PROPERTY_NAME, value = "PUBLISH_ENABLED_FLAG") @ConfigurationParameter(key = PLUGIN_PUBLISH_TOKEN_PROPERTY_NAME, value = "CUCUMBER_TOKEN_IRS_PLACEHOLDER") @ConfigurationParameter(key = ANSI_COLORS_DISABLED_PROPERTY_NAME, value = "true") @ConfigurationParameter(key = PLUGIN_PROPERTY_NAME, From 6393ba4a41ca9b2bf05ba72e33f782aae9f17901 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Wed, 26 Jun 2024 15:14:28 +0200 Subject: [PATCH 36/44] chore(build):[#222] try to make publish optional --- .github/workflows/integration-test-DEV.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/integration-test-DEV.yaml b/.github/workflows/integration-test-DEV.yaml index 25db785288..c371dea519 100644 --- a/.github/workflows/integration-test-DEV.yaml +++ b/.github/workflows/integration-test-DEV.yaml @@ -44,13 +44,13 @@ jobs: echo "Error: Missing secret: Please configure DEV_ADMIN_USER_API_KEY." exit 1 fi - - name: Check if IRS_CUCUMBER_PUBLISH_TOKEN is defined - run: | - if [[ -z "${{ secrets.IRS_CUCUMBER_PUBLISH_TOKEN }}" ]]; then - echo "Error: Missing secret: Please configure IRS_CUCUMBER_PUBLISH_TOKEN." - exit 1 - fi - shell: bash +# - name: Check if IRS_CUCUMBER_PUBLISH_TOKEN is defined +# run: | +# if [[ -z "${{ secrets.IRS_CUCUMBER_PUBLISH_TOKEN }}" ]]; then +# echo "Error: Missing secret: Please configure IRS_CUCUMBER_PUBLISH_TOKEN." +# exit 1 +# fi +# shell: bash trigger-integration-test: needs: check-config From 2dd068849b6481d63b875506662e049930486867 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Wed, 26 Jun 2024 15:25:53 +0200 Subject: [PATCH 37/44] chore(build):[#222] revert trial to make publish optional (does not work somehow) --- .github/workflows/integration-test-DEV.yaml | 14 +++++++------- .../tractusx/irs/cucumber/RunCucumberTest.java | 2 -- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/integration-test-DEV.yaml b/.github/workflows/integration-test-DEV.yaml index c371dea519..25db785288 100644 --- a/.github/workflows/integration-test-DEV.yaml +++ b/.github/workflows/integration-test-DEV.yaml @@ -44,13 +44,13 @@ jobs: echo "Error: Missing secret: Please configure DEV_ADMIN_USER_API_KEY." exit 1 fi -# - name: Check if IRS_CUCUMBER_PUBLISH_TOKEN is defined -# run: | -# if [[ -z "${{ secrets.IRS_CUCUMBER_PUBLISH_TOKEN }}" ]]; then -# echo "Error: Missing secret: Please configure IRS_CUCUMBER_PUBLISH_TOKEN." -# exit 1 -# fi -# shell: bash + - name: Check if IRS_CUCUMBER_PUBLISH_TOKEN is defined + run: | + if [[ -z "${{ secrets.IRS_CUCUMBER_PUBLISH_TOKEN }}" ]]; then + echo "Error: Missing secret: Please configure IRS_CUCUMBER_PUBLISH_TOKEN." + exit 1 + fi + shell: bash trigger-integration-test: needs: check-config diff --git a/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java b/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java index d7a4f61fab..ac1fd087f3 100644 --- a/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java +++ b/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java @@ -22,7 +22,6 @@ import static io.cucumber.junit.platform.engine.Constants.ANSI_COLORS_DISABLED_PROPERTY_NAME; import static io.cucumber.junit.platform.engine.Constants.GLUE_PROPERTY_NAME; import static io.cucumber.junit.platform.engine.Constants.PLUGIN_PROPERTY_NAME; -import static io.cucumber.junit.platform.engine.Constants.PLUGIN_PUBLISH_ENABLED_PROPERTY_NAME; import static io.cucumber.junit.platform.engine.Constants.PLUGIN_PUBLISH_TOKEN_PROPERTY_NAME; import org.junit.platform.suite.api.ConfigurationParameter; @@ -34,7 +33,6 @@ @IncludeEngines("cucumber") @SelectPackages("org.eclipse.tractusx.irs.cucumber") @ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "org.eclipse.tractusx.irs.cucumber") -@ConfigurationParameter(key = PLUGIN_PUBLISH_ENABLED_PROPERTY_NAME, value = "PUBLISH_ENABLED_FLAG") @ConfigurationParameter(key = PLUGIN_PUBLISH_TOKEN_PROPERTY_NAME, value = "CUCUMBER_TOKEN_IRS_PLACEHOLDER") @ConfigurationParameter(key = ANSI_COLORS_DISABLED_PROPERTY_NAME, value = "true") @ConfigurationParameter(key = PLUGIN_PROPERTY_NAME, From 6f5dbf408b398bff9f4c9ef2e5e21f708716cfc5 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Wed, 26 Jun 2024 15:37:19 +0200 Subject: [PATCH 38/44] chore(build):[#222] rename int-test-automation.yml to smoketest.yml --- .github/workflows/{int-test-automation.yml => smoketest.yml} | 2 +- TESTS.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{int-test-automation.yml => smoketest.yml} (97%) diff --git a/.github/workflows/int-test-automation.yml b/.github/workflows/smoketest.yml similarity index 97% rename from .github/workflows/int-test-automation.yml rename to .github/workflows/smoketest.yml index d9ac02bdff..e648281acb 100644 --- a/.github/workflows/int-test-automation.yml +++ b/.github/workflows/smoketest.yml @@ -1,4 +1,4 @@ -name: IRS integration tests +name: IRS smoke tests on: workflow_dispatch: diff --git a/TESTS.md b/TESTS.md index b7e9059acd..e19b86d9bc 100644 --- a/TESTS.md +++ b/TESTS.md @@ -47,7 +47,7 @@ Wiremock Tests and their corresponding utilities are marked by the suffix `Wirem ### Smoke Tests - The smoke test can be found under `irs-integration-tests/src/test/java/org/eclipse/tractusx/irs/smoketest/ItemGraphSmokeTest.java`. -- It is executed via the GitHub workflow [IRS integration tests](.github/workflows/int-test-automation.yml). +- It is executed via the GitHub workflow [IRS integration tests](.github/workflows/smoketest.yml). ### Regression Tests From 19fc5a3f22266f33cb390b8a0e7909e54ffe9ce3 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Wed, 26 Jun 2024 16:02:04 +0200 Subject: [PATCH 39/44] chore(build):[#222] check for missing secrets in irs-load-test.yaml --- .github/workflows/irs-load-test.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/irs-load-test.yaml b/.github/workflows/irs-load-test.yaml index 25fa75c633..8c3166c594 100644 --- a/.github/workflows/irs-load-test.yaml +++ b/.github/workflows/irs-load-test.yaml @@ -19,7 +19,32 @@ on: required: false jobs: + + check-config: + runs-on: ubuntu-latest + steps: + - name: Check if OAUTH2_CLIENT_TOKEN_URI is defined + run: | + if [[ -z "${{ secrets.OAUTH2_CLIENT_TOKEN_URI }}" ]]; then + echo "Error: Missing secret: Please configure OAUTH2_CLIENT_TOKEN_URI." + exit 1 + fi + - name: Check if OAUTH2_CLIENT_SECRET is defined + run: | + if [[ -z "${{ secrets.OAUTH2_CLIENT_SECRET }}" ]]; then + echo "Error: Missing secret: Please configure OAUTH2_CLIENT_SECRET." + exit 1 + fi + - name: Check if OAUTH2_CLIENT_ID is defined + run: | + if [[ -z "${{ secrets.OAUTH2_CLIENT_ID }}" ]]; then + echo "Error: Missing secret: Please configure OAUTH2_CLIENT_ID." + exit 1 + fi + shell: bash + gatling-test: + needs: check-config runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From ba499ee32ea8ad871e02218aae240d753494745f Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Wed, 26 Jun 2024 17:51:35 +0200 Subject: [PATCH 40/44] chore(build):[#222] check that releases are created on Tractus-X only --- .github/workflows/helm-chart-release.yaml | 12 ++++++++++++ .github/workflows/release.yaml | 12 ++++++++++++ .github/workflows/update-docs-for-release.yml | 12 ++++++++++++ 3 files changed, 36 insertions(+) diff --git a/.github/workflows/helm-chart-release.yaml b/.github/workflows/helm-chart-release.yaml index 529bdd3289..da5d518757 100644 --- a/.github/workflows/helm-chart-release.yaml +++ b/.github/workflows/helm-chart-release.yaml @@ -9,7 +9,19 @@ on: - 'charts/**' jobs: + + check-repository: + runs-on: ubuntu-latest + steps: + - name: Check repository + run: | + if [ "${{ github.repository }}" != "eclipse-tractusx/your-repository-name" ]; then + echo "Releases must be created on Tractus-X only." + exit 1 + fi + get-helm-charts-versions-irs: + needs: check-repository outputs: latest_version: ${{ steps.step1.outputs.latest_version }} current_version: ${{ steps.step2.outputs.current_version }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 010c312c8a..ef9fed8c2a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -17,7 +17,19 @@ on: type: string jobs: + + check-repository: + runs-on: ubuntu-latest + steps: + - name: Check repository + run: | + if [ "${{ github.repository }}" != "eclipse-tractusx/your-repository-name" ]; then + echo "Releases must be created on Tractus-X only." + exit 1 + fi + release: + needs: check-repository runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/update-docs-for-release.yml b/.github/workflows/update-docs-for-release.yml index 70fdf27f77..5a6a2c9f55 100644 --- a/.github/workflows/update-docs-for-release.yml +++ b/.github/workflows/update-docs-for-release.yml @@ -28,8 +28,20 @@ on: - 'No' default: 'No' jobs: + + check-repository: + runs-on: ubuntu-latest + steps: + - name: Check repository + run: | + if [ "${{ github.repository }}" != "eclipse-tractusx/your-repository-name" ]; then + echo "Releases must be created on Tractus-X only." + exit 1 + fi + update-docs-for-release: runs-on: ubuntu-latest + needs: check-repository outputs: previous-irs-version: ${{ steps.update-docs.outputs.previous-irs-version }} From aa2c2818f7570d0167e96a9925d3f9bafc037e43 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Thu, 27 Jun 2024 12:32:39 +0200 Subject: [PATCH 41/44] Revert "chore(build):[#222] check that releases are created on Tractus-X only" This reverts commit ba499ee32ea8ad871e02218aae240d753494745f. --- .github/workflows/helm-chart-release.yaml | 12 ------------ .github/workflows/release.yaml | 12 ------------ .github/workflows/update-docs-for-release.yml | 12 ------------ 3 files changed, 36 deletions(-) diff --git a/.github/workflows/helm-chart-release.yaml b/.github/workflows/helm-chart-release.yaml index da5d518757..529bdd3289 100644 --- a/.github/workflows/helm-chart-release.yaml +++ b/.github/workflows/helm-chart-release.yaml @@ -9,19 +9,7 @@ on: - 'charts/**' jobs: - - check-repository: - runs-on: ubuntu-latest - steps: - - name: Check repository - run: | - if [ "${{ github.repository }}" != "eclipse-tractusx/your-repository-name" ]; then - echo "Releases must be created on Tractus-X only." - exit 1 - fi - get-helm-charts-versions-irs: - needs: check-repository outputs: latest_version: ${{ steps.step1.outputs.latest_version }} current_version: ${{ steps.step2.outputs.current_version }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ef9fed8c2a..010c312c8a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -17,19 +17,7 @@ on: type: string jobs: - - check-repository: - runs-on: ubuntu-latest - steps: - - name: Check repository - run: | - if [ "${{ github.repository }}" != "eclipse-tractusx/your-repository-name" ]; then - echo "Releases must be created on Tractus-X only." - exit 1 - fi - release: - needs: check-repository runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/update-docs-for-release.yml b/.github/workflows/update-docs-for-release.yml index 5a6a2c9f55..70fdf27f77 100644 --- a/.github/workflows/update-docs-for-release.yml +++ b/.github/workflows/update-docs-for-release.yml @@ -28,20 +28,8 @@ on: - 'No' default: 'No' jobs: - - check-repository: - runs-on: ubuntu-latest - steps: - - name: Check repository - run: | - if [ "${{ github.repository }}" != "eclipse-tractusx/your-repository-name" ]; then - echo "Releases must be created on Tractus-X only." - exit 1 - fi - update-docs-for-release: runs-on: ubuntu-latest - needs: check-repository outputs: previous-irs-version: ${{ steps.update-docs.outputs.previous-irs-version }} From 4d0e4add0b5bcfdcdb5112d4241d970d19919b2c Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Thu, 27 Jun 2024 12:52:54 +0200 Subject: [PATCH 42/44] chore(build):[#222] delete outdated workflow script int-setup-testdata.yml --- .github/workflows/int-setup-testdata.yml | 84 ------------------------ 1 file changed, 84 deletions(-) delete mode 100644 .github/workflows/int-setup-testdata.yml diff --git a/.github/workflows/int-setup-testdata.yml b/.github/workflows/int-setup-testdata.yml deleted file mode 100644 index c97771b16d..0000000000 --- a/.github/workflows/int-setup-testdata.yml +++ /dev/null @@ -1,84 +0,0 @@ -name: Integration testdata setup - -on: - workflow_dispatch: - inputs: - testfilePath: - description: 'Path to Testdata file on GitHub' - required: true - type: string - submodelUrls: - description: 'Space-separated list of Submodel server URLs' - required: true - type: string - aasUrl: - description: 'Digital twin registry URL' - required: true - type: string - edcUrls: - description: 'Space-separated list of Provider control plane URLs' - required: true - type: string - edcApiKey: - description: 'API-Key for the provider control plane' - required: true - type: string - esrUrl: - description: 'ESR endpoint Url' - required: false - type: string - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: setup python - uses: actions/setup-python@v5 - with: - python-version: 3.8 #install the python needed - cache: 'pip' - - run: pip install -r local/testing/testdata/requirements.txt - - - name: Delete existing and setup new test data on provider EDC and Registry - if: ${{ github.event.inputs.esrUrl == '' }} - env: - TESTFILE_PATH: ${{ github.event.inputs.testfilePath }} - SUBMODEL_URLs: ${{ github.event.inputs.submodelUrls }} - AAS_URL: ${{ github.event.inputs.aasUrl }} - EDC_URLs: ${{ github.event.inputs.edcUrls }} - EDC_API_KEY: ${{ github.event.inputs.edcApiKey }} - run: | - python local/testing/testdata/reset-env.py \ - -a $AAS_URL \ - -edc $EDC_URLs \ - -k $EDC_API_KEY - python local/testing/testdata/transform-and-upload.py \ - -f $TESTFILE_PATH \ - -s $SUBMODEL_URLs \ - -a $AAS_URL \ - -edc $EDC_URLs \ - -k $EDC_API_KEY - - - name: Delete existing and setup new test data on provider EDC and Registry - if: ${{ github.event.inputs.esrUrl != '' }} - env: - TESTFILE_PATH: ${{ github.event.inputs.testfilePath }} - SUBMODEL_URLs: ${{ github.event.inputs.submodelUrls }} - AAS_URL: ${{ github.event.inputs.aasUrl }} - EDC_URLs: ${{ github.event.inputs.edcUrls }} - EDC_API_KEY: ${{ github.event.inputs.edcApiKey }} - ESR_URL: ${{ github.event.inputs.esrUrl }} - run: | - python local/testing/testdata/reset-env.py \ - -a $AAS_URL \ - -edc $EDC_URLs \ - -k $EDC_API_KEY - python local/testing/testdata/transform-and-upload.py \ - -f $TESTFILE_PATH \ - -s $SUBMODEL_URLs \ - -a $AAS_URL \ - -edc $EDC_URLs \ - -k $EDC_API_KEY - -e $ESR_URL From b38a07228594449b6a25c9ead84a7e7b1ce8a0b8 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Thu, 27 Jun 2024 14:41:29 +0200 Subject: [PATCH 43/44] chore(owasp):[#222] allow triggering OWASP workflow manually --- .github/workflows/owasp.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/owasp.yml b/.github/workflows/owasp.yml index 7fc31acbcf..6fb83925ab 100644 --- a/.github/workflows/owasp.yml +++ b/.github/workflows/owasp.yml @@ -1,6 +1,8 @@ name: "OWASP dependency scanner" on: + workflow_dispatch: # Additionally allow to trigger manually + push: branches: main paths-ignore: From 46733a1c79da4b3a0cb70e41fce13d4936e05afa Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Tue, 2 Jul 2024 17:18:39 +0200 Subject: [PATCH 44/44] chore(github-actions): [#222] cucumber integration test DEV - fix default execution filter --- .github/workflows/integration-test-DEV.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration-test-DEV.yaml b/.github/workflows/integration-test-DEV.yaml index 25db785288..f314ec76b1 100644 --- a/.github/workflows/integration-test-DEV.yaml +++ b/.github/workflows/integration-test-DEV.yaml @@ -60,4 +60,4 @@ jobs: adminUserApiKey: ${{ secrets.DEV_ADMIN_USER_API_KEY }} cucumberPublishToken: ${{ secrets.IRS_CUCUMBER_PUBLISH_TOKEN }} with: - executionFilter: ${{ github.event.inputs.executionFilter }} + executionFilter: ${{ github.event.inputs.executionFilter || '!Ignore & !INACTIVE & INTEGRATION_TEST & DEV' }}