Do not insert new cycle information in the comment
authorhyokeun <hyokeun.jeon@samsung.com>
Thu, 14 Dec 2017 06:45:05 +0000 (15:45 +0900)
committerhyokeun <hyokeun.jeon@samsung.com>
Thu, 14 Dec 2017 06:45:05 +0000 (15:45 +0900)
Change-Id: I492ffd80ea41beffb7116f703c027dcc64a599a9

job_buildmonitor.py

index 0223865..c93b561 100644 (file)
@@ -393,6 +393,13 @@ def update_comment(sr, comment):
     query = "SELECT submit_time FROM sr_status WHERE sr = %s"
     parent_sr_time = buildmonitor_db.get_value_from_query_data(query, query_data)
 
+    query = "SELECT id FROM sr_comment WHERE sr_status_id=%s AND comment=%s"
+    query_data = (parent_sr_id, comment)
+    prev_comment_id = buildmonitor_db.do_query(query, query_data)
+    # Do not insert duplicated records
+    if prev_comment_id == 0:
+        return
+
     query = "INSERT INTO sr_comment (sr_status_id, user, comment, commented_date) VALUES(%s, %s, %s, %s)"
     query_data = (parent_sr_id, "Tizen Build Bot", comment, parent_sr_time)
     buildmonitor_db.do_query(query, query_data)
@@ -2752,6 +2759,7 @@ def main():
         bm_snapshot_url = content.get("bm_snapshot_url")
         bm_snapshot_name = content.get("bm_snapshot_name")
         bm_duplicated = content.get("bm_duplicated")
+        bm_buildfailreason = content.get("bm_buildfailreason")
 
         # func call
         # for sr_stage & build_snapshot