Skip to content

Commit

Permalink
chore(repo):[TRI-1198] Restructure repository to be more comprehensible
Browse files Browse the repository at this point in the history
ci/ -> .config/ - because this contains configuration files for various build steps, ci is too generic

api/ -> docs/src/api/ - this file documents the OpenAPI of IRS, so it should be part of the docs

testdata-transform/
api-tests/
testing/
-> all moved to local/testing, as they are all intended to be used locally (or in CI) to test some running system

dev/ -> local/development/ - to gather everything related to a local environment in one place

uml-diagrams/ -> docs/src/uml-diagrams - merged with the other diagrams, as all of them are for documentation purposes

Renamed the following folders:
edc-client -> irs-edc-client
cucumber-tests -> irs-cucumber-tests
ess -> irs-ess
integration-tests -> irs-integration-tests
All Maven modules now start with the irs- prefix and can be easily identified.
  • Loading branch information
ds-jkreutzfeld committed Apr 26, 2023
1 parent 13d0f37 commit a983f53
Show file tree
Hide file tree
Showing 365 changed files with 238 additions and 284 deletions.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions ci/checkstyle.xml → .config/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ page at http://checkstyle.sourceforge.net/config.html -->
</module>

<module name="SuppressionFilter">
<property name="file" value="ci/checkstyle-suppressions.xml"/>
<property name="file" value=".config/checkstyle-suppressions.xml"/>
<property name="optional" value="true"/>
</module>

<module name="Header">
<property name="headerFile" value="ci/irs.header"/>
<property name="headerFile" value=".config/irs.header"/>
<property name="fileExtensions" value="java"/>
</module>

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions .github/workflows/BETA-xray-cucumber-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ jobs:
env:
KEYCLOAK_CLIENT_SECRET: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_SECRET_BETA }}
run: |
unzip -o features.zip -d cucumber-tests/src/test/resources/features
mvn --batch-mode clean install -pl cucumber-tests,irs-models -D"cucumber.filter.tags"="not @Ignore and @INTEGRATION_TEST"
unzip -o features.zip -d irs-cucumber-tests/src/test/resources/features
mvn --batch-mode clean install -pl irs-cucumber-tests,irs-models -D"cucumber.filter.tags"="not @Ignore and @INTEGRATION_TEST"
- name: Submit results to Xray
if: ${{ always() && steps.download.outputs.http_response == '200' }}
env:
JIRA_USERNAME: ${{ secrets.ORG_IRS_JIRA_USERNAME }}
JIRA_PASSWORD: ${{ secrets.ORG_IRS_JIRA_PASSWORD }}
run: |
curl --request POST -u $JIRA_USERNAME:$JIRA_PASSWORD --header 'Content-Type: application/json' --data-binary '@cucumber-tests/report.json' "https://jira.catena-x.net/rest/raven/1.0/import/execution/cucumber"
curl --request POST -u $JIRA_USERNAME:$JIRA_PASSWORD --header 'Content-Type: application/json' --data-binary '@irs-cucumber-tests/report.json' "https://jira.catena-x.net/rest/raven/1.0/import/execution/cucumber"
9 changes: 2 additions & 7 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,10 @@ on:
paths-ignore:
- '**/*.md'
- '**/*.txt'
- 'api/**'
- 'api-tests/**'
- 'charts/**'
- 'ci/**'
- '.config/**'
- 'docs/**'
- 'dev/**'
- 'testdata-transform/**'
- 'testing/**'
- 'uml-diagrams/**'
- 'local/**'
- 'README.md'
- 'CHANGELOG.md'
schedule:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/int-setup-testdata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
with:
python-version: 3.8 #install the python needed
cache: 'pip'
- run: pip install -r testdata-transform/requirements.txt
- 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 == '' }}
Expand All @@ -50,11 +50,11 @@ jobs:
EDC_URLs: ${{ github.event.inputs.edcUrls }}
EDC_API_KEY: ${{ github.event.inputs.edcApiKey }}
run: |
python testdata-transform/reset-env.py \
python local/testing/testdata/reset-env.py \
-a $AAS_URL \
-edc $EDC_URLs \
-k $EDC_API_KEY
python testdata-transform/transform-and-upload.py \
python local/testing/testdata/transform-and-upload.py \
-f $TESTFILE_PATH \
-s $SUBMODEL_URLs \
-a $AAS_URL \
Expand All @@ -71,11 +71,11 @@ jobs:
EDC_API_KEY: ${{ github.event.inputs.edcApiKey }}
ESR_URL: ${{ github.event.inputs.esrUrl }}
run: |
python testdata-transform/reset-env.py \
python local/testing/testdata/reset-env.py \
-a $AAS_URL \
-edc $EDC_URLs \
-k $EDC_API_KEY
python testdata-transform/transform-and-upload.py \
python local/testing/testdata/transform-and-upload.py \
-f $TESTFILE_PATH \
-s $SUBMODEL_URLs \
-a $AAS_URL \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/int-test-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ jobs:
env:
PROFILE_GITHUB: ${{ github.event.inputs.irsTestProfile }}
run: |
mvn -Dtest=integration-tests/src/test/java/org/eclipse/tractusx/irs/smoketest/ItemGraphSmokeTest test \
mvn -Dtest=irs-integration-tests/src/test/java/org/eclipse/tractusx/irs/smoketest/ItemGraphSmokeTest test \
-D spring.profiles.active=$PROFILE_GITHUB \
-D surefire.failIfNoSpecifiedTests=false
9 changes: 2 additions & 7 deletions .github/workflows/irs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,10 @@ on:
paths-ignore:
- '**/*.md'
- '**/*.txt'
- 'api/**'
- 'api-tests/**'
- 'charts/**'
- 'ci/**'
- '.config/**'
- 'docs/**'
- 'dev/**'
- 'testdata-transform/**'
- 'testing/**'
- 'uml-diagrams/**'
- 'local/**'
- 'CHANGELOG.md'
push:
branches:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/kics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
path: "."
# Exclude paths or files from scan
# full-irs is a demonstration and not intended to run in a production environment, it can be excluded
exclude_paths: docker-compose.yml,api/irs-v1.0.yaml,api-tests/irs-api-tests.tavern.yaml,charts/irs-environments/local/*,local/full-irs
exclude_paths: local/deployment/docker-compose.yml,docs/src/api/irs-v1.0.yaml,local/testing/api-tests/irs-api-tests.tavern.yaml,charts/irs-environments/local/*,local/deployment/full-irs
# Fail on HIGH severity results
fail_on: high
# when provided with a directory on output_path
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/owasp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
paths:
- '**/pom.xml'
- 'pom.xml'
- 'ci/owasp-suppressions.xml'
- '.config/owasp-suppressions.xml'
schedule:
- cron: '0 0 * * *' # Once a day

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/spectral.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
branches:
- main
paths:
- 'api/**'
- 'ci/spectral/**'
- 'docs/src/api/**'
- '.config/spectral/**'


