Skip to content

Commit

Permalink
monkey patching
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Szefler committed Dec 5, 2023
1 parent 7aa0880 commit de09dcd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/robusta/core/playbooks/base_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from robusta.core.model.events import ExecutionBaseEvent
from robusta.core.reporting.base import Finding
from robusta.patch.patch import create_monkey_patches
from robusta.utils.documented_pydantic import DocumentedModel


Expand Down Expand Up @@ -33,7 +34,13 @@ def should_fire(self, event: TriggerEvent, playbook_id: str):
def build_execution_event(
self, event: TriggerEvent, sink_findings: Dict[str, List[Finding]]
) -> Optional[ExecutionBaseEvent]:
return build_execution_event_process_pool.submit(self._build_execution_event, event, sink_findings).result()
return build_execution_event_process_pool.submit(
self._build_execution_event_trampoline, event, sink_findings
).result()

def _build_execution_event_trampoline(self, event: TriggerEvent, sink_findings: Dict[str, List[Finding]]):
create_monkey_patches()
return self._build_execution_event(event, sink_findings)

def _build_execution_event(
self, event: TriggerEvent, sink_findings: Dict[str, List[Finding]]
Expand Down

0 comments on commit de09dcd

Please sign in to comment.