Skip to content

Commit

Permalink
Merge pull request #252 from catenax-ng/main
Browse files Browse the repository at this point in the history
Decentral flow using bpn for resolving globalAssetIds
  • Loading branch information
ds-mwesener authored Aug 16, 2023
2 parents f13c162 + df620f0 commit 9dcf2ee
Show file tree
Hide file tree
Showing 57 changed files with 601 additions and 1,487 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/sonar-scan-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
- 'tx-backend/**'
branches:
- main
schedule:
- cron: "0 0 * * *"

env:
JAVA_VERSION: 17
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/sonar-scan-frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Sonar Frontend

on:
push:
branches: [ main ]
workflow_dispatch:
schedule:
- cron: "0 0 * * *"

jobs:
build:

runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend

steps:
- uses: actions/checkout@v3
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install chrome
uses: browser-actions/setup-chrome@latest
- name: Install yarn
run: npm install yarn -g
- name: Install packages
run: yarn install
- name: Run yarn test:ci
run: CHROMIUM_BIN=$(which chrome) yarn test:ci # will run `test:ci` command
- name: Run SonarCloud check
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_FRONTEND }}
with:
projectBaseDir: frontend
args: >
-Dsonar.organization=${{ vars.SONAR_ORGANIZATION }}
-Dsonar.projectKey=${{ vars.SONAR_PROJECT_KEY_FRONTEND }}
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Changed digitalTwinRegistryRestTemplate to use token in requests
- Update asBuild test data to 1.5.3 and asPlanned to 1.5.1
- Changed transfer notification logic not to break iteration loop when sending notifications to bpn with more than 1 connector endpoints

- Decentral flow only using bpn for resolving globalAssetIds
-
### Removed

## [6.0.0 - 2023-07-21]
Expand Down
2 changes: 1 addition & 1 deletion DEPENDENCIES_BACKEND
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ maven/mavencentral/org.eclipse.edc/transfer-spi/0.1.3, Apache-2.0, approved, tec
maven/mavencentral/org.eclipse.edc/transform-spi/0.1.3, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/validator-spi/0.1.3, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/web-spi/0.1.3, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.tractusx.irs/irs-registry-client/1.0.0-20230731.142230-8, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx.irs/irs-registry-client/1.1.0-20230811.110730-1, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx.traceability/tx-backend/0.0.1-SNAPSHOT, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx.traceability/tx-models/0.0.1-SNAPSHOT, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.flywaydb/flyway-core/9.5.1, Apache-2.0, approved, #7296
Expand Down
2 changes: 1 addition & 1 deletion charts/traceability-foss/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ dependencies:
condition: pgadmin4.enabled
- name: irs-helm
repository: https://eclipse-tractusx.github.io/item-relationship-service
version: 6.3.1
version: 6.4.1
condition: irs-helm.enabled
- name: tractusx-connector
repository: https://eclipse-tractusx.github.io/tractusx-edc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ spec:
value: {{ .Values.edc.providerUrl | quote }}
- name: IRS_URL
value: {{ .Values.irs.baseUrl | quote }}
- name: REGISTRY_URL_WITH_PATH
value: {{ .Values.registry.urlWithPath | quote }}
- name: PORTAL_URL
value: {{ .Values.portal.baseUrl | quote }}
- name: EDC_CALLBACK_URL
Expand Down
12 changes: 6 additions & 6 deletions dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,37 +32,37 @@ Keep in mind to always update DEV and TEST since they are dependend on each othe
Sample invocation (DEV)

```
python transform-and-upload.py -f CX_Testdata_MessagingTest_v0.0.7.json -s https://tracex-submodel-server.dev.demo.catena-x.net -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 -p id-3.0-trace -k <apiKey> --aas3
python transform-and-upload.py -f CX_Testdata_MessagingTest_v0.0.7.json -s https://tracex-submodel-server.dev.demo.catena-x.net -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 <apiKey> --aas3
```

Sample invocation (TEST)

```
python transform-and-upload.py -f CX_Testdata_MessagingTest_v0.0.7.json -s https://tracex-submodel-server-test.dev.demo.catena-x.net -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 -p id-3.0-trace -k <apiKey> --aas3
python transform-and-upload.py -f CX_Testdata_MessagingTest_v0.0.7.json -s https://tracex-submodel-server-test.dev.demo.catena-x.net -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 <apiKey> --aas3
```

Sample invocation (E2E A)

