Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into chore/#999-notification-processin…
Browse files Browse the repository at this point in the history
…g-feedback
  • Loading branch information
ds-mmaul committed Jul 10, 2024
2 parents e9e94c6 + 28a4ce4 commit 78d1b9d
Show file tree
Hide file tree
Showing 29 changed files with 269 additions and 96 deletions.
61 changes: 61 additions & 0 deletions .github/argo/argo_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,42 @@ DELETE_INT_RESOURCES=(
"$ARGO_INT_B_SUBMODELSERVER/resource?group=apps&force=false&orphan=false&resourceName=tracex-int-b-submodelserver-submodelservers&version=v1&kind=Deployment&namespace=product-traceability-foss"

)


DELETE_ASSOCIATION_INT_RESOURCES=(
"$ARGO_ASSOCIATION_INT_A_TRACE_X_INSTANCE/resource?force=false&orphan=false&resourceName=data-tx-backend-postgresql-int-a-0&version=v1&kind=PersistentVolumeClaim&namespace=product-traceability-foss"
"$ARGO_ASSOCIATION_INT_A_TRACE_X_INSTANCE/resource?group=apps&force=true&orphan=false&resourceName=tx-backend-postgresql-int-a&version=v1&kind=StatefulSet&namespace=product-traceability-foss"
"$ARGO_ASSOCIATION_INT_A_TRACE_X_INSTANCE/resource?force=false&orphan=false&resourceName=data-tx-edc-consumer-postgresql-int-a-0&version=v1&kind=PersistentVolumeClaim&namespace=product-traceability-foss"
"$ARGO_ASSOCIATION_INT_A_TRACE_X_INSTANCE/resource?group=apps&force=true&orphan=false&resourceName=tx-edc-consumer-postgresql-int-a&version=v1&kind=StatefulSet&namespace=product-traceability-foss"
"$ARGO_ASSOCIATION_INT_A_TRACE_X_INSTANCE/resource?group=apps&force=false&orphan=false&resourceName=tx-backend-int-a&version=v1&kind=Deployment&namespace=product-traceability-foss"
"$ARGO_ASSOCIATION_INT_A_TRACE_X_INSTANCE/resource?group=apps&force=false&orphan=false&resourceName=tx-edc-consumer-int-a-controlplane&version=v1&kind=Deployment&namespace=product-traceability-foss"
"$ARGO_ASSOCIATION_INT_A_TRACE_X_INSTANCE/resource?group=apps&force=true&orphan=false&resourceName=tx-edc-consumer-int-a-dataplane&version=v1&kind=Deployment&namespace=product-traceability-foss"
"$ARGO_ASSOCIATION_INT_A_EDC_PROVIDER/resource?force=false&orphan=false&resourceName=data-tx-edc-provider-postgresql-int-a-0&version=v1&kind=PersistentVolumeClaim&namespace=product-traceability-foss"
"$ARGO_ASSOCIATION_INT_A_EDC_PROVIDER/resource?group=apps&force=true&orphan=false&resourceName=tx-edc-provider-postgresql-int-a&version=v1&kind=StatefulSet&namespace=product-traceability-foss"
"$ARGO_ASSOCIATION_INT_A_EDC_PROVIDER/resource?group=apps&force=false&orphan=false&resourceName=tx-edc-provider-int-a-controlplane&version=v1&kind=Deployment&namespace=product-traceability-foss"
"$ARGO_ASSOCIATION_INT_A_EDC_PROVIDER/resource?group=apps&force=false&orphan=false&resourceName=tx-edc-provider-int-a-dataplane&version=v1&kind=Deployment&namespace=product-traceability-foss"
"$ARGO_ASSOCIATION_INT_A_REGISTRY/resource?force=false&orphan=false&resourceName=data-tracex-registry-int-a-postgresql-0&version=v1&kind=PersistentVolumeClaim&namespace=product-traceability-foss"
"$ARGO_ASSOCIATION_INT_A_REGISTRY/resource?group=apps&force=true&orphan=false&resourceName=tracex-registry-int-a-postgresql&version=v1&kind=StatefulSet&namespace=product-traceability-foss"
"$ARGO_ASSOCIATION_INT_A_REGISTRY/resource?group=apps&force=false&orphan=false&resourceName=tracex-registry-int-a&version=v1&kind=Deployment&namespace=product-traceability-foss"
"$ARGO_ASSOCIATION_INT_A_SUBMODELSERVER/resource?group=apps&force=false&orphan=false&resourceName=trace-x-int-a-submodelserver-submodelservers&version=v1&kind=Deployment&namespace=product-traceability-foss"

"$ARGO_ASSOCIATION_INT_B_TRACE_X_INSTANCE/resource?force=false&orphan=false&resourceName=data-tx-backend-postgresql-int-b-0&version=v1&kind=PersistentVolumeClaim&namespace=product-traceability-foss"
"$ARGO_ASSOCIATION_INT_B_TRACE_X_INSTANCE/resource?group=apps&force=true&orphan=false&resourceName=tx-backend-postgresql-int-b&version=v1&kind=StatefulSet&namespace=product-traceability-foss"
"$ARGO_ASSOCIATION_INT_B_TRACE_X_INSTANCE/resource?force=false&orphan=false&resourceName=data-tx-edc-consumer-postgresql-int-b-0&version=v1&kind=PersistentVolumeClaim&namespace=product-traceability-foss"
"$ARGO_ASSOCIATION_INT_B_TRACE_X_INSTANCE/resource?group=apps&force=true&orphan=false&resourceName=tx-edc-consumer-postgresql-int-b&version=v1&kind=StatefulSet&namespace=product-traceability-foss"
"$ARGO_ASSOCIATION_INT_B_TRACE_X_INSTANCE/resource?group=apps&force=false&orphan=false&resourceName=tx-backend-int-b&version=v1&kind=Deployment&namespace=product-traceability-foss"
"$ARGO_ASSOCIATION_INT_B_TRACE_X_INSTANCE/resource?group=apps&force=false&orphan=false&resourceName=tx-edc-consumer-int-b-controlplane&version=v1&kind=Deployment&namespace=product-traceability-foss"
"$ARGO_ASSOCIATION_INT_B_TRACE_X_INSTANCE/resource?group=apps&force=true&orphan=false&resourceName=tx-edc-consumer-int-b-dataplane&version=v1&kind=Deployment&namespace=product-traceability-foss"
"$ARGO_ASSOCIATION_INT_B_EDC_PROVIDER/resource?force=false&orphan=false&resourceName=data-tx-edc-provider-postgresql-int-b-0&version=v1&kind=PersistentVolumeClaim&namespace=product-traceability-foss"
"$ARGO_ASSOCIATION_INT_B_EDC_PROVIDER/resource?group=apps&force=true&orphan=false&resourceName=tx-edc-provider-postgresql-int-b&version=v1&kind=StatefulSet&namespace=product-traceability-foss"
"$ARGO_ASSOCIATION_INT_B_EDC_PROVIDER/resource?group=apps&force=false&orphan=false&resourceName=tx-edc-provider-int-b-controlplane&version=v1&kind=Deployment&namespace=product-traceability-foss"
"$ARGO_ASSOCIATION_INT_B_EDC_PROVIDER/resource?group=apps&force=false&orphan=false&resourceName=tx-edc-provider-int-b-dataplane&version=v1&kind=Deployment&namespace=product-traceability-foss"
"$ARGO_ASSOCIATION_INT_B_REGISTRY/resource?force=false&orphan=false&resourceName=data-tracex-registry-int-b-postgresql-0&version=v1&kind=PersistentVolumeClaim&namespace=product-traceability-foss"
"$ARGO_ASSOCIATION_INT_B_REGISTRY/resource?group=apps&force=true&orphan=false&resourceName=tracex-registry-int-b-postgresql&version=v1&kind=StatefulSet&namespace=product-traceability-foss"
"$ARGO_ASSOCIATION_INT_B_REGISTRY/resource?group=apps&force=false&orphan=false&resourceName=tracex-registry-int-b&version=v1&kind=Deployment&namespace=product-traceability-foss"
"$ARGO_ASSOCIATION_INT_B_SUBMODELSERVER/resource?group=apps&force=false&orphan=false&resourceName=trace-x-int-b-submodelserver-submodelservers&version=v1&kind=Deployment&namespace=product-traceability-foss"

)
SYNC_DEV_TEST_RESOURCES=(
"$ARGO_TEST_REGISTRY/sync"
"$ARGO_TEST_EDC_PROVIDER/sync"
Expand Down Expand Up @@ -152,6 +188,18 @@ SYNC_INT_RESOURCES=(
"$ARGO_INT_B_SUBMODELSERVER/sync"
"$ARGO_INT_B_TRACE_X_INSTANCE/sync"
)

SYNC_ASSOCIATION_INT_RESOURCES=(
"$ARGO_ASSOCIATION_INT_A_REGISTRY/sync"
"$ARGO_ASSOCIATION_INT_A_EDC_PROVIDER/sync"
"$ARGO_ASSOCIATION_INT_A_TRACE_X_INSTANCE/sync"
"$ARGO_ASSOCIATION_INT_A_SUBMODELSERVER/sync"

"$ARGO_ASSOCIATION_INT_B_REGISTRY/sync"
"$ARGO_ASSOCIATION_INT_B_EDC_PROVIDER/sync"
"$ARGO_ASSOCIATION_INT_B_TRACE_X_INSTANCE/sync"
"$ARGO_ASSOCIATION_INT_B_SUBMODELSERVER/sync"
)
DEV_TEST_RESOURCES=(
"$ARGO_TEST_REGISTRY"
"$ARGO_TEST_EDC_PROVIDER"
Expand Down Expand Up @@ -187,3 +235,16 @@ INT_RESOURCES=(
)


ASSOCIATION_INT_RESOURCES=(
"$ARGO_ASSOCIATION_INT_A_REGISTRY"
"$ARGO_ASSOCIATION_INT_A_EDC_PROVIDER"
"$ARGO_ASSOCIATION_INT_A_TRACE_X_INSTANCE"
"$ARGO_ASSOCIATION_INT_A_SUBMODELSERVER"

"$ARGO_ASSOCIATION_INT_B_REGISTRY"
"$ARGO_ASSOCIATION_INT_B_EDC_PROVIDER"
"$ARGO_ASSOCIATION_INT_B_TRACE_X_INSTANCE"
"$ARGO_ASSOCIATION_INT_B_SUBMODELSERVER"
)


44 changes: 37 additions & 7 deletions .github/workflows/argo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ on:
- Dev/Test
- E2E-A/E2E-B
- int-a/int-b
- association int-a/int-b

testdata_version:
description: Which Testdata Version CX_Testdata_MessagingTest_v<X.X.X>.json e.g., 0.0.14"
required: true
Expand Down Expand Up @@ -84,16 +86,29 @@ env:
ARGO_INT_A_EDC_PROVIDER: "https://argo.int.demo.catena-x.net/api/v1/applications/tx-edc-provider-int-a"
ARGO_INT_A_TRACE_X_INSTANCE: "https://argo.int.demo.catena-x.net/api/v1/applications/traceability-foss-int-a"
ARGO_INT_A_SUBMODELSERVER: "https://argo.int.demo.catena-x.net/api/v1/applications/tracex-int-a-submodelserver"

ARGO_INT_A_RegistryReload: "https://traceability-int-a.int.demo.catena-x.net/api/registry/reload"

ARGO_INT_B_REGISTRY: "https://argo.int.demo.catena-x.net/api/v1/applications/tx-registry-int-b"
ARGO_INT_B_EDC_PROVIDER: "https://argo.int.demo.catena-x.net/api/v1/applications/tx-edc-provider-int-b"
ARGO_INT_B_TRACE_X_INSTANCE: "https://argo.int.demo.catena-x.net/api/v1/applications/traceability-foss-int-b"
ARGO_INT_B_SUBMODELSERVER: "https://argo.int.demo.catena-x.net/api/v1/applications/tracex-int-b-submodelserver"

ARGO_INT_B_RegistryReload: "https://traceability-int-b.int.demo.catena-x.net/api/registry/reload"

ARGO_ASSOCIATION_INT_A_REGISTRY: "https://argocd.int.catena-x.net/api/v1/applications/tracex-registry-int-a"
ARGO_ASSOCIATION_INT_A_EDC_PROVIDER: "https://argocd.int.catena-x.net/api/v1/applications/tx-edc-provider-int-a"
ARGO_ASSOCIATION_INT_A_TRACE_X_INSTANCE: "https://argocd.int.catena-x.net/api/v1/applications/traceability-foss-int-a"
ARGO_ASSOCIATION_INT_A_SUBMODELSERVER: "https://argocd.int.catena-x.net/api/v1/applications/trace-x-int-a-submodelserver-submodelservers"

ARGO_ASSOCIATION_INT_B_REGISTRY: "https://argocd.int.catena-x.net/api/v1/applications/tracex-registry-int-b"
ARGO_ASSOCIATION_INT_B_EDC_PROVIDER: "https://argocd.int.catena-x.net/api/v1/applications/tx-edc-provider-int-b"
ARGO_ASSOCIATION_INT_B_TRACE_X_INSTANCE: "https://argocd.int.catena-x.net/api/v1/applications/traceability-foss-int-b"
ARGO_ASSOCIATION_INT_B_SUBMODELSERVER: "https://argocd.int.catena-x.net/api/v1/applications/trace-x-int-b-submodelserver-submodelservers"






jobs:
test_input:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -126,6 +141,8 @@ jobs:
resources="${E2E_RESOURCES[2]}"
elif [ "${{ github.event.inputs.environment }}" == "int-a/int-b" ]; then
resources="${INT_RESOURCES[2]}"
elif [ "${{ github.event.inputs.environment }}" == "association int-a/int-b" ]; then
resources="${ASSOCIATION_INT_RESOURCES[2]}"
fi
data=$(curl -X GET -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" "$resources")
Expand Down Expand Up @@ -175,6 +192,8 @@ jobs:
resources=("${E2E_RESOURCES[@]}")
elif [ "${{ github.event.inputs.environment }}" == "int-a/int-b" ]; then
resources=("${INT_RESOURCES[@]}")
elif [ "${{ github.event.inputs.environment }}" == "association int-a/int-b" ]; then
resources=("${ASSOCIATION_INT_RESOURCES[@]}")
fi
for resource in "${resources[@]}"; do
Expand Down Expand Up @@ -209,10 +228,12 @@ jobs:
resources=("${DELETE_E2E_RESOURCES[@]}")
elif [ "${{ github.event.inputs.environment }}" == "int-a/int-b" ]; then
resources=("${DELETE_INT_RESOURCES[@]}")
elif [ "${{ github.event.inputs.environment }}" == "association int-a/int-b" ]; then
resources=("${DELETE_ASSOCIATION_INT_RESOURCES[@]}")
fi
for resource in "${resources[@]}"; do
curl -X DELETE -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" "$resource"
curl -X DELETE -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" -H "Content-Type: application/json" "$resource"
sleep 2
done
sleep 10
Expand Down Expand Up @@ -297,10 +318,12 @@ jobs:
resources=("${SYNC_E2E_RESOURCES[@]}")
elif [ "${{ github.event.inputs.environment }}" == "int-a/int-b" ]; then
resources=("${SYNC_INT_RESOURCES[@]}")
elif [ "${{ github.event.inputs.environment }}" == "association int-a/int-b" ]; then
resources=("${SYNC_ASSOCIATION_INT_RESOURCES[@]}")
fi
for resource in "${resources[@]}"; do
curl -X POST -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" "$resource"
curl -X POST -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" -H "Content-Type: application/json" "$resource"
done
sleep 20
Expand Down Expand Up @@ -329,6 +352,8 @@ jobs:
resources=("${E2E_RESOURCES[@]}")
elif [ "${{ github.event.inputs.environment }}" == "int-a/int-b" ]; then
resources=("${INT_RESOURCES[@]}")
elif [ "${{ github.event.inputs.environment }}" == "association int-a/int-b" ]; then
resources=("${ASSOCIATION_INT_RESOURCES[@]}")
fi
for resource in "${resources[@]}"; do
Expand All @@ -342,13 +367,13 @@ jobs:
break
elif [ "$operationState" == "Failed" ] || ([ "$status" == "OutOfSync" ] && [ "$operationState" == "Failed" ]) || ([ "$status" == "OutOfSync" ] && [ "$operationState" == "Succeeded" ]); then
echo "Another sync"
curl -X POST -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" "$resource/sync"
curl -X POST -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" -H "Content-Type: application/json" "$resource/sync"
sleep 10
elif [ "$status" == "OutOfSync" ] && [ "$operationState" == "Running" ]; then
echo "First terminate sync then start another sync"
curl -X DELETE -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" "$resource/operation?appNamespace=argocd"
curl -X DELETE -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" -H "Content-Type: application/json" "$resource/operation?appNamespace=argocd"
sleep 10
curl -X POST -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" "$resource/sync"
curl -X POST -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" -H "Content-Type: application/json" "$resource/sync"
sleep 10
else
echo "Wait"
Expand Down Expand Up @@ -391,6 +416,11 @@ jobs:
sleep 10
python transform-and-upload.py -f ./tx-backend/testdata/CX_Testdata_MessagingTest_v${{ github.event.inputs.testdata_version }}.json -s https://tracex-int-b-submodel-server.int.demo.catena-x.net -edc https://trace-x-edc-int-b.int.demo.catena-x.net -a https://trace-x-registry-int-b.int.demo.catena-x.net/semantics/registry/api/v3 -d https://trace-x-edc-int-b-dataplane.int.demo.catena-x.net -p traceability-core -k ${{ secrets.TRACE_X_API_KEY_INT_B }} --aas3 --edcBPN BPNL00000003CNKC --allowedBPNs BPNL00000003CML1 BPNL00000003CNKC BPNL00000003AZQP BPNL00000003CSGV
sleep 10
elif [ "${{ github.event.inputs.environment }}" == "association int-a/int-b" ]; then
python transform-and-upload.py -f ./tx-backend/testdata/CX_Testdata_MessagingTest_v${{ github.event.inputs.testdata_version }}.json -s https://tracex-int-a-submodel-server.int.catena-x.net -edc https://trace-x-edc-int-a.int.catena-x.net -a https://trace-x-registry-int-a.int.catena-x.net/semantics/registry/api/v3 -d https://trace-x-edc-int-a-dataplane.int.catena-x.net -p traceability-core -k ${{ secrets.TRACE_X_API_KEY_ASSOCIATION_INT }} --aas3 --edcBPN BPNL00000003CML1 --allowedBPNs BPNL00000003CML1 BPNL00000003CNKC BPNL00000003AZQP BPNL00000003CSGV
sleep 10
python transform-and-upload.py -f ./tx-backend/testdata/CX_Testdata_MessagingTest_v${{ github.event.inputs.testdata_version }}.json -s https://tracex-int-b-submodel-server.int.catena-x.net -edc https://trace-x-edc-int-b.int.catena-x.net -a https://trace-x-registry-int-b.int.catena-x.net/semantics/registry/api/v3 -d https://trace-x-edc-int-b-dataplane.int.catena-x.net -p traceability-core -k ${{ secrets.TRACE_X_API_KEY_ASSOCIATION_INT }} --aas3 --edcBPN BPNL00000003CNKC --allowedBPNs BPNL00000003CML1 BPNL00000003CNKC BPNL00000003AZQP BPNL00000003CSGV
sleep 10
fi
elif [ "${{ github.event.inputs.testdata_upload }}" == "false" ]; then
echo "Testdata upload skipped"
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,22 +83,22 @@ jobs:
Please check whether the Chart was updated correctly and that the CHANGELOG contains the relevant information
for this release. Also, make sure that the values.yaml is correct before merging this PR.
- name: Update OpenAPI spec
run: mvn test -Dsurefire.failIfNoSpecifiedTests=false -Dtest=OpenApiDocumentationIT -Dopenapi-doc.generate=true

- name: Create pull request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: action/update-openapi-spec
title: "chore(OpenAPI): updated OpenAPI spec"
labels: automated
delete-branch: true
body: |
This PR updates the OpenAPI spec. Please check whether the spec was updated correctly. Unfortunately, this
action causes a lot of nonsensical changes which should, however, be clearly recognizable.
You can safely ignore these.
# - name: Update OpenAPI spec
# run: mvn test -Dsurefire.failIfNoSpecifiedTests=false -Dtest=OpenApiDocumentationIT -Dopenapi-doc.generate=true
#
# - name: Create pull request
# uses: peter-evans/create-pull-request@v6
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# branch: action/update-openapi-spec
# title: "chore(OpenAPI): updated OpenAPI spec"
# labels: automated
# delete-branch: true
# body: |
# This PR updates the OpenAPI spec. Please check whether the spec was updated correctly. Unfortunately, this
# action causes a lot of nonsensical changes which should, however, be clearly recognizable.
# You can safely ignore these.
#
- name: Get previous version
run: echo PREVIOUS_VERSION=$(git tag | grep -E ^[0-9]+\\.[0-9]+\\.[0-9]+ | tail -2 | head -n +1) >> $GITHUB_ENV

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
run: docker build -t localhost:5000/traceability-foss:fe_${{ github.sha }} -f ./frontend/Dockerfile .

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@0.23.0
uses: aquasecurity/trivy-action@0.24.0
with:
trivyignores: "./.github/workflows/.trivyignore"
image-ref: 'localhost:5000/traceability-foss:fe_${{ github.sha }}'
Expand Down Expand Up @@ -132,7 +132,7 @@ jobs:
ref: ${{needs.prepare-env.outputs.check_sha}}

- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/trivy-action@0.23.0
uses: aquasecurity/trivy-action@0.24.0
with:
trivyignores: "./.github/workflows/.trivyignore"
scan-type: "config"
Expand Down Expand Up @@ -178,7 +178,7 @@ jobs:
tags: localhost:5000/traceability-foss:trivy

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@0.23.0
uses: aquasecurity/trivy-action@0.24.0
with:
image-ref: localhost:5000/traceability-foss:trivy
trivyignores: "./.github/workflows/.trivyignore"
Expand Down
Loading

0 comments on commit 78d1b9d

Please sign in to comment.