Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix to successfully deploy on INT environments #333

Merged
merged 13 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/argo/argo_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ DELETE_INT_RESOURCES=(
"$ARGO_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_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_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_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_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_INT_B_EDC_PROVIDER/resource?group=apps&force=false&orphan=false&resourceName=tx-edc-provider-int-b-tractusx-connector-controlplane&version=v1&kind=Deployment&namespace=product-traceability-foss"
"$ARGO_INT_B_EDC_PROVIDER/resource?group=apps&force=false&orphan=false&resourceName=tx-edc-provider-int-b-tractusx-connector-dataplane&version=v1&kind=Deployment&namespace=product-traceability-foss"
"$ARGO_INT_B_REGISTRY/resource?force=false&orphan=false&resourceName=data-tx-registry-int-b-postgresql-0&version=v1&kind=PersistentVolumeClaim&namespace=product-traceability-foss"
"$ARGO_INT_B_REGISTRY/resource?group=apps&force=true&orphan=false&resourceName=tx-registry-int-b-postgresql&version=v1&kind=StatefulSet&namespace=product-traceability-foss"
"$ARGO_INT_B_REGISTRY/resource?group=apps&force=false&orphan=false&resourceName=cx-tx-registry-int-b-registry&version=v1&kind=Deployment&namespace=product-traceability-foss"
Expand Down
33 changes: 6 additions & 27 deletions .github/workflows/argo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ on:
argo_token:
description: Argo Token
required: true
api_key:
description: API-KEY (DEV/TEST, E2E, INT)
required: true


env:
ARGO_TEST_REGISTRY: "https://argo.dev.demo.catena-x.net/api/v1/applications/tracex-dt-registry-test"
ARGO_TEST_EDC_PROVIDER: "https://argo.dev.demo.catena-x.net/api/v1/applications/tracex-test-edc-provider"
Expand Down Expand Up @@ -139,7 +135,6 @@ jobs:
done
sleep 10


change_target_revision:
needs: delete_environment
runs-on: ubuntu-latest
Expand Down Expand Up @@ -242,11 +237,9 @@ jobs:
ARGO_TOKEN=$(jq -r '.inputs.argo_token' $GITHUB_EVENT_PATH)
echo ::add-mask::$ARGO_TOKEN
echo ARGO_TOKEN=$ARGO_TOKEN >> $GITHUB_ENV

- name: test apps state
run: |
source ./.github/argo/argo_config.sh

if [ "${{ github.event.inputs.environment }}" == "Dev/Test" ]; then
resources=("${DEV_TEST_RESOURCES[@]}")
elif [ "${{ github.event.inputs.environment }}" == "E2E-A/E2E-B" ]; then
Expand Down Expand Up @@ -288,12 +281,6 @@ jobs:

- name: Checkout code
uses: actions/checkout@v4

- name: mask API-Key
run: |
API_KEY=$(jq -r '.inputs.api_key' $GITHUB_EVENT_PATH)
echo ::add-mask::$API_KEY
echo API_KEY=$API_KEY >> $GITHUB_ENV

- name: Set up Python
uses: actions/setup-python@v4
Expand All @@ -304,25 +291,22 @@ jobs:
run: |
python -m pip install requests
curl -o transform-and-upload.py https://raw.githubusercontent.com/catenax-ng/tx-item-relationship-service/main/local/testing/testdata/transform-and-upload.py

if [ "${{ github.event.inputs.environment }}" == "Dev/Test" ]; then
python transform-and-upload.py -f ./tx-backend/testdata/CX_Testdata_MessagingTest_v${{ github.event.inputs.testdata_version }}.json -s https://traceability-test.dev.demo.catena-x.net/api/submodel -edc https://trace-x-test-edc.dev.demo.catena-x.net -a https://trace-x-registry-test.dev.demo.catena-x.net/semantics/registry/api/v3.0 -d https://trace-x-test-edc-dataplane.dev.demo.catena-x.net -p id-3.0-trace -k ${{ env.API_KEY }}
python transform-and-upload.py -f ./tx-backend/testdata/CX_Testdata_MessagingTest_v${{ github.event.inputs.testdata_version }}.json -s https://traceability-test.dev.demo.catena-x.net/api/submodel -edc https://trace-x-test-edc.dev.demo.catena-x.net -a https://trace-x-registry-test.dev.demo.catena-x.net/semantics/registry/api/v3.0 -d https://trace-x-test-edc-dataplane.dev.demo.catena-x.net -p id-3.0-trace -k ${{ secrets.TRACE_X_API_KEY_DEV }}
sleep 10
python transform-and-upload.py -f ./tx-backend/testdata/CX_Testdata_MessagingTest_v${{ github.event.inputs.testdata_version }}.json -s https://traceability.dev.demo.catena-x.net/api/submodel -edc https://trace-x-edc.dev.demo.catena-x.net -a https://trace-x-registry.dev.demo.catena-x.net/semantics/registry/api/v3.0 -d https://trace-x-edc-dataplane.dev.demo.catena-x.net -p id-3.0-trace -k ${{ env.API_KEY }}
python transform-and-upload.py -f ./tx-backend/testdata/CX_Testdata_MessagingTest_v${{ github.event.inputs.testdata_version }}.json -s https://traceability.dev.demo.catena-x.net/api/submodel -edc https://trace-x-edc.dev.demo.catena-x.net -a https://trace-x-registry.dev.demo.catena-x.net/semantics/registry/api/v3.0 -d https://trace-x-edc-dataplane.dev.demo.catena-x.net -p id-3.0-trace -k ${{ secrets.TRACE_X_API_KEY_DEV }}
sleep 10
elif [ "${{ github.event.inputs.environment }}" == "E2E-A/E2E-B" ]; then
python transform-and-upload.py -f ./tx-backend/testdata/CX_Testdata_MessagingTest_v${{ github.event.inputs.testdata_version }}.json -s https://traceability-e2e-a.dev.demo.catena-x.net/api/submodel -edc https://trace-x-edc-e2e-a.dev.demo.catena-x.net -a https://trace-x-registry-e2e-a.dev.demo.catena-x.net/semantics/registry/api/v3.0 -d https://trace-x-edc-e2e-a-dataplane.dev.demo.catena-x.net -p id-3.0-trace -k ${{ env.API_KEY }}
python transform-and-upload.py -f ./tx-backend/testdata/CX_Testdata_MessagingTest_v${{ github.event.inputs.testdata_version }}.json -s https://traceability-e2e-a.dev.demo.catena-x.net/api/submodel -edc https://trace-x-edc-e2e-a.dev.demo.catena-x.net -a https://trace-x-registry-e2e-a.dev.demo.catena-x.net/semantics/registry/api/v3.0 -d https://trace-x-edc-e2e-a-dataplane.dev.demo.catena-x.net -p id-3.0-trace -k ${{ secrets.TRACE_X_API_KEY_DEV }}
sleep 10
python transform-and-upload.py -f ./tx-backend/testdata/CX_Testdata_MessagingTest_v${{ github.event.inputs.testdata_version }}.json -s https://traceability-e2e-b.dev.demo.catena-x.net/api/submodel -edc https://trace-x-edc-e2e-b.dev.demo.catena-x.net -a https://trace-x-registry-e2e-b.dev.demo.catena-x.net/semantics/registry/api/v3.0 -d https://trace-x-edc-e2e-b-dataplane.dev.demo.catena-x.net -p id-3.0-trace -k ${{ env.API_KEY }}
python transform-and-upload.py -f ./tx-backend/testdata/CX_Testdata_MessagingTest_v${{ github.event.inputs.testdata_version }}.json -s https://traceability-e2e-b.dev.demo.catena-x.net/api/submodel -edc https://trace-x-edc-e2e-b.dev.demo.catena-x.net -a https://trace-x-registry-e2e-b.dev.demo.catena-x.net/semantics/registry/api/v3.0 -d https://trace-x-edc-e2e-b-dataplane.dev.demo.catena-x.net -p id-3.0-trace -k ${{ secrets.TRACE_X_API_KEY_DEV }}
sleep 10
elif [ "${{ github.event.inputs.environment }}" == "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://traceability-int-a.int.demo.catena-x.net/api/submodel -edc https://trace-x-edc-int-a.int.demo.catena-x.net -a https://trace-x-registry-int-a.int.demo.catena-x.net/semantics/registry/api/v3.0 -d https://trace-x-edc-int-a-dataplane.int.demo.catena-x.net -p id-3.0-trace -k ${{ env.API_KEY }}
python transform-and-upload.py -f ./tx-backend/testdata/CX_Testdata_MessagingTest_v${{ github.event.inputs.testdata_version }}.json -s https://traceability-int-a.int.demo.catena-x.net/api/submodel -edc https://trace-x-edc-int-a.int.demo.catena-x.net -a https://trace-x-registry-int-a.int.demo.catena-x.net/semantics/registry/api/v3.0 -d https://trace-x-edc-int-a-dataplane.int.demo.catena-x.net -p id-3.0-trace -k ${{ secrets.TRACE_X_API_KEY_INT_A }}
sleep 10
python transform-and-upload.py -f ./tx-backend/testdata/CX_Testdata_MessagingTest_v${{ github.event.inputs.testdata_version }}.json -s https://traceability-int-b.int.demo.catena-x.net/api/submodel -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.0 -d https://trace-x-edc-int-b-dataplane.int.demo.catena-x.net -p id-3.0-trace -k ${{ env.API_KEY }}

python transform-and-upload.py -f ./tx-backend/testdata/CX_Testdata_MessagingTest_v${{ github.event.inputs.testdata_version }}.json -s https://traceability-int-b.int.demo.catena-x.net/api/submodel -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.0 -d https://trace-x-edc-int-b-dataplane.int.demo.catena-x.net -p id-3.0-trace -k ${{ secrets.TRACE_X_API_KEY_INT_B }}
sleep 10
fi

registry_reload:
needs:
- upload_testdata
Expand All @@ -341,8 +325,3 @@ jobs:
curl -X GET "$ARGO_INT_A_RegistryReload"
curl -X GET "$ARGO_INT_B_RegistryReload"
fi





2 changes: 1 addition & 1 deletion .github/workflows/veracode_backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# SPDX-License-Identifier: Apache-2.0

name: "[BE][SECURITY] Trivy"
name: "[BE][SECURITY] Veracode"

on:
workflow_dispatch:
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [UNRELEASED - DD.MM.YYYY]
### Added
- Cypress Login to E2E Environment to enable cypress e2e tests.
- Fixed bug in argo workflow which allows to successfully run on INT-A/INT-B
### Changed
- Fixed table-settings reset bug
- Fixed name of veracode backend job
### Removed

## [9.0.0-rc1 - 03.11.2023]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ public QualityNotificationIdResponse createNotification(
String description,
Instant targetDate,
String severity,
String bpn,
String receiverBpn,
NotificationTypeEnum notificationType) {
final StartQualityNotificationRequest requestBody = StartQualityNotificationRequest.builder()
.partIds(partIds)
.description(description)
.targetDate(targetDate)
.severity(severity)
.bpn(bpn)
.receiverBpn(receiverBpn)
.build();
return given().log().body()
.spec(getRequestSpecification())
Expand Down Expand Up @@ -176,7 +176,7 @@ public List<QualityNotificationResponse> getReceivedNotifications(NotificationTy
return given().spec(getRequestSpecification())
.contentType(ContentType.JSON)
.when()
.get("/api/" + notificationType.label + "/received")
.get("/api/" + notificationType.label + "?size=1000&filter=channel,EQUAL,RECEIVER,AND")
.then()
.statusCode(HttpStatus.SC_OK)
.extract()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ public class StartQualityNotificationRequest {
private String description;
private Instant targetDate;
private String severity;
private String bpn;
private String receiverBpn;
}
Loading