Skip to content

Commit

Permalink
Merge pull request #1150 from eclipse-tractusx/chore/884-fix-traction…
Browse files Browse the repository at this point in the history
…batterycode-import

Chore/884 fix of internal url
  • Loading branch information
ds-mmaul authored Jul 3, 2024
2 parents 204130d + 5279e48 commit c08ef66
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 39 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/argo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@ on:
options:
- Yes
- No
trigger_registry_reload:
type: choice
description: Do You want to trigger registry reload right away?
required: true
options:
- Yes
- No

env:
ARGO_TEST_REGISTRY: "https://argo.dev.demo.catena-x.net/api/v1/applications/tracex-dt-registry-test"
Expand Down Expand Up @@ -156,8 +149,6 @@ jobs:
echo "- test data version: ${{ github.event.inputs.testdata_version }}" >> $GITHUB_STEP_SUMMARY
echo "- do hard refresh: ${{ github.event.inputs.hard_refresh }}" >> $GITHUB_STEP_SUMMARY
echo "- upload test data: ${{ github.event.inputs.testdata_upload }}" >> $GITHUB_STEP_SUMMARY
echo "- reload registry: ${{ github.event.inputs.trigger_registry_reload }}" >> $GITHUB_STEP_SUMMARY
hard_refresh_environment:
needs: print_environment
Expand Down Expand Up @@ -404,23 +395,3 @@ jobs:
elif [ "${{ github.event.inputs.testdata_upload }}" == "false" ]; then
echo "Testdata upload skipped"
fi
registry_reload:
needs:
- upload_testdata
runs-on: ubuntu-latest
steps:
- name: reload the registry
run: |
if [ "${{ github.event.inputs.trigger_registry_reload }}" == "true" ]; then
if [ "${{ github.event.inputs.environment }}" == "Dev/Test" ]; then
curl -X GET "$ARGO_TEST_RegistryReload"
curl -X GET "$ARGO_DEV_RegistryReload"
elif [ "${{ github.event.inputs.environment }}" == "E2E-A/E2E-B" ]; then
curl -X GET "$ARGO_E2E_A_RegistryReload"
curl -X GET "$ARGO_E2E_B_RegistryReload"
elif [ "${{ github.event.inputs.environment }}" == "int-a/int-b" ]; then
curl -X GET "$ARGO_INT_A_RegistryReload"
curl -X GET "$ARGO_INT_B_RegistryReload"
fi
fi
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ _**For better traceability add the corresponding GitHub issue number in each cha
- #786 Added authorization as admin for submodel api & registry api
- #884 Upgraded tractionBatteryCode from 1.0.0 to 2.0.0
- #786 Added alternative port (only accessible within same cluster) for application which is used for unsecured API endpoints.
- #786 Introduced internal url for notification contracts.
- #994 improved bpn edc configuration view uux
- #1082 fix update of parts when synchronizing with IRS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ spec:
value: {{ .Values.traceability.bpn | quote }}
- name: TRACEABILITY_URL
value: {{ .Values.traceability.url | quote }}
- name: TRACEABILITY_URL_INTERNAL
value: {{ .Values.traceability.internalUrl | quote }}
- name: TRACEABILITY_LEFT_OPERAND
value: {{ .Values.traceability.leftOperand | quote }}
- name: TRACEABILITY_OPERATOR_TYPE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class TraceabilityProperties {

private BPN bpn;
private String url;

private String internalUrl;
private String leftOperand;
private String operatorType;
private String rightOperand;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,11 @@ public class NotificationsEDCFacade {

@Qualifier(EDC_NOTIFICATION_TEMPLATE)
private final RestTemplate edcNotificationTemplate;
private final NotificationRepository notificationRepository;

private final EDCCatalogFacade edcCatalogFacade;
private final ContractNegotiationService contractNegotiationService;
private final EndpointDataReferenceStorage endpointDataReferenceStorage;
private final PolicyCheckerService policyCheckerService;
private final ContractService contractService;


private static final String CX_TAXO_QUALITY_INVESTIGATION_RECEIVE = "https://w3id.org/catenax/taxonomy#ReceiveQualityInvestigationNotification";
private static final String CX_TAXO_QUALITY_INVESTIGATION_UPDATE = "https://w3id.org/catenax/taxonomy#UpdateQualityInvestigationNotification";
private static final String CX_TAXO_QUALITY_ALERT_RECEIVE = "https://w3id.org/catenax/taxonomy#ReceiveQualityAlertNotification";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,6 @@ private void revertNotificationAsset(String notificationAssetId) {

private String createBaseUrl(org.eclipse.tractusx.traceability.notification.application.contract.model.NotificationType notificationType, NotificationMethod notificationMethod) {
final String template = notificationType.equals(org.eclipse.tractusx.traceability.notification.application.contract.model.NotificationType.QUALITY_ALERT) ? TRACE_FOSS_QUALITY_NOTIFICATION_ALERT_URL_TEMPLATE : TRACE_FOSS_QUALITY_NOTIFICATION_INVESTIGATION_URL_TEMPLATE;
return traceabilityProperties.getUrl() + template.formatted(notificationMethod.getValue());
return traceabilityProperties.getInternalUrl() + template.formatted(notificationMethod.getValue());
}
}
1 change: 1 addition & 0 deletions tx-backend/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
traceability:
bpn: ${TRACEABILITY_BPN}
url: ${TRACEABILITY_URL}
internalUrl: ${TRACEABILITY_URL_INTERNAL}
leftOperand: ${TRACEABILITY_LEFT_OPERAND}
operatorType: ${TRACEABILITY_OPERATOR_TYPE}
rightOperand: ${TRACEABILITY_RIGHT_OPERAND}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void testHandle() throws CreateEdcAssetException, CreateEdcPolicyDefinitionExcep
CreateNotificationContractRequest request = new CreateNotificationContractRequest(notificationType, notificationMethod);

when(edcNotificationAssetService.createNotificationAsset(any(), any(), any(), any())).thenReturn(notificationAssetId);
when(traceabilityProperties.getUrl()).thenReturn("https://test");
when(traceabilityProperties.getInternalUrl()).thenReturn("https://test");
when(edcPolicyDefinitionService.createAccessPolicy(any(EdcCreatePolicyDefinitionRequest.class))).thenReturn(accessPolicyId);
when(edcContractDefinitionService.createContractDefinition(notificationAssetId, accessPolicyId)).thenReturn(contractDefinitionId);

Expand All @@ -125,7 +125,7 @@ void givenService_whenAssetCreationThrowsException_thenThrowException() throws C
NotificationType notificationType = NotificationType.QUALITY_INVESTIGATION;
NotificationMethod notificationMethod = NotificationMethod.RESOLVE;
CreateNotificationContractRequest request = new CreateNotificationContractRequest(notificationType, notificationMethod);
when(traceabilityProperties.getUrl()).thenReturn("https://test");
when(traceabilityProperties.getInternalUrl()).thenReturn("https://test");
doThrow(CreateEdcAssetException.class).when(edcNotificationAssetService).createNotificationAsset(any(), any(), any(), any());

// when/then
Expand All @@ -148,7 +148,7 @@ void givenService_whenPolicyDefinitionServiceThrowsException_thenThrowException(
CreateNotificationContractRequest request = new CreateNotificationContractRequest(notificationType, notificationMethod);

when(edcNotificationAssetService.createNotificationAsset(any(), any(), any(), any())).thenReturn(notificationAssetId);
when(traceabilityProperties.getUrl()).thenReturn("https://test");
when(traceabilityProperties.getInternalUrl()).thenReturn("https://test");

doThrow(CreateEdcPolicyDefinitionException.class).when(edcPolicyDefinitionService).createAccessPolicy(any(EdcCreatePolicyDefinitionRequest.class));

Expand All @@ -174,7 +174,7 @@ void givenService_whenContractDefinitionServiceThrowsException_thenThrowExceptio
CreateNotificationContractRequest request = new CreateNotificationContractRequest(notificationType, notificationMethod);

when(edcNotificationAssetService.createNotificationAsset(any(), any(), any(), any())).thenReturn(notificationAssetId);
when(traceabilityProperties.getUrl()).thenReturn("https://test");
when(traceabilityProperties.getInternalUrl()).thenReturn("https://test");

doThrow(CreateEdcContractDefinitionException.class).when(edcContractDefinitionService).createContractDefinition(any(), any());

Expand Down

0 comments on commit c08ef66

Please sign in to comment.