```
python transform-and-upload.py -f CX_Testdata_MessagingTest_v0.0.7.json -s https://tracex-submodel-server-e2e-a.dev.demo.catena-x.net -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 -p id-3.0-trace -k <apiKey> --aas3
python transform-and-upload.py -f CX_Testdata_MessagingTest_v0.0.7.json -s https://tracex-submodel-server-e2e-a.dev.demo.catena-x.net -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 <apiKey> --aas3
```

Sample invocation (E2E B)

```
python transform-and-upload.py -f CX_Testdata_MessagingTest_v0.0.7.json -s https://tracex-submodel-server-e2e-b.dev.demo.catena-x.net -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 -p id-3.0-trace -k <apiKey> --aas3
python transform-and-upload.py -f CX_Testdata_MessagingTest_v0.0.7.json -s https://tracex-submodel-server-e2e-b.dev.demo.catena-x.net -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 <apiKey> --aas3
```

Sample invocation (INT A)

```
python transform-and-upload.py -f CX_Testdata_MessagingTest_v0.0.7.json -s https://tracex-submodel-server-int-a.int.demo.catena-x.net -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 -p id-3.0-trace -k <apiKey> --aas3
python transform-and-upload.py -f CX_Testdata_MessagingTest_v0.0.7.json -s https://tracex-submodel-server-int-a.int.demo.catena-x.net -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 <apiKey> --aas3
```

Sample invocation (INT B)

```
python transform-and-upload.py -f CX_Testdata_MessagingTest_v0.0.7.json -s https://tracex-submodel-server-int-b.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.0 -p id-3.0-trace -k <apiKey> --aas3
python transform-and-upload.py -f CX_Testdata_MessagingTest_v0.0.7.json -s https://tracex-submodel-server-int-b.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.0 -d https://trace-x-edc-int-b-dataplane.int.demo.catena-x.net -p id-3.0-trace -k <apiKey> --aas3
```

where:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { Severity } from '@shared/model/severity.model';
import { CloseNotificationModalComponent } from '@shared/modules/notification/modal/close/close-notification-modal.component';
import { KeycloakService } from 'keycloak-angular';

