Skip to content

Commit

Permalink
Merge branch 'main' into refactor/release-workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ds-pweick authored Jul 10, 2024
2 parents 33b5ae1 + da3bc67 commit cbbb105
Show file tree
Hide file tree
Showing 31 changed files with 1,527 additions and 145 deletions.
11 changes: 2 additions & 9 deletions .github/workflows/cucumber-integration-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,8 @@ jobs:
ISSUE_FILTER: ${{ inputs.executionFilter }}
CUCUMBER_PUBLISH_TOKEN: ${{ secrets.cucumberPublishToken }}
run: |
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
# 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
mvn clean verify -P cucumber -Dgroups="$ISSUE_FILTER" -pl irs-cucumber-tests -am --batch-mode 2> irs-cucumber-tests/report-banner.txt
Expand Down
115 changes: 60 additions & 55 deletions .github/workflows/irs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,15 @@ on:
- '!docs/src/api/**'
- 'local/**'
- 'CHANGELOG.md'

push:
branches:
- main
tags:
- '**'

jobs:
init:
runs-on: ubuntu-latest
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: ${{ secrets.SONAR_TOKEN != '' && secrets.SONAR_PROJECT_KEY != '' && secrets.SONAR_ORGANIZATION != '' }}"

jobs:
build:
runs-on: ubuntu-latest
steps:
Expand All @@ -65,11 +54,22 @@ jobs:
run: |
mvn clean verify --batch-mode
check_sonar_configured:
runs-on: ubuntu-latest
steps:
- name: check_sonar_configured
run: |
echo "Checking if sonar is configured: ${{ env.SONAR_CONFIGURED }}"
env:
SONAR_CONFIGURED: ${{ secrets.SONAR_TOKEN != '' && secrets.SONAR_PROJECT_KEY != '' && secrets.SONAR_ORGANIZATION != '' }}
outputs:
sonar_configured: ${{ env.SONAR_CONFIGURED }}

analyze_with_Sonar:
needs: [init]
needs: [check_sonar_configured]
# No need to run if we cannot use the sonar token
if: >-
needs.init.outputs.sonar_configured == 'true'
needs.check_sonar_configured.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
Expand Down Expand Up @@ -111,11 +111,10 @@ jobs:
-Dcheckstyle.skip -Dpmd.skip=true
build_images:
needs: [init]
strategy:
matrix:
image:
- irs-api
env:
IMAGE_NAMESPACE: tractusx
IMAGE_NAME: irs-api
TARGET_PLATFORMS: "linux/amd64" # add 'linux/arm64' once the upgrade to JDK 21 is done
runs-on: ubuntu-latest
outputs:
image-tag: ${{ steps.version.outputs.image_tag }}
Expand All @@ -125,58 +124,64 @@ jobs:
fetch-tags: 'true'
ref: ${{ inputs.ref-to-check-out || github.ref }}

- name: Build image to make sure Dockerfile is valid
run: |
# RUN --mount=type=cache is used in the IRS Dockerfile to cache directories for maven.
# And the --mount option requires BuildKit.
DOCKER_BUILDKIT=1 docker build --build-arg BUILD_TARGET=${{ matrix.image }} --target ${{ matrix.image }} -t ${{ matrix.image }}:latest .
# Needed to create multi-platform image
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Set image version
id: version
run: |
# Strip git ref prefix from version
VERSION=$(echo "${{ inputs.ref-to-check-out || github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ inputs.ref-to-check-out || github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Support PR ref versions
[[ "${{ github.ref }}" == "refs/pull/"* ]] && VERSION=PR-$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\)/merge,\1,')
# Use Docker `latest` tag convention
[ "$VERSION" == "main" ] && VERSION=latest
echo VERSION=$VERSION
echo "::set-output name=image_tag::$VERSION"
- name: Login to Docker Hub
if: needs.init.outputs.docker_hub_user != ''
uses: docker/login-action@v3
# Needed to create multi-platform image
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

# Create SemVer or ref tags dependent of trigger event
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}
# Automatically prepare image tags; See action docs for more examples.
# semver patter will generate tags like these for example :1 :1.2 :1.2.3
tags: |
type=ref,event=branch
type=ref,event=pr
type=sha,prefix=,format=long
type=semver,pattern={{version}}
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}
- name: DockerHub login
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
# Use existing DockerHub credentials present as secrets
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Push image (DockerHub)
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 }}
docker tag ${{ matrix.image }} $IMAGE_ID:$GITHUB_SHA
docker push $IMAGE_ID:$GITHUB_SHA
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
# Needed to create multi-platform image
platforms: ${{ env.TARGET_PLATFORMS }}
# Build image for verification purposes on every trigger event. Only push if event is not a PR
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

