From 7cab6f367ccfc1e6528d209901d7363a049e4c0b Mon Sep 17 00:00:00 2001 From: Christophe Loiseau Date: Wed, 20 Mar 2024 12:03:10 +0100 Subject: [PATCH] Bugfix/v7.2.2 merge into main (#853) * Disable stable ID for contracts (#849) * Disable stable ID for contracts * Code review and changelog * Preparing for the release of 7.2.2 * Remove CI hack --------- Co-authored-by: Richard Treier --- .env | 4 +-- CHANGELOG.md | 29 +++++++++++++++++++ .../catalog/mapper/DspDataOfferBuilder.java | 6 +--- .../utils/catalog/DspCatalogServiceTest.java | 2 +- .../mapper/DspContractOfferUtilsTest.java | 24 --------------- .../edc/utils/catalog/catalogResponse.json | 2 +- 6 files changed, 34 insertions(+), 33 deletions(-) delete mode 100644 utils/catalog-parser/src/test/java/de/sovity/edc/utils/catalog/mapper/DspContractOfferUtilsTest.java diff --git a/.env b/.env index 54dae6834..67ff1b07e 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ # Env variables for docker-compose.yaml -EDC_IMAGE=ghcr.io/sovity/edc-dev:7.2.1 -TEST_BACKEND_IMAGE=ghcr.io/sovity/test-backend:7.2.1 +EDC_IMAGE=ghcr.io/sovity/edc-dev:7.2.2 +TEST_BACKEND_IMAGE=ghcr.io/sovity/test-backend:7.2.2 EDC_UI_IMAGE=ghcr.io/sovity/edc-ui:2.4.0 EDC_UI_ACTIVE_PROFILE=sovity-open-source diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d98d2f7d..1bd36fb68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,35 @@ please see [changelog_updates.md](docs/dev/changelog_updates.md). #### Compatible Versions +## [7.2.2] - 2024-03-13 + +### Overview + +Bugfix + +### EDC UI + +https://github.com/sovity/edc-ui/releases/tag/v2.4.0 + +### EDC Extensions + +#### Patch Changes + +- DspCatalogService: Stable Contract Offer IDs removed + +### Deployment Migration Notes + +_No special deployment migration steps required_ + +#### Compatible Versions + +- Connector Backend Docker Images: + - Dev EDC: `ghcr.io/sovity/edc-dev:7.2.2` + - sovity EDC CE: `ghcr.io/sovity/edc-ce:7.2.2` + - MDS EDC CE: `ghcr.io/sovity/edc-ce-mds:7.2.2` +- Connector UI Docker Image: `ghcr.io/sovity/edc-ui:2.4.0` + + ## [7.2.1] - 2024-02-21 ### Overview diff --git a/utils/catalog-parser/src/main/java/de/sovity/edc/utils/catalog/mapper/DspDataOfferBuilder.java b/utils/catalog-parser/src/main/java/de/sovity/edc/utils/catalog/mapper/DspDataOfferBuilder.java index f5ef31736..119d9d102 100644 --- a/utils/catalog-parser/src/main/java/de/sovity/edc/utils/catalog/mapper/DspDataOfferBuilder.java +++ b/utils/catalog-parser/src/main/java/de/sovity/edc/utils/catalog/mapper/DspDataOfferBuilder.java @@ -22,7 +22,6 @@ import jakarta.json.Json; import jakarta.json.JsonObject; import lombok.RequiredArgsConstructor; -import lombok.val; import org.eclipse.edc.jsonld.spi.JsonLd; import org.jetbrains.annotations.NotNull; @@ -67,9 +66,6 @@ private DspDataOffer buildDataOffer(JsonObject dataset) { @NotNull private DspContractOffer buildContractOffer(JsonObject json) { - val stableId = DspContractOfferUtils.buildStableId(json); - val withStableId = Json.createObjectBuilder(json).remove(Prop.ID).add(Prop.ID, stableId).build(); - - return new DspContractOffer(stableId, withStableId); + return new DspContractOffer(JsonLdUtils.id(json), json); } } diff --git a/utils/catalog-parser/src/test/java/de/sovity/edc/utils/catalog/DspCatalogServiceTest.java b/utils/catalog-parser/src/test/java/de/sovity/edc/utils/catalog/DspCatalogServiceTest.java index 4a34cb5a1..88fa35cb2 100644 --- a/utils/catalog-parser/src/test/java/de/sovity/edc/utils/catalog/DspCatalogServiceTest.java +++ b/utils/catalog-parser/src/test/java/de/sovity/edc/utils/catalog/DspCatalogServiceTest.java @@ -72,7 +72,7 @@ void testCatalogMapping() { assertThat(offer.getContractOffers()).hasSize(1); var co = offer.getContractOffers().get(0); - assertThat(co.getContractOfferId()).isEqualTo("contract-id:asset-id:ODJjMDNjMmM4YzQ5NmE0OTg4ZjVjOTY4OGU2MmMyN2UxYjIxZDAwZQ=="); + assertThat(co.getContractOfferId()).isEqualTo("policy-1"); assertThat(toJson(co.getPolicyJsonLd())).contains("ALWAYS_TRUE"); assertThat(offer.getDistributions()).hasSize(1); diff --git a/utils/catalog-parser/src/test/java/de/sovity/edc/utils/catalog/mapper/DspContractOfferUtilsTest.java b/utils/catalog-parser/src/test/java/de/sovity/edc/utils/catalog/mapper/DspContractOfferUtilsTest.java deleted file mode 100644 index 21ceeed8d..000000000 --- a/utils/catalog-parser/src/test/java/de/sovity/edc/utils/catalog/mapper/DspContractOfferUtilsTest.java +++ /dev/null @@ -1,24 +0,0 @@ -package de.sovity.edc.utils.catalog.mapper; - -import jakarta.json.Json; -import lombok.val; -import org.junit.jupiter.api.Test; - -import static org.assertj.core.api.AssertionsForClassTypes.assertThat; - -class DspContractOfferUtilsTest { - @Test - void testCanConvertTheRandomIdToStableId() { - // arrange - val contractOffer = Json.createObjectBuilder() - .add("@id", "part1:part2:part3") - .add("somefield", "somevalue") - .build(); - - // act - val result = DspContractOfferUtils.buildStableId(contractOffer); - - // assert - assertThat(result).isEqualTo("part1:part2:MjliNzcwMjdjMzA2YzE3ZGYyZWNhZjY2OGI3OTYxY2U5OTY1YmExNw=="); - } -} diff --git a/utils/catalog-parser/src/test/resources/de/sovity/edc/utils/catalog/catalogResponse.json b/utils/catalog-parser/src/test/resources/de/sovity/edc/utils/catalog/catalogResponse.json index 613b7ac49..d069f7302 100644 --- a/utils/catalog-parser/src/test/resources/de/sovity/edc/utils/catalog/catalogResponse.json +++ b/utils/catalog-parser/src/test/resources/de/sovity/edc/utils/catalog/catalogResponse.json @@ -5,7 +5,7 @@ "@id": "test-1.0", "@type": "dcat:Dataset", "odrl:hasPolicy": { - "@id": "contract-id:asset-id:policy-id", + "@id": "policy-1", "@type": "odrl:Set", "odrl:permission": { "odrl:target": "test-1.0",