Skip to content

Commit

Permalink
Merge branch 'main' into feature/636-migrater-to-new-registry-version…
Browse files Browse the repository at this point in the history
…-with-client-lib
  • Loading branch information
ds-lcapellino committed Apr 4, 2024
2 parents 827db04 + 18aad25 commit 62edb8e
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 20 deletions.
11 changes: 7 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

_**For better traceability add the corresponding GitHub issue number in each changelog entry, please.**_

## [UNRELEASED - DD.MM.YYYY]

## [10.8.0 - 03.04.2024]
## [10.8.2 - 05.04.2024]
### Removed
- #547 Removed classification check on alert / investigation update callback methods

## [10.8.1 - 04.04.2024]

### Added
- #695 OAuth2.0 Client scope configuration
Expand All @@ -22,6 +25,7 @@ _**For better traceability add the corresponding GitHub issue number in each cha
- #736 add contractAgreementId as searchable field for /contracts
- Added capitalization section in guidelines.md
- #616 Allow edc notification update with empty asset list
- #630 Added Parts extended detailed view

### Changed
- #709 Bumped spring-core from 6.0.17 to 6.1.5
Expand All @@ -47,8 +51,7 @@ _**For better traceability add the corresponding GitHub issue number in each cha
- Shedlock, resilence4j, templateResolver as not used anymore
- #706 Removed alert and investigation specific classes and services to replace them with merged notification classes

### Added
- #630 Added Parts extended detailed view
## [10.8.0 - 03.04.2024] - BROKEN RELEASE - DO NOT USE

## [10.7.0 - 18.03.2024]

Expand Down
16 changes: 13 additions & 3 deletions COMPATIBILITY_MATRIX.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Compatibility matrix Trace-X

## Trace-X version [[10.8.0](https://github.com/eclipse-tractusx/traceability-foss/releases/tag/10.8.0)] - 2024-04-03
## Trace-X version [[10.8.1](https://github.com/eclipse-tractusx/traceability-foss/releases/tag/10.8.1)] - 2024-04-03

### Catena-X Release?

- [ ] yes
- [x] no

### Helm Version [1.3.33](https://github.com/eclipse-tractusx/traceability-foss/releases/tag/helm-charts-1.3.33)
### Helm Version [1.3.34](https://github.com/eclipse-tractusx/traceability-foss/releases/tag/helm-charts-1.3.34)

| Dependency | Name of Service | Version | Helm | Comments |
|------------------|------------------------------|---------------------------------|--------|-----------------------------------------------------------------------------------|
Expand All @@ -27,7 +27,17 @@
| Aspect Model | TractionBatteryCode | [1.0.0] | - | |
| Aspect Model | SingleLevelUsageAsBuilt | [1.0.1] | - | |
| Aspect Model | SingleLevelBomAsBuilt | [1.0.0, 2.0.0) | - | |
| Aspect Model | SingleLevelBomAsPlanned | [1.0.1, 1.1.0) | - | |
| Aspect Model | SingleLevelBomAsPlanned | [1.0.1, 1.1.0) | - |

## Trace-X version [[10.8.0](https://github.com/eclipse-tractusx/traceability-foss/releases/tag/10.8.0)] - 2024-04-03 - BROKEN do not use

### Catena-X Release?

- [ ] yes
- [x] no

### Helm Version [1.3.33](https://github.com/eclipse-tractusx/traceability-foss/releases/tag/helm-charts-1.3.33) - BROKEN do not use


## Trace-X version [[10.7.0](https://github.com/eclipse-tractusx/traceability-foss/releases/tag/10.7.0)] - 2024-03-18

Expand Down
3 changes: 3 additions & 0 deletions charts/traceability-foss/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ 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).

## [1.3.34] - 2024-04-04
### No changes

## [1.3.33] - 2024-04-03
### No changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
import java.util.ArrayList;
import java.util.List;

import static org.apache.commons.collections4.ListUtils.emptyIfNull;