# 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: github.event_name != 'pull_request'
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
repository: ${{ needs.init.outputs.image_namespace }}/${{ needs.init.outputs.image_name }}
repository: ${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}
readme-filepath: ./DOCKER_NOTICE.md

trigger-trivy-image-scan:
if: >-
github.event_name != 'pull_request'
if: github.event_name != 'pull_request'
needs:
- build_images
uses: ./.github/workflows/trivy-docker-hub-scan.yml
with:
ref-to-check-out: ${{ inputs.ref-to-check-out || github.ref }}

9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ _**For better traceability add the corresponding GitHub issue number in each cha

## [Unreleased]

## [5.2.0] - 2024-07-03

### Fixed

- Fixed ESS Investigation job processing not starting #579
Expand Down Expand Up @@ -35,6 +37,10 @@ _**For better traceability add the corresponding GitHub issue number in each cha
- Support for SingleLevelUsageAsPlanned. #470
- Documentation to describe the delegate process. #470
- Added file for CC BY 4.0 license for TRG 7 #681
- Paging endpoint for Policy Store API: `GET /irs/policies/paged`. #639
- Supports multi-sort for the properties "bpn", "validUntil", "policyId", "createdOn", "action" with ascending / descending order.
- Supports AND-connected multi-filtering by the properties "bpn", "validUntil", "policyId".
- Note: filtering by "createdOn", "validUntil" will be implemented in a subsequent story.

## [5.1.4] - 2024-05-27

Expand Down Expand Up @@ -698,7 +704,8 @@ _**For better traceability add the corresponding GitHub issue number in each cha
- **Select Aspects you need** You are able to select the needed aspects for which you want to collect the correct endpoint information.


