Skip to content

Commit

Permalink
Merge pull request #6 from catenax-ng/main
Browse files Browse the repository at this point in the history
API Wrapper replacement + Helm restructuring
  • Loading branch information
ds-jkreutzfeld authored Nov 28, 2022
2 parents c76c9c5 + 6c82275 commit eb1eb10
Show file tree
Hide file tree
Showing 295 changed files with 4,403 additions and 4,814 deletions.
35 changes: 32 additions & 3 deletions .github/workflows/helm-chart-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- 'charts/**'

jobs:
get-helm-charts-versions:
get-helm-charts-versions-irs:
outputs:
latest_version: ${{ steps.step1.outputs.latest_version }}
current_version: ${{ steps.step2.outputs.current_version }}
Expand All @@ -35,9 +35,35 @@ jobs:
echo "::set-output name=current_version::$chartVersion"
echo "Exported $chartVersion helm charts version"
get-helm-charts-versions-edc:
outputs:
latest_version: ${{ steps.step1.outputs.latest_version }}
current_version: ${{ steps.step2.outputs.current_version }}
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Get helm charts latest tag version
id: step1
run: |
latestVersion=$(git tag | grep "irs-edc-consumer-[1-9]" | tail -1)
echo "::set-output name=latest_version::$latestVersion"
echo "Exported $latestVersion latest helm charts version"
- name: Get helm charts current version
id: step2
run: |
chartVersion=irs-edc-consumer-$(cat ./charts/edc-consumer/Chart.yaml | grep "version:" | head -1 | cut -d ":" -d " " -f2)
echo "::set-output name=current_version::$chartVersion"
echo "Exported $chartVersion helm charts version"
release:
needs: "get-helm-charts-versions"
if: needs.get-helm-charts-versions.outputs.latest_version != needs.get-helm-charts-versions.outputs.current_version
needs: ["get-helm-charts-versions-irs", "get-helm-charts-versions-edc"]
if: needs.get-helm-charts-versions-irs.outputs.latest_version != needs.get-helm-charts-versions-irs.outputs.current_version || needs.get-helm-charts-versions-edc.outputs.latest_version != needs.get-helm-charts-versions-edc.outputs.current_version
# depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions
# see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
permissions:
Expand All @@ -63,6 +89,9 @@ jobs:
run: |
cd charts/irs
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add minio https://charts.min.io/
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo add grafana https://grafana.github.io/helm-charts
helm dependency update
- name: Run chart-releaser
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/tavern.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,18 @@ jobs:
KEYCLOAK_CLIENT_SECRET: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_SECRET }}
GLOBAL_ASSET_ID: ${{ github.event.inputs.global-asset-id || 'urn:uuid:cce14502-958a-42e1-8bb7-f4f41a9457d0' }}
run: |
python -m pytest api-tests/irs-api-tests.tavern.yaml
python -m pytest api-tests/irs-api-tests.tavern.yaml --junitxml=tavern-results.xml
- name: Upload results
if: always()
env:
JIRA_USERNAME: ${{ secrets.ORG_IRS_JIRA_USERNAME }}
JIRA_PASSWORD: ${{ secrets.ORG_IRS_JIRA_PASSWORD }}
# Remove tokens and upload the tavern results to JIRA Test execution TRI-910
run: |
sed "s/access_token:s = '.*'/access_token:s =/g" tavern-results.xml | sed "s/Authorization: Bearer .*/Authorization:/g" | uniq > result.xml
curl -H "Content-Type: multipart/form-data" \
-u $JIRA_USERNAME:$JIRA_PASSWORD \
-F '[email protected]' \
"https://jira.catena-x.net/rest/raven/1.0/import/execution/junit?testExecKey=TRI-910"
2 changes: 1 addition & 1 deletion .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
format: "sarif"
output: "trivy-results1.sarif"
severity: "CRITICAL,HIGH"
skip-dirs: "chart/aasregistry,chart/edc-controlplane,chart/edc-dataplane,chart/edc-provider-control-plane,chart/edc-provider-data-plane,chart/submodelservers,charts/irs-environments/local"
skip-dirs: "charts/connector/aasregistry,charts/connector/daps,charts/connector/edc-provider,charts/connector/submodelservers,charts/irs-environments/local"

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
Expand Down
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Known knowns
- PLACEHOLDER REMOVE IF EMPTY: risks that were introduced or discovered in the release and are known but not resolved

