From 0e3c28ffbd3df31d805bc7f16acc76a8f6201d0e Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 26 Dec 2019 23:22:54 +0000 Subject: Fix more cases where equivalent builds were missed --- guix-data-service/model/build.scm | 7 +++++-- guix-data-service/model/derivation.scm | 11 +++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/guix-data-service/model/build.scm b/guix-data-service/model/build.scm index 728c70c..c81fda8 100644 --- a/guix-data-service/model/build.scm +++ b/guix-data-service/model/build.scm @@ -279,9 +279,12 @@ WITH RECURSIVE all_derivations(id, file_name) AS ( ) SELECT all_derivations.file_name, latest_build_status.status FROM all_derivations +INNER JOIN derivations_by_output_details_set + ON all_derivations.id = derivations_by_output_details_set.derivation_id LEFT OUTER JOIN builds - ON all_derivations.file_name = builds.derivation_file_name AND - builds.build_server_id = $2 + ON derivations_by_output_details_set.derivation_output_details_set_id = + builds.derivation_output_details_set_id + AND builds.build_server_id = $2 LEFT OUTER JOIN ( SELECT DISTINCT ON (build_id) * FROM build_status diff --git a/guix-data-service/model/derivation.scm b/guix-data-service/model/derivation.scm index 38947ba..ca21525 100644 --- a/guix-data-service/model/derivation.scm +++ b/guix-data-service/model/derivation.scm @@ -119,7 +119,11 @@ INNER JOIN guix_revision_package_derivations ON package_derivations.id = guix_revision_package_derivations.package_derivation_id INNER JOIN guix_revisions ON guix_revision_package_derivations.revision_id = guix_revisions.id -LEFT OUTER JOIN builds ON derivations.file_name = builds.derivation_file_name +INNER JOIN derivations_by_output_details_set + ON derivations.id = derivations_by_output_details_set.derivation_id +LEFT OUTER JOIN builds + ON derivations_by_output_details_set.derivation_output_details_set_id = + builds.derivation_output_details_set_id LEFT OUTER JOIN ( SELECT DISTINCT ON (build_id) * FROM build_status @@ -1115,8 +1119,11 @@ SELECT FROM derivations INNER JOIN package_derivations ON derivations.id = package_derivations.derivation_id +INNER JOIN derivations_by_output_details_set + ON derivations.id = derivations_by_output_details_set.derivation_id LEFT OUTER JOIN builds - ON derivations.file_name = builds.derivation_file_name + ON derivations.derivation_output_details_set_id = + builds.derivation_output_details_set_id LEFT OUTER JOIN ( SELECT DISTINCT ON (build_id) * FROM build_status -- cgit v1.2.3