[Unreleased]: https://github.com/eclipse-tractusx/item-relationship-service/compare/5.1.4...HEAD
[Unreleased]: https://github.com/eclipse-tractusx/item-relationship-service/compare/5.2.0...HEAD
[5.2.0]: https://github.com/eclipse-tractusx/item-relationship-service/compare/5.1.4...5.2.0
[5.1.4]: https://github.com/eclipse-tractusx/item-relationship-service/compare/5.1.3...5.1.4
[5.1.3]: https://github.com/eclipse-tractusx/item-relationship-service/compare/5.1.2...5.1.3
[5.1.2]: https://github.com/eclipse-tractusx/item-relationship-service/compare/5.1.1...5.1.2
Expand Down
16 changes: 8 additions & 8 deletions DEPENDENCIES
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ maven/mavencentral/dev.failsafe/failsafe/3.3.2, Apache-2.0, approved, #9268
maven/mavencentral/dk.brics.automaton/automaton/1.11-8, BSD-2-Clause, approved, clearlydefined
maven/mavencentral/io.burt/jmespath-core/0.5.1, BSD-3-Clause, approved, clearlydefined
maven/mavencentral/io.burt/jmespath-jackson/0.5.1, BSD-3-Clause, approved, clearlydefined
maven/mavencentral/io.cucumber/ci-environment/10.0.1, MIT, approved, #13863
maven/mavencentral/io.cucumber/ci-environment/10.0.1, MIT, approved, #15218
maven/mavencentral/io.cucumber/cucumber-core/7.18.0, MIT AND (Apache-2.0 AND MIT), approved, #15146
maven/mavencentral/io.cucumber/cucumber-expressions/17.1.0, MIT, approved, #14271
maven/mavencentral/io.cucumber/cucumber-gherkin-messages/7.18.0, MIT, approved, clearlydefined
Expand Down Expand Up @@ -225,7 +225,7 @@ maven/mavencentral/org.apache.logging.log4j/log4j-core/2.20.0, Apache-2.0 AND (A
maven/mavencentral/org.apache.logging.log4j/log4j-jul/2.20.0, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.apache.logging.log4j/log4j-slf4j2-impl/2.20.0, Apache-2.0, approved, #8801
maven/mavencentral/org.apache.logging.log4j/log4j-to-slf4j/2.20.0, Apache-2.0, approved, #8799
maven/mavencentral/org.apache.tomcat.embed/tomcat-embed-core/10.1.20, Apache-2.0 AND (EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0) AND (CDDL-1.0 OR GPL-2.0-only WITH Classpath-exception-2.0) AND W3C AND CC0-1.0, approved, #5949
maven/mavencentral/org.apache.tomcat.embed/tomcat-embed-core/10.1.20, Apache-2.0 AND (EPL-2.0 OR (GPL-2.0 WITH Classpath-exception-2.0)) AND CDDL-1.0 AND (CDDL-1.1 OR (GPL-2.0-only WITH Classpath-exception-2.0)) AND EPL-2.0, approved, #15195
maven/mavencentral/org.apache.tomcat.embed/tomcat-embed-el/10.1.20, Apache-2.0, approved, #6997
maven/mavencentral/org.apache.tomcat.embed/tomcat-embed-websocket/10.1.20, Apache-2.0, approved, #7920
maven/mavencentral/org.apiguardian/apiguardian-api/1.1.2, Apache-2.0, approved, clearlydefined
Expand Down Expand Up @@ -305,12 +305,12 @@ maven/mavencentral/org.eclipse.tractusx.edc/core-spi/0.6.0, Apache-2.0, approved
maven/mavencentral/org.eclipse.tractusx.edc/edr-api/0.6.0, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx.edc/edr-spi/0.6.0, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx.irs/irs-api/0.0.2-SNAPSHOT, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx.irs/irs-common/2.1.2-SNAPSHOT, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx.irs/irs-edc-client/2.1.2-SNAPSHOT, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx.irs/irs-models/2.1.2-SNAPSHOT, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx.irs/irs-common/2.1.5-SNAPSHOT, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx.irs/irs-edc-client/2.1.5-SNAPSHOT, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx.irs/irs-models/2.1.5-SNAPSHOT, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx.irs/irs-policy-store/0.0.2-SNAPSHOT, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx.irs/irs-registry-client/2.1.2-SNAPSHOT, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx.irs/irs-testing/2.1.2-SNAPSHOT, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx.irs/irs-registry-client/2.1.5-SNAPSHOT, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx.irs/irs-testing/2.1.5-SNAPSHOT, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.glassfish/jakarta.json/2.0.1, EPL-2.0 OR GPL-2.0-only with Classpath-exception-2.0, approved, ee4j.jsonp
maven/mavencentral/org.hamcrest/hamcrest-core/2.2, BSD-3-Clause, approved, clearlydefined
maven/mavencentral/org.hamcrest/hamcrest/2.2, BSD-3-Clause, approved, clearlydefined
Expand Down Expand Up @@ -413,7 +413,7 @@ maven/mavencentral/org.springframework/spring-webmvc/6.0.19, Apache-2.0, approve
maven/mavencentral/org.testcontainers/junit-jupiter/1.18.3, MIT, approved, #7941
maven/mavencentral/org.testcontainers/junit-jupiter/1.19.7, MIT, approved, #10344
maven/mavencentral/org.testcontainers/testcontainers/1.18.3, MIT, approved, #7938
maven/mavencentral/org.testcontainers/testcontainers/1.19.7, Apache-2.0 AND MIT, approved, #10347
maven/mavencentral/org.testcontainers/testcontainers/1.19.7, MIT, approved, #15203
maven/mavencentral/org.typelevel/spire-macros_2.13/0.17.0, MIT, approved, clearlydefined
maven/mavencentral/org.unbescape/unbescape/1.1.6.RELEASE, Apache-2.0, approved, CQ18904
maven/mavencentral/org.webjars/swagger-ui/5.2.0, Apache-2.0, approved, #10221
Expand Down
6 changes: 6 additions & 0 deletions charts/item-relationship-service/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [7.2.1] - 2024-07-10
- Update bitnami/common to 2.x.x

## [7.2.0] - 2024-07-03
### Changed
- Update IRS version to 5.2.0

## [7.1.4] - 2024-05-27

Expand Down
6 changes: 3 additions & 3 deletions charts/item-relationship-service/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 7.1.4
version: 7.2.1
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "5.1.4"
appVersion: "5.2.0"
dependencies:
- name: common
repository: https://charts.bitnami.com/bitnami
version: 1.x.x
version: 2.x.x
- name: minio
repository: https://charts.min.io/
version: 5.0.1
Expand Down
Loading

0 comments on commit cbbb105

Please sign in to comment.