[BuildMonitor] fixed the incorrect status of Base project on dashboard 61/119261/1
authorSungHun Hwang <sh0924.hwang@samsung.com>
Thu, 16 Mar 2017 06:31:14 +0000 (15:31 +0900)
committerSungHun Hwang <sh0924.hwang@samsung.com>
Thu, 16 Mar 2017 06:54:16 +0000 (15:54 +0900)
PROBLEM:
  On dashboard, the column of Base profile stays in 'Imaging' status

REASON:
  Originally, 'Base' project doesn't need to create the snapshot

SOLUTION:
  1. skip updating the fail status    at [Pre_Snap_Fail] stage
  2. skip inserting the snapshot info at [Pre_Sanp_End] stage

Change-Id: I1c7aca6e5476ab5c366a3347903d26d9f63ff75b
Signed-off-by: SungHun Hwang <sh0924.hwang@samsung.com>
job_buildmonitor.py
job_pre_release_obs.py

index b9d7115..8f5d123 100644 (file)
@@ -323,11 +323,18 @@ def update_fail_status_for_sr_stage(project, bm_git_tag):
     query_data = (curr_info_project_id,)
     curr_build_project_id = buildmonitor_db.get_value_from_query_data(query, query_data)
 
+    # Skip updating the fail status if Base project
+    if 'Base' in project:
+        sr_stage_status = 'S'
+        print '[%s] This is [Base] project!! skip updating the fail status\n' % (__file__)
+    else:
+        sr_stage_status = 'F'
+
     ### [PRE_SNAP] stage end : update fail status [pre] snapshot creation
     info_stage_id = PRE_SNAP
     query = "UPDATE sr_stage SET stage_status = %s WHERE sr_status_id = %s " \
             "AND info_stage_id = %s AND build_project_id = %s"
-    query_data = ('F', curr_sr_status_id, info_stage_id, curr_build_project_id)
+    query_data = (sr_stage_status, curr_sr_status_id, info_stage_id, curr_build_project_id)
     buildmonitor_db.do_query(query, query_data)
 
 def start_pre_create_snapshot_for_sr_stage(project, bm_git_tag, bm_start_datetime, bBuildFail):
@@ -1899,6 +1906,11 @@ def main():
         bm_snapshot_url = content.get("bm_snapshot_url")
         bm_snapshot_num = content.get("bm_snapshot_num")
 
+        # Skip [Pre_Snap_End] if Base project
+        if 'Base' in project:
+            print '[%s] This is [Base] project!! skip [Pre_Snap_End]\n' % (__file__)
+            return
+
         # func call
         if bm_stage == 'Pre_Snap_End':
             print '[%s][Pre_Snap_End]\n' % (__file__)
index 362ab5f..042071b 100755 (executable)
@@ -210,6 +210,7 @@ def make_repo(project, repo, backenddb, base_url, base_path,
                     #buildmonitor.update_fail_status_for_sr_stage(project, bm_git_tag)
                     bm_stage = 'Pre_Snap_Fail'
                     bm_data = {"bm_stage" : bm_stage,
+                               "project" : project,
                                "bm_git_tag" : bm_git_tag,
                               }
                     trigger_next("BUILD-MONITOR-4-%s" % bm_stage, bm_data)
@@ -484,7 +485,7 @@ def main(action):
                        "bm_start_datetime": str(bm_start_datetime),
                        "bBuildFail": bBuildFail,
                        "unresolvable_broken_packages": get_unresolvable_broken_packages(unresolvable_broken_failed_status)
-                        }
+                      }
             trigger_next("BUILD-MONITOR-1-%s" % bm_stage, bm_data)
 
         # cleanup src.rpm files on Live repo
@@ -533,7 +534,7 @@ def main(action):
                    "bm_snapshot_name" : bm_snapshot_name,
                    "bm_snapshot_url" : bm_snapshot_url,
                    "bm_snapshot_num" : bm_snapshot_num,
-                    }
+                  }
         trigger_next("BUILD-MONITOR_%s" % bm_stage, bm_data)
 
 if __name__ == '__main__':