aboutsummaryrefslogtreecommitdiff
path: root/sqitch/deploy
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2022-11-10 16:06:45 +0000
committerChristopher Baines <mail@cbaines.net>2022-11-11 10:35:09 +0000
commit1fb291be40172d9337c5bbec3119fbe1b908f7df (patch)
tree9d37e03ae9de95bb84a3989ad678437eca19707a /sqitch/deploy
parent95064d39a337da9f2eb7d5675e0e511301466f77 (diff)
downloaddata-service-1fb291be40172d9337c5bbec3119fbe1b908f7df.tar
data-service-1fb291be40172d9337c5bbec3119fbe1b908f7df.tar.gz
Add support for incrementally tracking blocked builds
This will hopefully provide a less expensive way of finding out if a scheduled build is probably blocked by other builds failing or being canceled. By working this out when the build events are recieved, it should be more feasible to include information about whether builds are likely blocked or not in various places (e.g. revision comparisons).
Diffstat (limited to 'sqitch/deploy')
-rw-r--r--sqitch/deploy/blocked_builds.sql19
1 files changed, 19 insertions, 0 deletions
diff --git a/sqitch/deploy/blocked_builds.sql b/sqitch/deploy/blocked_builds.sql
new file mode 100644
index 0000000..d3fa429
--- /dev/null
+++ b/sqitch/deploy/blocked_builds.sql
@@ -0,0 +1,19 @@
+-- Deploy guix-data-service:blocked_builds to pg
+
+BEGIN;
+
+CREATE TABLE blocked_builds (
+ build_server_id integer NOT NULL REFERENCES build_servers (id),
+ blocked_derivation_output_details_set_id integer NOT NULL REFERENCES derivation_output_details_sets (id),
+ blocking_derivation_output_details_set_id integer NOT NULL REFERENCES derivation_output_details_sets (id),
+ PRIMARY KEY (
+ build_server_id,
+ blocked_derivation_output_details_set_id,
+ blocking_derivation_output_details_set_id
+ )
+) PARTITION BY LIST (build_server_id);
+
+CREATE INDEX blocked_builds_blocked_derivation_output_details_set_id
+ ON blocked_builds (build_server_id, blocked_derivation_output_details_set_id);
+
+COMMIT;