fdescribe('NotificationMenuActionsAssembler', () => {
describe('NotificationMenuActionsAssembler', () => {
let helperService: AlertHelperService | InvestigationHelperService;
let notificationCommonModalComponent: NotificationCommonModalComponent;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
SPDX-License-Identifier: Apache-2.0
-->

<h1 class="mb-4" *ngIf="showHeadline">{{ this.context + '.headline' | i18n }}</h1>
<h1 class="mb-4 normal-case" *ngIf="showHeadline">{{ this.context + '.headline' | i18n }}</h1>

<div class="mb-8">
<p class="regular-text">{{ 'requestNotification.partDescription' | i18n }}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
SPDX-License-Identifier: Apache-2.0
-->

<h2 class="mb-4 mt-4 text-center text-primary">{{ 'partDetail.investigation.headline' | i18n }}</h2>
<h2 class="mb-4 mt-4 normal-case text-center text-primary">{{ 'partDetail.investigation.headline' | i18n }}</h2>
<div class="start-investigation--wrapper">
<ng-container *viewContainer="childParts$ | async; main: mainTmp; error: errorTmp; loading: loaderTmp"></ng-container>

Expand All @@ -36,7 +36,7 @@ <h2 class="mb-4 mt-4 text-center text-primary">{{ 'partDetail.investigation.head

<div *ngIf="!(selectedChildParts$ | async)?.length" class="start-investigation start-investigation--no-data">
<mat-icon color="primary" class="scale-150">no_sim</mat-icon>
<h3>{{ 'partDetail.investigation.noSelection.header' | i18n }}</h3>
<h3 class="upper-case">{{ 'partDetail.investigation.noSelection.header' | i18n }}</h3>
<p>{{ 'partDetail.investigation.noSelection.text' | i18n }}</p>
</div>
</div>
Expand Down
19 changes: 19 additions & 0 deletions frontend/src/theme/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,34 @@
font-size: 56px;
}

h1,
normal-case {
@apply font-medium text-dark;
font-size: 56px;
text-transform: none;
}

h2 {
@apply font-medium uppercase text-dark;
font-size: 36px;
}

h2,
normal-case{
@apply font-medium uppercase text-dark;
font-size: 36px;
text-transform: none;
}

h3 {
@apply font-semiBold sm:text-xl text-dark;
font-size: 24px;
}
h3,
upper-case{
@apply uppercase font-semiBold sm:text-xl text-dark;
font-size: 24px;
}

h4 {
@apply font-semiBold sm:text-lg text-dark;
Expand Down
2 changes: 1 addition & 1 deletion tx-backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<dependency>
<groupId>org.eclipse.tractusx.irs</groupId>
<artifactId>irs-registry-client</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.1.0-SNAPSHOT</version>
</dependency>

<!-- tx-application modules -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ trait DatabaseSupport implements DatabaseProvider {
"bpn_storage",
"investigation_notification",
"investigation",
"registry_lookup_metrics",
"bpn_edc_mappings"
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,6 @@ public static SemanticModel from(AssetAsBuiltEntity assetAsBuiltEntity) {
.build();
}

public static SemanticModel from(ShellDescriptor shellDescriptor) {
return SemanticModel.builder()
.manufacturerPartId(shellDescriptor.getManufacturerPartId())
.nameAtManufacturer(shellDescriptor.getIdShort())
.nameAtCustomer(shellDescriptor.getIdShort())
.manufacturingCountry("--")
.manufacturerPartId(defaultValue(shellDescriptor.getManufacturerPartId()))
.build();
}

public static SemanticModel from(PartTypeInformation partTypeInformation, ManufacturingInformation manufacturingInformation) {
return SemanticModel.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public List<Asset> findAssets(String globalAssetId, Direction direction, List<St

if (jobResponse.isCompleted()) {
try {
// TODO exception will be often thrown probably because two transactions try to commit same primary key - check if we need to update it here
bpnRepository.updateManufacturers(jobResponse.bpns());
} catch (Exception e) {
log.warn("BPN Mapping Exception", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,12 @@ public void registerDecentralRegistryPermissions() {
OffsetDateTime offsetDateTime = OffsetDateTime.now().plusMonths(1);
AcceptedPolicy acceptedPolicy = new AcceptedPolicy(ID_TRACE_CONSTRAINT, offsetDateTime);
defaultAcceptedPoliciesProvider.addAcceptedPolicies(List.of(acceptedPolicy));
log.info("Successfully added permission to irs client lib provider");
log.info("Successfully added permission to irs client lib provider: {}", acceptedPolicy);
} catch (Exception exception) {
log.error("Failed to create Irs Policies : ", exception);
}

}

@Bean
public RegistryEventConsumer<Retry> myRetryRegistryEventConsumer() {
final Logger logger = LoggerFactory.getLogger("RetryLogger");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,12 @@

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.tractusx.irs.edc.client.policy.AcceptedPoliciesProvider;
import org.eclipse.tractusx.irs.edc.client.policy.AcceptedPolicy;
import org.eclipse.tractusx.traceability.assets.domain.base.IrsRepository;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Profile;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

import java.time.OffsetDateTime;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/********************************************************************************
* Copyright (c) 2022, 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
* Copyright (c) 2022, 2023 ZF Friedrichshafen AG
* Copyright (c) 2022, 2023 Contributors to the Eclipse Foundation
* Copyright (c) 2023 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
Expand All @@ -18,15 +16,8 @@
*
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/
package org.eclipse.tractusx.traceability.shelldescriptor.application;

package org.eclipse.tractusx.traceability.shelldescriptor.domain.repository;

import org.eclipse.tractusx.traceability.common.model.PageResult;
import org.eclipse.tractusx.traceability.shelldescriptor.domain.model.metrics.RegistryLookupMetric;
import org.springframework.data.domain.Pageable;

public interface ShellDescriptorLookupMetricRepository {
void save(RegistryLookupMetric registryLookupMetric);

PageResult<RegistryLookupMetric> getMetrics(Pageable pageable);
public interface DecentralRegistryService {
void updateShellDescriptorAndSynchronizeAssets();
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.eclipse.tractusx.irs.registryclient.exceptions.RegistryServiceException;
import org.eclipse.tractusx.traceability.common.response.ErrorResponse;
import org.eclipse.tractusx.traceability.shelldescriptor.domain.RegistryFacade;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
Expand All @@ -42,7 +40,7 @@
@RequiredArgsConstructor
public class RegistryController {

private final RegistryFacade registryFacade;
private final DecentralRegistryService decentralRegistryService;

@Operation(operationId = "reload",
summary = "Triggers reload of shell descriptors",
Expand Down Expand Up @@ -82,7 +80,7 @@ public class RegistryController {
mediaType = "application/json",
schema = @Schema(implementation = ErrorResponse.class)))})
@GetMapping("/reload")
public void reload() throws RegistryServiceException {
registryFacade.updateShellDescriptorAndSynchronizeAssets();
public void reload() {
decentralRegistryService.updateShellDescriptorAndSynchronizeAssets();
}
}
Loading

0 comments on commit 9dcf2ee

Please sign in to comment.