From 0beb4a43ffe5b50343320b0dc4650cb618be610c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=BChnel?= Date: Tue, 22 Jun 2021 12:01:25 +0200 Subject: [PATCH] added sql statemet for bulidbot view This statement adds a VIEW "buildbot_overview" containing all relevant information for a build. I plan to extend this file with additional views when needed. --- scripts/metrics/buildbot_views.pgsql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 scripts/metrics/buildbot_views.pgsql diff --git a/scripts/metrics/buildbot_views.pgsql b/scripts/metrics/buildbot_views.pgsql new file mode 100644 index 0000000..27b0b7a --- /dev/null +++ b/scripts/metrics/buildbot_views.pgsql @@ -0,0 +1,13 @@ +/* Aggregated build information from multiple tables. */ +CREATE OR REPLACE VIEW buildbot_overview AS +SELECT + buildbot_buildsets.data -> 'sourcestamps' -> 0 ->> 'revision' AS revision, + buildbot_builds.build_id, + buildbot_builds.builder_id, + buildbot_builds.build_number, + buildbot_builds.build_data ->>'state_string' AS result, + format('https://lab.llvm.org/buildbot/#/builders/%s/builds/%s', buildbot_builds.builder_id, buildbot_builds.build_number) as link + FROM buildbot_buildsets, buildbot_buildrequests, buildbot_builds + WHERE buildbot_buildrequests.buildset_id = buildbot_buildsets.buildset_id AND + CAST(buildbot_builds.build_data ->> 'buildrequestid' AS int) = buildbot_buildrequests.buildrequest_id; + \ No newline at end of file