[PATCH] D109216: [LNT] Fixed fieldchanges grouping to a regression

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 9 03:33:52 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rLNTff4fd1db1a7b: [LNT] Fixed fieldchanges grouping to a regression (authored by thopre).

Repository:
  rLNT LNT

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109216/new/

https://reviews.llvm.org/D109216

Files:
  lnt/server/db/fieldchange.py


Index: lnt/server/db/fieldchange.py
===================================================================
--- lnt/server/db/fieldchange.py
+++ lnt/server/db/fieldchange.py
@@ -125,7 +125,7 @@
                               .filter(ts.FieldChange.field_id.in_(field_ids))
                               .all())
 
-    active_indicators = session.query(ts.FieldChange) \
+    active_changes = session.query(ts.FieldChange) \
         .join(ts.RegressionIndicator) \
         .join(ts.Regression) \
         .filter(or_(ts.Regression.state == RegressionState.DETECTED,
@@ -175,12 +175,12 @@
                 session.flush()
                 try:
                     found, new_reg = identify_related_changes(session, ts,
-                                                              f, active_indicators)
+                                                              f, active_changes)
                 except ObjectDeletedError:
                     # This can happen from time to time.
                     # So, lets retry once.
                     found, new_reg = identify_related_changes(session, ts,
-                                                              f, active_indicators)
+                                                              f, active_changes)
 
                 if found:
                     logger.info("Found field change: {}".format(
@@ -225,7 +225,7 @@
 
 
 @timed
-def identify_related_changes(session, ts, fc, active_indicators):
+def identify_related_changes(session, ts, fc, active_changes):
     # type: (Session, TestSuiteDB, TestSuiteDB.FieldChange, List) -> Tuple[bool, List]
     """Can we find a home for this change in some existing regression? If a
     match is found add a regression indicator adding this change to that
@@ -236,7 +236,7 @@
 
     """
 
-    for change in active_indicators:
+    for change in active_changes:
         if is_overlaping(change, fc):
             confidence = 0.0
 
@@ -260,13 +260,13 @@
                 ri = ts.RegressionIndicator(regression, fc)
                 session.add(ri)
                 session.flush()
-                active_indicators.append(ri)
+                active_changes.append(fc)
                 # Update the default title if needed.
                 rebuild_title(session, ts, regression)
                 logger.info("Updated title of Regression({}) to \"{}\"".format(regression.id, regression.title))
                 return True, regression
 
-    new_reg, new_indicators = new_regression(session, ts, [fc.id])
+    new_reg, new_indicators = new_regression(session, ts, [fc])
     logger.info("Could not find a partner, creating new Regression for change: {}".format(new_reg.title))
-    active_indicators.extend(new_indicators)
+    active_changes.append(fc)
     return False, new_reg


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109216.371535.patch
Type: text/x-patch
Size: 2797 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210909/71c437ff/attachment.bin>


More information about the llvm-commits mailing list