## [1.6.0] - 2022-11-25
### Added
- EDC client implementation (for negotiation and data exchange)
- New callback endpoint for EDC (path: /internal/endpoint-data-reference)
- Optional trusted port to make internal interfaces only available via that (config: server.trustedPort)

### Removed
- Removed the need for the API wrapper by directly communicating with the EDC control and data plane.

## [1.5.0] - 2022-11-11
### Added
- Added new parameters 'startedOn' and 'jobCompleted' to Job status response
Expand Down Expand Up @@ -105,7 +115,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Unresolved
- **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/1.5.0...HEAD
[Unreleased]: https://github.com/eclipse-tractusx/item-relationship-service/compare/1.6.0...HEAD
[1.6.0]: https://github.com/eclipse-tractusx/item-relationship-service/compare/1.5.0...1.6.0
[1.5.0]: https://github.com/eclipse-tractusx/item-relationship-service/compare/1.4.0...1.5.0
[1.4.0]: https://github.com/eclipse-tractusx/item-relationship-service/compare/1.3.0...1.4.0
[1.3.0]: https://github.com/eclipse-tractusx/item-relationship-service/compare/1.2.0...1.3.0
Expand Down
86 changes: 64 additions & 22 deletions api-tests/irs-api-tests.tavern.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ stages:
save:
json:
job_id: jobId
delay_after: 300
delay_after: 320

- name: fetch response for created job
request:
Expand Down Expand Up @@ -363,7 +363,7 @@ stages:
save:
json:
job_id: jobId
delay_after: 240
delay_after: 320

- name: fetch response for created job and check details
request:
Expand Down Expand Up @@ -537,7 +537,7 @@ stages:

---

test_name: Make sure job with aspects AddressAspect and ContactInformation is processed (1.3.3)
test_name: Make sure job with aspects AddressAspect and DiagnosticData is processed (1.3.3)

strict:
- headers:off
Expand Down Expand Up @@ -569,7 +569,7 @@ stages:
globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID}"
aspects:
- AddressAspect
- ContactInformation
- DiagnosticData
collectAspects: true
method: POST
headers:
Expand All @@ -584,7 +584,7 @@ stages:
save:
json:
job_id: jobId
delay_after: 240
delay_after: 300

- name: fetch response for created job and check details
request:
Expand All @@ -611,7 +611,7 @@ stages:

---

test_name: Make sure job with aspects SerialPartTypization and ContactInformation is processed (1.3.4)
test_name: Make sure job with aspects SerialPartTypization and DiagnosticData is processed (1.3.4)

strict:
- headers:off
Expand Down Expand Up @@ -643,7 +643,7 @@ stages:
globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID}"
aspects:
- SerialPartTypization
- ContactInformation
- DiagnosticData
collectAspects: true
method: POST
headers:
Expand Down Expand Up @@ -726,7 +726,7 @@ stages:
status_code: 400
json:
statusCode: BAD_REQUEST
message: "NoSuchElementException: Unsupported AspectType: UnknownAspect. Must be one of: SerialPartTypization, AssemblyPartRelationship, Batch, ProductDescription, IdConversion, MarketplaceOffer, MaterialForRecycling, PhysicalDimension, ReturnRequest, CertificateOfDestruction, CertificateOfDismantler, EndOfLife, PcfCore, PcfSupplyRelation, PcfTechnical, AddressAspect, ContactInformation, BatteryPass, VehicleDiagnosticDataQuality"
message: "NoSuchElementException: Unsupported AspectType: UnknownAspect. Must be one of: AddressAspect, AssemblyPartRelationship, Batch, BatteryPass, CertificateOfDestruction, CertificateOfDismantler, ChargingProcess, ClaimData, DiagnosticData, EndOfLife, EsrCertificate, EsrCertificateStateStatistic, IdConversion, MarketplaceOffer, MaterialForHomologation, MaterialForRecycling, PartAsPlanned, PhysicalDimension, ProductDescription, ReturnRequest, SerialPartTypization, SingleLevelBomAsPlanned, SingleLevelUsageAsBuilt"
errors: null
headers:
content-type: application/json
Expand Down Expand Up @@ -799,7 +799,7 @@ stages:
save:
json:
job_id: jobId
delay_after: 240
delay_after: 320

- name: fetch response for created job and check details
request:
Expand Down Expand Up @@ -837,20 +837,11 @@ marks:
key:
deprecated_aspect
vals:
# - AssemblyPartRelationship
# - IdConversion
# - MarketplaceOffer
# - MaterialForRecycling
# - PhysicalDimension
# - ReturnRequest
# - EndOfLife
## - SerialPartTypization
# - ProductDescription
- EoLStory
# - Material
- VehicleDiagnosticDataQuality
- PcfCore
- PcfSupplyRelation
- PcfTechnical
- ContactInformation

stages:
- name: authenticate and fetch access token
Expand Down Expand Up @@ -887,7 +878,7 @@ stages:
status_code: 400
json:
statusCode: BAD_REQUEST
message: "NoSuchElementException: Unsupported AspectType: {deprecated_aspect}. Must be one of: SerialPartTypization, AssemblyPartRelationship, Batch, ProductDescription, IdConversion, MarketplaceOffer, MaterialForRecycling, PhysicalDimension, ReturnRequest, CertificateOfDestruction, CertificateOfDismantler, EndOfLife, PcfCore, PcfSupplyRelation, PcfTechnical, AddressAspect, ContactInformation, BatteryPass, VehicleDiagnosticDataQuality"
message: "NoSuchElementException: Unsupported AspectType: {deprecated_aspect}. Must be one of: AddressAspect, AssemblyPartRelationship, Batch, BatteryPass, CertificateOfDestruction, CertificateOfDismantler, ChargingProcess, ClaimData, DiagnosticData, EndOfLife, EsrCertificate, EsrCertificateStateStatistic, IdConversion, MarketplaceOffer, MaterialForHomologation, MaterialForRecycling, PartAsPlanned, PhysicalDimension, ProductDescription, ReturnRequest, SerialPartTypization, SingleLevelBomAsPlanned, SingleLevelUsageAsBuilt"
errors: null
headers:
content-type: application/json
Expand Down Expand Up @@ -1065,7 +1056,7 @@ stages:
globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID}"
aspects:
- SerialPartTypization
- ContactInformation
- DiagnosticData
collectAspects: true
method: POST
headers:
Expand Down Expand Up @@ -1399,5 +1390,56 @@ stages:
- function: api-tests.tavern_helpers:check_startedOn_timestamp_exists
- function: api-tests.tavern_helpers:check_jobCompleted_timestamp_exists
- function: api-tests.tavern_helpers:check_startedOn_is_smaller_than_jobCompleted
headers:
content-type: application/json


---


test_name: Make sure job with bomLifecycle asPlanned + asBuilt get correct error response

strict:
- headers:off
- json:off

stages:
- name: authenticate and fetch access token
request:
url: "{tavern.env_vars.KEYCLOAK_HOST}"
method: POST
data:
grant_type: client_credentials
client_id: "{tavern.env_vars.KEYCLOAK_CLIENT_ID}"
client_secret: "{tavern.env_vars.KEYCLOAK_CLIENT_SECRET}"
response:
status_code: 200
json:
token_type: Bearer
headers:
content-type: application/json
save:
json:
access_token: access_token

- name: create a job and check error in response
request:
url: "{tavern.env_vars.IRS_HOST}/irs/jobs"
json:
globalAssetId: "{tavern.env_vars.GLOBAL_ASSET_ID}"
collectAspects: true
depth: 10
direction: "downward"
bomLifecycle: "asPlanned, asBuilt"
method: POST
headers:
content-type: application/json
Authorization: "Bearer {access_token:s}"
response:
status_code: 400
json:
statusCode: BAD_REQUEST
message: "NoSuchElementException: Unsupported BomLifecycle: asPlanned, asBuilt. Must be one of: asBuilt, asPlanned"
errors: null
headers:
content-type: application/json
4 changes: 2 additions & 2 deletions api-tests/tavern_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ def errors_for_globalAssetId_are_correct(response):
def status_of_jobs_are_as_expected(response, expected_status):
print(response.json())
for i in response.json():
actual_status = i.get("status")
actual_status = i.get("jobState")
print(f"Asserting expected status '{expected_status}' to be equal to actual status '{actual_status}'")
assert expected_status in actual_status


def status_of_all_jobs_are_given(response):
print(response.json())
for i in response.json():
actual_status = i.get("status")
actual_status = i.get("jobState")
assert any(
["COMPLETED" in actual_status, "ERROR" in actual_status, "INITIAL" in actual_status, "CANCELED" in actual_status, "RUNNING" in actual_status]
)
Expand Down
2 changes: 1 addition & 1 deletion charts/connector/aasregistry/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ registry:
host: irs-aas-registry.dev.demo.catena-x.net
## If 'authentication' is set to false, no OAuth authentication is enforced
authentication: false
idpIssuerUri: https://centralidp.demo.catena-x.net/auth/realms/CX-Central
idpIssuerUri: <path:traceability-irs/data/dev/aasregistry#idpIssuerUri>
service:
port: 8080
type: ClusterIP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ data:
web.http.control.port={{ .Values.edc.endpoints.control.port }}
web.http.control.path={{ .Values.edc.endpoints.control.path }}
edc.api.auth.key={{ .Values.edc.api.auth.key }}
edc.receiver.http.endpoint=http://{{ .Release.Name }}-irs-aaswrapper:9192/callback/endpoint-data-reference
edc.dataplane.token.validation.endpoint=http://{{ .Release.Name }}-edc-controlplane:8182/validation/token
edc.vault.hashicorp.timeout.seconds=30
edc.vault.hashicorp.health.check.enabled=true
Expand Down
File renamed without changes.
17 changes: 17 additions & 0 deletions charts/edc-consumer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [1.0.1] - 2022-11-27
### Fixed
- Fixed the default callback URL config, which resulted in a Helm template error


## [1.0.0] - 2022-11-25
### Added
- Introducing this Helm chart to provide the EDC consumer.

Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
apiVersion: v2
name: irs-aaswrapper
description: A Helm chart for Kubernetes
name: irs-edc-consumer
description: IRS Helm chart for the EDC consumer


# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
Expand All @@ -15,10 +14,15 @@ 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: 1.0.2
version: 1.0.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: "0.0.7"
appVersion: "0.1.2"

dependencies:
- name: common
repository: https://charts.bitnami.com/bitnami
version: 1.x.x
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ name: edc-controlplane
description: EDC Control-Plane
home: https://github.com/catenax-ng/product-edc/deployment/helm/edc-controlplane
type: application
appVersion: "0.1.1"
version: 0.1.1
appVersion: "0.1.2"
version: 0.1.2
maintainers: []
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ data:
edc.ids.catalog.id=urn:catalog:default
edc.ids.endpoint={{ .Values.edc.controlplane.url }}/api/v1/ids
edc.ids.endpoint.audience={{ .Values.edc.controlplane.url }}/api/v1/ids/data
edc.receiver.http.endpoint=http://{{ .Release.Name }}-irs-aaswrapper:9192/callback/endpoint-data-reference
edc.receiver.http.endpoint={{ tpl .Values.edc.receiver.callback.url . }}
edc.transfer.dataplane.sync.endpoint=http://{{ .Release.Name }}-edc-dataplane:8185/api/public
edc.transfer.proxy.endpoint={{ .Values.edc.dataplane.url }}/api/public
edc.transfer.proxy.token.signer.privatekey.alias={{ .Values.edc.transfer.proxy.token.signer.privatekey.alias }}
Expand Down
Loading

0 comments on commit eb1eb10

Please sign in to comment.