Commit c336aacf authored by George Papathanail's avatar George Papathanail
Browse files

refactor(qod): rename NETWORK_CAPABILITY operation types to QOD_SESSION

parent e765f109
Loading
Loading
Loading
Loading
Loading
+1 −1
Changes for src/open_exposure_gateway/application/services/edge_application_management_service.py: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -142,7 +142,7 @@ _NON_TERMINAL_OPERATION_STATUSES = frozenset(
    }
)

# EAM-owned operation types; NETWORK_CAPABILITY* belong to QoD.
# EAM-owned operation types; QOD_SESSION* belong to QoD.
_RECONCILABLE_OPERATION_TYPES = frozenset(
    {
        OperationType.DEPLOY,
+6 −6
Changes for src/open_exposure_gateway/application/services/quality_on_demand_service.py: 6 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -222,7 +222,7 @@ class QualityOnDemandService:
                correlation_id=correlation_id,
                tenant_id=tenant_id,
                app_provider_id=app_provider_id,
                operation_type=OperationType.NETWORK_CAPABILITY,
                operation_type=OperationType.QOD_SESSION,
                status=OperationStatus.PENDING,
                subject=Subject.TASK_ACTIVATE,
                metadata={
@@ -435,8 +435,8 @@ class QualityOnDemandService:
            )
            return
        if operation.operation_type not in (
            OperationType.NETWORK_CAPABILITY,
            OperationType.NETWORK_CAPABILITY_DEACTIVATE,
            OperationType.QOD_SESSION,
            OperationType.QOD_SESSION_DEACTIVATE,
        ):
            return

@@ -455,7 +455,7 @@ class QualityOnDemandService:
            )
        )

        if operation.operation_type == OperationType.NETWORK_CAPABILITY_DEACTIVATE:
        if operation.operation_type == OperationType.QOD_SESSION_DEACTIVATE:
            await self._handle_deactivate_completed(operation, status)
            return

@@ -536,7 +536,7 @@ class QualityOnDemandService:

        operation_id = UUID(event.operation_id)
        operation = await self._operation_repo.get_by_id(operation_id)
        if operation is None or operation.operation_type != OperationType.NETWORK_CAPABILITY:
        if operation is None or operation.operation_type != OperationType.QOD_SESSION:
            return

        qod_session = await self._qod_session_repo.get_by_operation_id(operation_id)
@@ -692,7 +692,7 @@ class QualityOnDemandService:
                correlation_id=correlation_id,
                tenant_id=tenant_id,
                app_provider_id=app_provider_id,
                operation_type=OperationType.NETWORK_CAPABILITY_DEACTIVATE,
                operation_type=OperationType.QOD_SESSION_DEACTIVATE,
                status=OperationStatus.PENDING,
                subject=Subject.TASK_DEACTIVATE,
                metadata={"session_id": str(qod_session.session_id)},
+2 −2
Changes for src/open_exposure_gateway/domain/models/operations/enums.py: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -5,8 +5,8 @@ class OperationType(StrEnum):
    DEPLOY = "deploy"
    SCALE = "scale"
    TERMINATE = "terminate"
    NETWORK_CAPABILITY = "network_capability"
    NETWORK_CAPABILITY_DEACTIVATE = "network_capability_deactivate"
    QOD_SESSION = "qod_session"
    QOD_SESSION_DEACTIVATE = "qod_session_deactivate"
    TRAFFIC_INFLUENCE = "traffic_influence"
    TRAFFIC_INFLUENCE_DEACTIVATE = "traffic_influence_deactivate"

+2 −2
Changes for tests/integration/test_postgres.py: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -234,7 +234,7 @@ async def test_operation_repo_list_stale_filters_on_status_type_and_age(
    )
    await _save_aged(OperationStatus.PENDING, OperationType.DEPLOY, timedelta(minutes=1))
    await _save_aged(OperationStatus.COMPLETED, OperationType.DEPLOY, timedelta(hours=6))
    await _save_aged(OperationStatus.PENDING, OperationType.NETWORK_CAPABILITY, timedelta(hours=6))
    await _save_aged(OperationStatus.PENDING, OperationType.QOD_SESSION, timedelta(hours=6))

    stale = await repo.list_stale(
        statuses=[OperationStatus.PENDING, OperationStatus.IN_PROGRESS],
@@ -539,7 +539,7 @@ async def test_completion_arriving_before_its_operation_commits_is_still_applied

    deactivate_operation = _operation().model_copy(
        update={
            "operation_type": OperationType.NETWORK_CAPABILITY_DEACTIVATE,
            "operation_type": OperationType.QOD_SESSION_DEACTIVATE,
            "subject": "command.srm.network_capability.deactivate",
            "metadata": {"session_id": str(qod_session.session_id)},
        }
+2 −2
Changes for tests/unit/test_eam_service.py: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -6340,7 +6340,7 @@ class TestHandleOperationStatus:
        await self._seed_operation(
            operation_repo,
            OperationStatus.PENDING,
            operation_type=OperationType.NETWORK_CAPABILITY,
            operation_type=OperationType.QOD_SESSION,
        )

        await service.handle_operation_status(self._status_event(state))
@@ -6560,7 +6560,7 @@ class TestReconcileStaleOperations:
            uuid4(),
            status=OperationStatus.PENDING,
            age=timedelta(hours=5),
            operation_type=OperationType.NETWORK_CAPABILITY,
            operation_type=OperationType.QOD_SESSION,
        )
        for operation in (
            old_pending,
Loading