diff --git a/cg/apps/tb/api.py b/cg/apps/tb/api.py index a2db0fcabc..bb1b64b42e 100644 --- a/cg/apps/tb/api.py +++ b/cg/apps/tb/api.py @@ -119,6 +119,7 @@ def add_pending_analysis( ticket: str = None, workflow_manager: str = WorkflowManager.Slurm, tower_workflow_id: str | None = None, + is_hidden: bool = False, ) -> TrailblazerAnalysis: request_body = { "case_id": case_id, @@ -132,6 +133,7 @@ def add_pending_analysis( "ticket": ticket, "workflow_manager": workflow_manager, "tower_workflow_id": tower_workflow_id, + "is_hidden": is_hidden, } LOG.debug(f"Submitting job to Trailblazer: {request_body}") if response := self.query_trailblazer( diff --git a/cg/constants/constants.py b/cg/constants/constants.py index c7ae23d812..5f928f3b5b 100644 --- a/cg/constants/constants.py +++ b/cg/constants/constants.py @@ -306,3 +306,6 @@ class SequencingQCStatus(Enum): FAILED = auto() PASSED = auto() PENDING = auto() + + +DEVELOPMENT_CUSTOMER_ID = "cust000" diff --git a/cg/meta/workflow/analysis.py b/cg/meta/workflow/analysis.py index 11158b1093..4e71fa4315 100644 --- a/cg/meta/workflow/analysis.py +++ b/cg/meta/workflow/analysis.py @@ -13,6 +13,7 @@ from cg.clients.chanjo2.models import CoverageMetrics from cg.constants import EXIT_FAIL, EXIT_SUCCESS, Priority, SequencingFileTag, Workflow from cg.constants.constants import ( + DEVELOPMENT_CUSTOMER_ID, AnalysisType, CaseActions, FileFormat, @@ -292,6 +293,7 @@ def add_pending_trailblazer_analysis( ticket: str = self.status_db.get_latest_ticket_from_case(case_id) workflow: Workflow = self.workflow workflow_manager: str = self.get_workflow_manager() + is_case_for_development: bool = self._is_case_for_development(case_id) self.trailblazer_api.add_pending_analysis( analysis_type=application_type, case_id=case_id, @@ -304,8 +306,13 @@ def add_pending_trailblazer_analysis( workflow=workflow, workflow_manager=workflow_manager, tower_workflow_id=tower_workflow_id, + is_hidden=is_case_for_development, ) + def _is_case_for_development(self, case_id: str) -> bool: + case: Case = self.status_db.get_case_by_internal_id(case_id) + return case.customer.internal_id == DEVELOPMENT_CUSTOMER_ID + def _get_order_id_from_case_id(self, case_id) -> int: case: Case = self.status_db.get_case_by_internal_id(case_id) return case.latest_order.id