jobs:
Expand All @@ -20,5 +20,5 @@ jobs:
# Run Spectral
- uses: stoplightio/spectral-action@latest
with:
file_glob: 'api/*.yaml'
spectral_ruleset: 'ci/spectral/restCompleteSet.yml'
file_glob: 'docs/src/api/*.yaml'
spectral_ruleset: '.config/spectral/restCompleteSet.yml'
9 changes: 2 additions & 7 deletions .github/workflows/spotbugs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,10 @@ on:
paths-ignore:
- '**/*.md'
- '**/*.txt'
- 'api/**'
- 'api-tests/**'
- 'charts/**'
- 'ci/**'
- '.config/**'
- 'docs/**'
- 'dev/**'
- 'testdata-transform/**'
- 'testing/**'
- 'uml-diagrams/**'
- 'local/**'
- 'README.md'
- 'CHANGELOG.md'
schedule:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/swagger-editor-validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
- name: Validate OpenAPI definition
uses: char0n/swagger-editor-validate@v1
with:
definition-file: api/irs-v1.0.yaml
definition-file: docs/src/api/irs-v1.0.yaml
2 changes: 1 addition & 1 deletion .github/workflows/tavern.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
KEYCLOAK_CLIENT_SECRET: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_SECRET }}
GLOBAL_ASSET_ID: ${{ github.event.inputs.global-asset-id || 'urn:uuid:513d7be8-e7e4-49f4-a22b-8cd31317e454' }}
run: |
python -m pytest api-tests/irs-api-tests.tavern.yaml --junitxml=tavern-results.xml
python -m pytest local/testing/api-tests/irs-api-tests.tavern.yaml --junitxml=tavern-results.xml
- name: Upload results
if: always()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/trivy-image-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
output: "trivy-results2.sarif"
exit-code: "1"
severity: "CRITICAL,HIGH"
trivyignores: ci/.trivyignore
trivyignores: .config/.trivyignore

