From 15e333b626e510e038d42fe4c0052cb575d803da Mon Sep 17 00:00:00 2001 From: Junghyun Kim Date: Thu, 8 Dec 2016 17:39:55 +0900 Subject: [PATCH] dependency graph is changed to read both OBS and DB status. Change-Id: I5729301c97d2db1a9f700e8facf2dbfca8c0f926 Signed-off-by: Junghyun Kim --- common/dep_graph.php.template_simple | 8 +++----- dep_graph/dep_graph_common.js | 4 ++-- job_make_dep_graph.py | 7 ++++++- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/common/dep_graph.php.template_simple b/common/dep_graph.php.template_simple index 7319adc..9bfb9ad 100644 --- a/common/dep_graph.php.template_simple +++ b/common/dep_graph.php.template_simple @@ -103,8 +103,7 @@ function GetBuildStatusFromDB($mysql_ip, $mysql_username, $mysql_pw, $mysql_db, return $build_status; } - -if ( "%get_build_status_from%" == "get_build_status_from_obs" ) { +if ( ! isset($_GET["build_target_id"]) ) { $obs_api_url="%obs_api_url%"; $obs_username="%obs_username%"; $obs_pw="%obs_pw%"; @@ -120,13 +119,13 @@ if ( "%get_build_status_from%" == "get_build_status_from_obs" ) { } print "};"; -} elseif ( "%get_build_status_from%" == "get_build_status_from_mysql") { +} else { // get build status from DB. $mysql_ip = "%mysql_ip%"; $mysql_username = "%mysql_username%"; $mysql_pw = "%mysql_pw%"; $mysql_db = "%mysql_db%"; - $mysql_build_target_id = "%mysql_build_target_id%"; + $mysql_build_target_id = $_GET["build_target_id"]; $build_status = GetBuildStatusFromDB($mysql_ip, $mysql_username, $mysql_pw, $mysql_db, $mysql_build_target_id); @@ -143,7 +142,6 @@ if ( "%get_build_status_from%" == "get_build_status_from_obs" ) { - diff --git a/dep_graph/dep_graph_common.js b/dep_graph/dep_graph_common.js index 03d577b..3ee4f4b 100644 --- a/dep_graph/dep_graph_common.js +++ b/dep_graph/dep_graph_common.js @@ -83,12 +83,12 @@ function redrawAll() { } nodes[i].color = color; nodes[i].set_color = color; - nodes[i].title = build_status; + nodes[i].title = nodes[i].label + ": " + build_status; } else { var color = grey_color; nodes[i].color = color; nodes[i].set_color = color; - nodes[i].title = "unknown"; + nodes[i].title = nodes[i].label + ": unknown"; } } } diff --git a/job_make_dep_graph.py b/job_make_dep_graph.py index 962edbc..ca5fd19 100644 --- a/job_make_dep_graph.py +++ b/job_make_dep_graph.py @@ -79,7 +79,7 @@ def create_build_progress_dep_graph(build, obs_project, content): arch = content.get("arch") packages_to_be_built = []; - if re.match("^home:prerelease:", obs_project): + if re.match("^home:prerelease:", obs_project) or re.match("^home:trbs:", obs_project): info=build.get_info(obs_project) packages_to_be_built = info['packages'] @@ -97,6 +97,11 @@ def create_build_progress_dep_graph(build, obs_project, content): obs_project, repo, arch) + set_mysql_environment(os.getenv("BUILDMONITOR_IP"), + os.getenv("BUILDMONITOR_USER"), + os.getenv("BUILDMONITOR_PASS"), + os.getenv("BUILDMONITOR_NAME"), + "0") make_dep_graph(filename, graph_dest_dir, vis_dir, dep_graph_dir, template_filename, -- 2.7.4