def event_history(event: ExecutionBaseEvent):
    """
    Creates findings for the all the past events for any object that has had at one point a warning event
    """
    reported_obj_history_list = []
    warning_events = get_events_list(event_type="Warning")
    for warning_event in warning_events.items:
        warning_event_key = gen_object_key(warning_event.regarding)
        if warning_event_key in reported_obj_history_list:
            # if there were multiple warnings on the same object we dont want the history pulled multiple times
            continue
        finding = create_debug_event_finding(warning_event)
        events_table = get_resource_events_table(
            "Resource events",
            warning_event.regarding.kind,
            warning_event.regarding.name,
            warning_event.regarding.namespace,
        )
        if events_table:
            finding.add_enrichment([events_table], enrichment_type=EnrichmentType.k8s_events, title="Resource Events")
            event.add_finding(finding, True)
        reported_obj_history_list.append(warning_event_key)

    Creates findings for the all the past events for any object that has had at one point a warning event
    
src/robusta/core/playbooks/internal/discovery_events.py