-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chore/upstream contribution #1383
base: main
Are you sure you want to change the base?
Chore/upstream contribution #1383
Conversation
…ter assets the dtr
9717e62
to
1f7dcd3
Compare
…ter assets the dtr
…or register assets the dtr" This reverts commit 1588186.
…ter assets the dtr
…ter assets the dtr
…ter assets the dtr
@@ -89,7 +90,7 @@ SPDX-License-Identifier: Apache-2.0 | |||
<junit-bom.version>5.10.3</junit-bom.version> | |||
<awaitility.version>4.2.1</awaitility.version> | |||
<!-- TODO https://github.com/eclipse-tractusx/traceability-foss/issues/978 update to the cx release version of irs lib IMPORTANT NO SNAPSHOT--> | |||
<irs-client-lib.version>2.1.9</irs-client-lib.version> | |||
<irs-client-lib.version>2.1.16</irs-client-lib.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please recheck if this exists open source
throw new CreateEdcContractDefinitionException(e); | ||
} | ||
|
||
String submodelAssetId; | ||
String submodelAssetIdToCreate = "urn:uuid:" + UUID.randomUUID(); | ||
try { | ||
submodelAssetId = edcAssetService.createSubmodelAsset(traceabilityProperties.getSubmodelBase(), submodelAssetIdToCreate); | ||
log.info("Submodel Asset Id created :{}", submodelAssetId); | ||
submodelAssetId = edcAssetService.createSubmodelAsset(submodelProperties.getBaseInternal(), submodelAssetIdToCreate); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you set the public url for the submodel, this is the case in the open source variant. Please check
} catch (Exception exception) { | ||
log.warn("EDC Asset (Submodel) could not be created: {}", exception.getMessage()); | ||
throw new CreateEdcAssetException(exception); | ||
} | ||
|
||
try { | ||
String submodelContractId = edcContractDefinitionService.createContractDefinition(submodelAssetId, createdPolicyId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if the submodel server is returning the id on open source variant.
@@ -50,9 +51,9 @@ | |||
@EnableJpaRepositories(basePackages = "org.eclipse.tractusx.traceability.*") | |||
public class EdcConfiguration { | |||
|
|||
@Value("${registry.urlWithPath}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Helm Environments updated?
final RestTemplateBuilder restTemplateBuilder, | ||
@Autowired RegistryProperties registryProperties) { | ||
return oAuthRestTemplate(restTemplateBuilder, | ||
registryProperties.getOauthProviderRegistrationId()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The open source variant does not have authentication curently. How to deal with that.
public RestTemplate submodelRestTemplate(@Autowired SubmodelProperties submodelProperties, @Autowired FeignDefaultProperties feignDefaultProperties, | ||
final RestTemplateBuilder restTemplateBuilder) { | ||
|
||
return oAuthRestTemplate(restTemplateBuilder, submodelProperties.getOauthProviderRegistrationId()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Submodel server does not have oauth in open source. How to deal with that.
@@ -20,7 +20,7 @@ | |||
package org.eclipse.tractusx.traceability.submodel.domain.repository; | |||
|
|||
public interface SubmodelServerRepository { | |||
void saveSubmodel(String submodelId, String submodel); | |||
String saveSubmodel(String submodel); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is not compliant with open source variant.
await() | ||
.atMost(Durations.FIVE_MINUTES) | ||
.pollInterval(1, TimeUnit.SECONDS) | ||
.until(() -> { | ||
try { | ||
submodelRestTemplate.exchange("/" + submodelId, HttpMethod.POST, new HttpEntity<>(payload), Void.class); | ||
log.info("Submodel created successfully with id: {}", submodelId); | ||
submodelRestTemplate.exchange("/", HttpMethod.POST, new HttpEntity<>(submodelRequest), Void.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not compliant.
public String saveSubmodel(String submodel) { | ||
String submodelId; | ||
try { | ||
String submodelEnriched = SubmodelUtil.enrichWithSubmodelUuid(objectMapper, submodel); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not compliant.
@UtilityClass | ||
public class SubmodelUtil { | ||
|
||
public static String enrichWithSubmodelUuid(final ObjectMapper objectMapper, String jsonString) throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not compliant.
@@ -1,4 +1,52 @@ | |||
-- ${flyway:timestamp} | |||
-- TODO remove after demo / discovery is working | |||
INSERT INTO assets_as_built (id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not compliant.
import org.springframework.context.ApplicationContextInitializer; | ||
import org.springframework.context.ConfigurableApplicationContext; | ||
|
||
public class BmwBpnConfig { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not compliant.
Description
This PR provides the feature https://cofinity-x.atlassian.net/browse/TRACEX-212 to upstream.
The upstream feature is eclipse-tractusx/sig-release#940.
Pre-review checks
Please ensure to do as many of the following checks as possible, before asking for committer review: