Skip to content

Commit

Permalink
DO NOT MERGE: automatching with kcidb-ingest
Browse files Browse the repository at this point in the history
Signed-off-by: Helen Koike <[email protected]>
  • Loading branch information
helen-fornazier committed Aug 12, 2024
1 parent 0204582 commit 41b7fd4
Show file tree
Hide file tree
Showing 2 changed files with 429 additions and 0 deletions.
27 changes: 27 additions & 0 deletions kcidb/monitor/subscriptions/create_incidents.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from kcidb.tools import kcidb_match
import kcidb


def match_test(test):
kcidb_io_object = {"tests": [test._data],
"builds": [test.build._data],
"checkouts": [test.build.checkout._data]}
incident_generator = kcidb_match.IncidentGenerator()
incidents = incident_generator.generate_incidents_from_db(kcidb_io_object)
if (incidents["incidents"]):
kcidb.Client.submit(incidents)


def match_build(build):
kcidb_io_object = {"builds": [build._data],
"checkouts": [build.checkout._data]}
incident_generator = kcidb_match.IncidentGenerator()
incidents = incident_generator.generate_incidents_from_db(kcidb_io_object)
if (incidents["incidents"]):
kcidb.Client.submit(incidents)


def match_issues(issues):
issue_objects = {"issues": [issues._data]}
incident_generator = kcidb_match.IncidentGenerator()
incident_generator.db.update_patterns(issue_objects)
Loading

0 comments on commit 41b7fd4

Please sign in to comment.