@RequiredArgsConstructor
@Component
public class NotificationMapper {
Expand All @@ -49,7 +51,7 @@ public class NotificationMapper {
public Notification toNotification(BPN bpn, String description, NotificationMessage notification, NotificationType notificationType) {

List<String> assetIds = new ArrayList<>();
notification.getAffectedParts().stream()
emptyIfNull(notification.getAffectedParts()).stream()
.map(NotificationAffectedPart::assetId)
.forEach(assetIds::add);
return Notification.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import java.time.LocalDateTime;
import java.util.UUID;

import static org.apache.commons.collections4.ListUtils.emptyIfNull;

@Component
@RequiredArgsConstructor
public class NotificationMessageMapper {
Expand All @@ -56,7 +58,7 @@ public NotificationMessage toNotification(EDCNotification edcNotification, Notif
.sendToName(getManufacturerName(edcNotification.getRecipientBPN()))
.description(edcNotification.getInformation())
.notificationStatus(edcNotification.convertNotificationStatus())
.affectedParts(edcNotification.getListOfAffectedItems())
.affectedParts(emptyIfNull(edcNotification.getListOfAffectedItems()))
.targetDate(edcNotification.getTargetDate())
.severity(NotificationSeverity.fromString(edcNotification.getSeverity()))
.edcNotificationId(edcNotification.getNotificationId())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
import java.util.List;
import java.util.Optional;

import static org.apache.commons.collections4.ListUtils.emptyIfNull;

@Data
@Builder(toBuilder = true)
@Slf4j
Expand Down Expand Up @@ -135,7 +137,7 @@ public void addNotificationMessage(NotificationMessage notification) {
notifications = Collections.unmodifiableList(updatedNotifications);

List<String> newAssetIds = new ArrayList<>(assetIds); // create a mutable copy of assetIds
notification.getAffectedParts().stream()
emptyIfNull(notification.getAffectedParts()).stream()
.map(NotificationAffectedPart::assetId)
.forEach(newAssetIds::add);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class NotificationMessage {
private final String createdByName;
private final String sendToName;
@Builder.Default
private final List<NotificationAffectedPart> affectedParts = new ArrayList<>();
private List<NotificationAffectedPart> affectedParts = new ArrayList<>();
private String notificationReferenceId;
private String createdBy;
private String sendTo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import org.eclipse.tractusx.traceability.notification.domain.notification.repository.NotificationRepository;
import org.eclipse.tractusx.traceability.notification.infrastructure.edc.model.EDCNotification;

import static org.apache.commons.collections4.ListUtils.emptyIfNull;

@Slf4j
public abstract class AbstractNotificationReceiverService implements NotificationReceiverService {

Expand All @@ -53,9 +55,11 @@ public void handleReceive(EDCNotification edcNotification, NotificationType noti

@Override
public void handleUpdate(EDCNotification edcNotification, NotificationType notificationType) {
NotificationMessage notificationMessage = getNotificationMessageMapper().toNotification(edcNotification, notificationType);

Notification notification = getRepository().findByEdcNotificationId(edcNotification.getNotificationId())
.orElseThrow(() -> getNotFoundException(edcNotification.getNotificationId()));
NotificationMessage notificationMessage = getNotificationMessageMapper().toNotification(edcNotification, notificationType);
emptyIfNull(notification.getNotifications()).stream().findFirst().ifPresent(notificationMessage1 -> notificationMessage.setAffectedParts(notificationMessage1.getAffectedParts()));

switch (edcNotification.convertNotificationStatus()) {
case ACKNOWLEDGED -> notification.acknowledge();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ public void investigationNotificationReceive(final @ValidEDCNotification @Valid
public void investigationNotificationUpdate(final @ValidEDCNotification @Valid @RequestBody EDCNotification edcNotification) {
EDCNotification cleanEdcNotification = sanitize(edcNotification);
log.info("EdcController [investigationNotificationUpdate] notificationId:{}", cleanEdcNotification);
validateIsInvestigation(cleanEdcNotification);
notificationReceiverService.handleUpdate(cleanEdcNotification, NotificationType.INVESTIGATION);
}

Expand Down Expand Up @@ -288,7 +287,6 @@ public void alertNotificationReceive(final @ValidEDCNotification @Valid @Request
public void alertNotificationUpdate(final @ValidEDCNotification @Valid @RequestBody EDCNotification edcNotification) {
EDCNotification cleanEdcNotification = sanitize(edcNotification);
log.info("EdcController [alertNotificationUpdate] notificationId:{}", cleanEdcNotification);
validateIsAlert(cleanEdcNotification);
notificationReceiverService.handleUpdate(cleanEdcNotification, NotificationType.ALERT);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

import java.util.List;

import static org.apache.commons.collections4.ListUtils.emptyIfNull;

public class EDCNotificationFactory {

private EDCNotificationFactory() {
Expand Down Expand Up @@ -60,7 +62,7 @@ public static EDCNotification createEdcNotification(String senderEDC, Notificati


private static List<String> extractAssetIds(NotificationMessage notification) {
return notification.getAffectedParts().stream()
return emptyIfNull(notification.getAffectedParts()).stream()
.map(NotificationAffectedPart::assetId).toList();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@
"senderBPN" : "BPNL00000003AXS3",
"senderAddress" : "https://some-url.com",
"recipientBPN" : "BPNL00000003AXS3",
"classification" : "QM-Investigation",
"severity" : "CRITICAL",
"relatedNotificationId" : "REPLACE_ME",
"status" : "ACKNOWLEDGED",
"targetDate" : "2099-03-11T22:44:06.333826952Z"
},
"content" : {
"information" : "Some long description",
"listOfAffectedItems" : [
"urn:uuid:d387fa8e-603c-42bd-98c3-4d87fef8d2bb"
]
"information" : "Some long description"
}
}

0 comments on commit 62edb8e

Please sign in to comment.