- name: Upload Trivy scan results to GitHub Security tab
if: always()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
output: "trivy-results1.sarif"
severity: "CRITICAL,HIGH"
# full-irs is a demonstration and not intended to run in a production environment, it can be excluded
skip-dirs: "charts/connector/aasregistry,charts/connector/daps,charts/connector/edc-provider,charts/connector/submodelservers,charts/irs-environments/local,local/full-irs" # skip scanning external images.
skip-dirs: "charts/connector/aasregistry,charts/connector/daps,charts/connector/edc-provider,charts/connector/submodelservers,charts/irs-environments/local,local/deployment/full-irs" # skip scanning external images.

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/xray-cucumber-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ jobs:
IRS_INT: https://irs.int.demo.catena-x.net
IRS_DEV: https://irs.dev.demo.catena-x.net
run: |
unzip -o features.zip -d cucumber-tests/src/test/resources/features
mvn --batch-mode clean install -pl cucumber-tests,irs-models -D"cucumber.filter.tags"="not @Ignore and @INTEGRATION_TEST"
unzip -o features.zip -d irs-cucumber-tests/src/test/resources/features
mvn --batch-mode clean install -pl irs-cucumber-tests,irs-models -D"cucumber.filter.tags"="not @Ignore and @INTEGRATION_TEST"
- name: Submit results to Xray
if: ${{ always() && steps.download.outputs.http_response == '200' }}
Expand All @@ -59,5 +59,5 @@ jobs:
curl --request POST \
-u $JIRA_USERNAME:$JIRA_PASSWORD \
--header 'Content-Type: application/json' \
--data-binary '@cucumber-tests/report.json' \
--data-binary '@irs-cucumber-tests/report.json' \
"https://jira.catena-x.net/rest/raven/1.0/import/execution/cucumber"
15 changes: 5 additions & 10 deletions .github/workflows/xray-cucumber.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,10 @@ on:
paths-ignore:
- '**/*.md'
- '**/*.txt'
- 'api/**'
- 'api-tests/**'
- 'charts/**'
- 'ci/**'
- '.config/**'
- 'docs/**'
- 'dev/**'
- 'testdata-transform/**'
- 'testing/**'
- 'uml-diagrams/**'
- 'local/**'
- 'README.md'
- 'CHANGELOG.md'

Expand Down Expand Up @@ -71,8 +66,8 @@ jobs:
IRS_INT: https://irs.int.demo.catena-x.net
IRS_DEV: https://irs.dev.demo.catena-x.net
run: |
unzip -o features.zip -d cucumber-tests/src/test/resources/features
mvn --batch-mode clean install -pl cucumber-tests,irs-models -D"cucumber.filter.tags"="not @Ignore and not @INTEGRATION_TEST"
unzip -o features.zip -d irs-cucumber-tests/src/test/resources/features
mvn --batch-mode clean install -pl irs-cucumber-tests,irs-models -D"cucumber.filter.tags"="not @Ignore and not @INTEGRATION_TEST"
- name: Submit results to Xray
if: ${{ always() && steps.download.outputs.http_response == '200' }}
Expand All @@ -83,5 +78,5 @@ jobs:
curl --request POST \
-u $JIRA_USERNAME:$JIRA_PASSWORD \
--header 'Content-Type: application/json' \
--data-binary '@cucumber-tests/report.json' \
--data-binary '@irs-cucumber-tests/report.json' \
"https://jira.catena-x.net/rest/raven/1.0/import/execution/cucumber"
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ dependency-reduced-pom.xml
/connector/**/bin/
### Local files ###
dev/local/*
/api-tests/variable.env
api-tests/__pycache__/
/local/testing/api-tests/variable.env
local/testing/api-tests/__pycache__/

### Cucumber ###
/cucumber-tests/report.json
/irs-cucumber-tests/report.json
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ The commit messages have to match a pattern in the form of:
Example:
``chore(api):[TRI-123] some text``

Detailed pattern can be found here: [commit-msg](./dev/commit-msg)
Detailed pattern can be found here: [commit-msg](local/development/commit-msg)

#### How to use
```shell
cp dev/commit-msg .git/hooks/commit-msg && chmod 500 .git/hooks/commit-msg
cp local/development/commit-msg .git/hooks/commit-msg && chmod 500 .git/hooks/commit-msg
```

For further information please see https://github.com/hazcod/semantic-commit-hook
Expand Down
4 changes: 2 additions & 2 deletions DEPENDENCIES
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ maven/mavencentral/org.eclipse.dataspaceconnector/contract-spi/0.0.1-milestone-6
maven/mavencentral/org.eclipse.dataspaceconnector/core-spi/0.0.1-milestone-6, Apache-2.0, approved, #5189
maven/mavencentral/org.eclipse.dataspaceconnector/policy-evaluator/0.0.1-milestone-6, Apache-2.0, approved, #5188
maven/mavencentral/org.eclipse.dataspaceconnector/policy-spi/0.0.1-milestone-6, Apache-2.0, approved, #5192
maven/mavencentral/org.eclipse.tractusx.irs/edc-client/0.0.2-SNAPSHOT, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx.irs/ess/0.0.2-SNAPSHOT, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx.irs/irs-edc-client/0.0.2-SNAPSHOT, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx.irs/irs-ess/0.0.2-SNAPSHOT, 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/0.0.2-SNAPSHOT, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx.irs/irs-models/0.0.2-SNAPSHOT, Apache-2.0, approved, automotive.tractusx
Expand Down
3 changes: 1 addition & 2 deletions DataChainKit.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ DataChainKit brings valuable data chain information to apps and services through
## API Description
For each App or Service Provider can use this documentation to implement their own instance to participate within the Catena-X
- 📄 [IRS REST API Documentation](https://eclipse-tractusx.github.io/item-relationship-service/docs/api-specification/api-specification.html)
- 📄 [IRS Specification](https://eclipse-tractusx.github.io/item-relationship-service/docs/arc42) (only for consortia members accessible)
- 📄 [IRS Specification](https://eclipse-tractusx.github.io/item-relationship-service/docs/arc42)

## Item Relationship Service
The Item Relationship Service (IRS) is the first reference application of the DataChainKit. It is built with the Java Spring framework. It is dockerized and can easily be deployed via helm or docker compose on infrastructure you choose.

### Requirements
The IRS needs to be deployed with the following components in the same environment:
- [Eclipse Dataspace Connector](https://github.com/eclipse-dataspaceconnector/DataSpaceConnector)
- AAS Wrapper

The Service interacts with the Catena-X [Digital Twin Registry](https://catena-x.net/en/angebote/digitaler-zwilling) and is built upon the Catena-X Semantic Models which are stored in the [Semantic Hub](https://catena-x.net/en/angebote/digitaler-zwilling).

Expand Down
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@ ARG BUILD_TARGET=irs-api

WORKDIR /build

COPY ci ci
COPY api api
COPY .config ci
COPY docs/src/api api
COPY .mvn .mvn
COPY pom.xml .

COPY ess ess
COPY integration-tests integration-tests
COPY irs-ess irs-ess
COPY irs-integration-tests irs-integration-tests
COPY irs-api irs-api
COPY irs-common irs-common
COPY edc-client edc-client
COPY irs-edc-client irs-edc-client
COPY irs-models irs-models
COPY irs-parent-spring-boot irs-parent-spring-boot
COPY irs-testing irs-testing
COPY irs-report-aggregate irs-report-aggregate
COPY cucumber-tests cucumber-tests
COPY irs-cucumber-tests irs-cucumber-tests
COPY docs docs
COPY irs-load-tests irs-load-tests

Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ A detailed instruction on how to configure the IRS and EDC can be found here: [A
IRS provides a local setup which can be deployed to kubernetes.
This setup includes all third-party services which IRS uses and interacts with.

Instructions can be found here [README.md](https://github.com/eclipse-tractusx/item-relationship-service/blob/main/local/full-irs/README.md).
Instructions can be found here [README.md](https://github.com/eclipse-tractusx/item-relationship-service/blob/main/local/deployment/full-irs/README.md).
22 changes: 0 additions & 22 deletions ci/.checkov.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion api/README.md → docs/src/api/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Item Relationship Service API documentation

This documentation is manually downloaded from Swagger UI (see Swagger UI section in the
project's [README](../README.md) for how to run).
project's [README](../../../README.md) for how to run).

Integration tests verify that the OpenAPI specification generated by controller annotations exactly match the OpenAPI
specification stored here.
File renamed without changes.
Loading

0 comments on commit a983f53

Please sign in to comment.