From 8fd808ffd94dcbba33f7495ef011dc48353b7a63 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Mon, 6 Jul 2026 14:01:47 +0000 Subject: [PATCH] =?UTF-8?q?HubSpot=20deal-contacts=20transport=20lives=20u?= =?UTF-8?q?nder=20infrastructure=20like=20the=20other=20API=20clients=20?= =?UTF-8?q?=F0=9F=9F=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- etl/hubspot/hubspotClient.py | 4 ++-- infrastructure/hubspot/__init__.py | 0 {etl => infrastructure}/hubspot/deal_contacts_client.py | 4 ++-- {etl => infrastructure}/hubspot/errors.py | 0 {etl => infrastructure}/hubspot/retry.py | 0 orchestration/tenant_data_sync_orchestrator.py | 4 ++-- tests/orchestration/test_tenant_data_sync_orchestrator.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 infrastructure/hubspot/__init__.py rename {etl => infrastructure}/hubspot/deal_contacts_client.py (96%) rename {etl => infrastructure}/hubspot/errors.py (100%) rename {etl => infrastructure}/hubspot/retry.py (100%) diff --git a/etl/hubspot/hubspotClient.py b/etl/hubspot/hubspotClient.py index 6ee71a381..641695e27 100644 --- a/etl/hubspot/hubspotClient.py +++ b/etl/hubspot/hubspotClient.py @@ -30,7 +30,7 @@ from hubspot.crm.associations.v4.models import ( # type: ignore[reportMissingTy from backend.app.config import get_settings from etl.hubspot.company_data import CompanyData from etl.hubspot.project_data import ProjectData -from etl.hubspot.retry import call_with_retry +from infrastructure.hubspot.retry import call_with_retry from utils.logger import setup_logger import mimetypes @@ -86,7 +86,7 @@ class HubspotClient: # self.client def _call_with_retry(self, fn: Callable[[], Any], max_retries: int = 2) -> Any: - """Delegates to the shared etl.hubspot.retry policy.""" + """Delegates to the shared infrastructure.hubspot.retry policy.""" return call_with_retry(fn, max_retries=max_retries, logger=self.logger) def get_deal_ids_from_company(self, company_id: str) -> list[str]: diff --git a/infrastructure/hubspot/__init__.py b/infrastructure/hubspot/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/etl/hubspot/deal_contacts_client.py b/infrastructure/hubspot/deal_contacts_client.py similarity index 96% rename from etl/hubspot/deal_contacts_client.py rename to infrastructure/hubspot/deal_contacts_client.py index 9609b1be8..2c0eb0627 100644 --- a/etl/hubspot/deal_contacts_client.py +++ b/infrastructure/hubspot/deal_contacts_client.py @@ -5,8 +5,8 @@ from hubspot.client import Client # type: ignore[reportMissingTypeStubs] from hubspot.crm.associations.v4 import AssociationSpec # type: ignore[reportMissingTypeStubs] from hubspot.crm.contacts import SimplePublicObjectInputForCreate # type: ignore[reportMissingTypeStubs] -from etl.hubspot.errors import HubspotRequestError -from etl.hubspot.retry import call_with_retry +from infrastructure.hubspot.errors import HubspotRequestError +from infrastructure.hubspot.retry import call_with_retry # HubSpot-defined deal -> contact association ("deal_to_contact" in v3 terms). DEAL_TO_CONTACT_ASSOCIATION_TYPE_ID = 3 diff --git a/etl/hubspot/errors.py b/infrastructure/hubspot/errors.py similarity index 100% rename from etl/hubspot/errors.py rename to infrastructure/hubspot/errors.py diff --git a/etl/hubspot/retry.py b/infrastructure/hubspot/retry.py similarity index 100% rename from etl/hubspot/retry.py rename to infrastructure/hubspot/retry.py diff --git a/orchestration/tenant_data_sync_orchestrator.py b/orchestration/tenant_data_sync_orchestrator.py index 383ca2a98..f1e5bb3e0 100644 --- a/orchestration/tenant_data_sync_orchestrator.py +++ b/orchestration/tenant_data_sync_orchestrator.py @@ -2,8 +2,8 @@ from dataclasses import dataclass from typing import Dict, List, Optional, Tuple, Union from domain.abri.models import AbriRequestRejected, PlaceRef, Tenant -from etl.hubspot.deal_contacts_client import HubspotDealContactsClient -from etl.hubspot.errors import HubspotRequestError +from infrastructure.hubspot.deal_contacts_client import HubspotDealContactsClient +from infrastructure.hubspot.errors import HubspotRequestError from infrastructure.abri.abri_client import AbriClient diff --git a/tests/orchestration/test_tenant_data_sync_orchestrator.py b/tests/orchestration/test_tenant_data_sync_orchestrator.py index 6fd48e8ea..1980a45c9 100644 --- a/tests/orchestration/test_tenant_data_sync_orchestrator.py +++ b/tests/orchestration/test_tenant_data_sync_orchestrator.py @@ -11,7 +11,7 @@ from hubspot.crm.contacts import ApiException as ContactsApiException # type: i from hubspot.crm.contacts import SimplePublicObjectInputForCreate # type: ignore[reportMissingTypeStubs] from domain.abri.models import AbriRequestRejected, PlaceRef -from etl.hubspot.deal_contacts_client import HubspotDealContactsClient +from infrastructure.hubspot.deal_contacts_client import HubspotDealContactsClient from infrastructure.abri.abri_client import AbriClient from infrastructure.abri.config import AbriConfig from infrastructure.abri.errors import AbriResponseParseError, AbriTransportError