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).
This commit is contained in:
Christopher Baines 2022-11-10 16:06:45 +00:00
parent 95064d39a3
commit 1fb291be40
7 changed files with 443 additions and 54 deletions

View file

@ -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;