From 002f782905c7d28d599c3cb3bb12ed8312f0ecd5 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Wed, 8 Jul 2026 10:25:45 +0000 Subject: [PATCH] =?UTF-8?q?Fire=20Abri=20flows=20on=20a=20test=20project?= =?UTF-8?q?=20code=20via=20an=20override=20env=20var=20=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 --- etl/hubspot/hubspot_deal_differ.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/etl/hubspot/hubspot_deal_differ.py b/etl/hubspot/hubspot_deal_differ.py index eb48fd464..22d7fb83c 100644 --- a/etl/hubspot/hubspot_deal_differ.py +++ b/etl/hubspot/hubspot_deal_differ.py @@ -1,3 +1,4 @@ +import os from typing import Any, Dict, List, Optional from backend.app.db.models.hubspot_deal_data import HubspotDealData @@ -344,8 +345,15 @@ class HubspotDealDiffer: == HubspotDealDiffer.ABRI_CONDITION_ASSOCIATED_PROJECT_ID ) + # TEST_ABRI_PROJECT_CODE_OVERRIDE lets a non-production deploy fire on a + # sandbox deal's own project code; unset (the production default) falls + # back to the real stock-condition code. + expected_code = ( + os.environ.get("TEST_ABRI_PROJECT_CODE_OVERRIDE") + or HubspotDealDiffer.ABRI_CONDITION_PROJECT_CODE + ) new_project_code = (new_deal.get("project_code") or "").lower() - return new_project_code == HubspotDealDiffer.ABRI_CONDITION_PROJECT_CODE.lower() + return new_project_code == expected_code.lower() @staticmethod def _has_valid_pashub_link(new_pashub_link: str) -> bool: