From b19227c0863a701a3b7e411410ad983e6242e840 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sun, 1 Mar 2020 15:57:35 +0000 Subject: Order build statuses by id, not timestamp Some builds from Cuirass change status at the same timestamp, so use the id for ordering instead. --- guix-data-service/builds.scm | 2 +- guix-data-service/model/build.scm | 8 ++++---- guix-data-service/model/channel-instance.scm | 2 +- guix-data-service/model/derivation.scm | 8 ++++---- guix-data-service/model/package.scm | 2 +- guix-data-service/model/system-test.scm | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) (limited to 'guix-data-service') diff --git a/guix-data-service/builds.scm b/guix-data-service/builds.scm index 70c30d4..24e6b6f 100644 --- a/guix-data-service/builds.scm +++ b/guix-data-service/builds.scm @@ -440,7 +440,7 @@ INNER JOIN builds LEFT JOIN ( SELECT DISTINCT ON (build_id) * FROM build_status - ORDER BY build_id, timestamp DESC + ORDER BY build_id, id DESC ) AS latest_build_status ON builds.id = latest_build_status.build_id WHERE builds.build_server_id = $1 AND diff --git a/guix-data-service/model/build.scm b/guix-data-service/model/build.scm index 4e6e032..2a2cf99 100644 --- a/guix-data-service/model/build.scm +++ b/guix-data-service/model/build.scm @@ -80,7 +80,7 @@ LEFT JOIN ( SELECT DISTINCT ON (build_id) * FROM build_status - ORDER BY build_id, timestamp DESC + ORDER BY build_id, id DESC ) AS latest_build_status ON builds.id = latest_build_status.build_id " @@ -167,7 +167,7 @@ INNER JOIN ( SELECT DISTINCT ON (build_id) * FROM build_status - ORDER BY build_id, timestamp DESC + ORDER BY build_id, id DESC ) AS latest_build_status ON latest_build_status.build_id = builds.id " @@ -206,7 +206,7 @@ INNER JOIN ( SELECT DISTINCT ON (build_id) * FROM build_status - ORDER BY build_id, timestamp DESC + ORDER BY build_id, id DESC ) AS latest_build_status ON latest_build_status.build_id = builds.id INNER JOIN derivations_by_output_details_set @@ -283,7 +283,7 @@ LEFT OUTER JOIN builds LEFT OUTER JOIN ( SELECT DISTINCT ON (build_id) * FROM build_status - ORDER BY build_id, timestamp DESC + ORDER BY build_id, id DESC ) AS latest_build_status ON builds.id = latest_build_status.build_id WHERE latest_build_status.status = 'failed'") diff --git a/guix-data-service/model/channel-instance.scm b/guix-data-service/model/channel-instance.scm index b08ecae..50ee864 100644 --- a/guix-data-service/model/channel-instance.scm +++ b/guix-data-service/model/channel-instance.scm @@ -79,7 +79,7 @@ LEFT OUTER JOIN builds LEFT OUTER JOIN ( SELECT DISTINCT ON (build_id) * FROM build_status - ORDER BY build_id, timestamp DESC + ORDER BY build_id, id DESC ) AS latest_build_status ON builds.id = latest_build_status.build_id INNER JOIN guix_revisions diff --git a/guix-data-service/model/derivation.scm b/guix-data-service/model/derivation.scm index 2ee239b..79bd922 100644 --- a/guix-data-service/model/derivation.scm +++ b/guix-data-service/model/derivation.scm @@ -159,7 +159,7 @@ LEFT OUTER JOIN build_servers LEFT OUTER JOIN ( SELECT DISTINCT ON (build_id) * FROM build_status - ORDER BY build_id, timestamp DESC + ORDER BY build_id, id DESC ) AS latest_build_status ON builds.id = latest_build_status.build_id WHERE guix_revisions.commit = $1 @@ -258,7 +258,7 @@ SELECT derivations.file_name, INNER JOIN ( SELECT DISTINCT ON (build_id) * FROM build_status - ORDER BY build_id, timestamp DESC + ORDER BY build_id, id DESC ) AS latest_build_status ON builds.id = latest_build_status.build_id WHERE builds.derivation_output_details_set_id = @@ -380,7 +380,7 @@ SELECT derivations.file_name, INNER JOIN ( SELECT DISTINCT ON (build_id) * FROM build_status - ORDER BY build_id, timestamp DESC + ORDER BY build_id, id DESC ) AS latest_build_status ON builds.id = latest_build_status.build_id WHERE builds.derivation_output_details_set_id = @@ -1388,7 +1388,7 @@ LEFT OUTER JOIN builds LEFT OUTER JOIN ( SELECT DISTINCT ON (build_id) * FROM build_status - ORDER BY build_id, timestamp DESC + ORDER BY build_id, id DESC ) AS latest_build_status ON builds.id = latest_build_status.build_id WHERE " criteria ";")) diff --git a/guix-data-service/model/package.scm b/guix-data-service/model/package.scm index 06c1766..32220fc 100644 --- a/guix-data-service/model/package.scm +++ b/guix-data-service/model/package.scm @@ -290,7 +290,7 @@ LEFT OUTER JOIN builds LEFT OUTER JOIN ( SELECT DISTINCT ON (build_id) * FROM build_status - ORDER BY build_id, timestamp DESC + ORDER BY build_id, id DESC ) AS latest_build_status ON builds.id = latest_build_status.build_id INNER JOIN guix_revisions AS first_guix_revisions diff --git a/guix-data-service/model/system-test.scm b/guix-data-service/model/system-test.scm index ea4878d..87bb647 100644 --- a/guix-data-service/model/system-test.scm +++ b/guix-data-service/model/system-test.scm @@ -98,7 +98,7 @@ LEFT OUTER JOIN builds LEFT OUTER JOIN ( SELECT DISTINCT ON (build_id) * FROM build_status - ORDER BY build_id, timestamp DESC + ORDER BY build_id, id DESC ) AS latest_build_status ON builds.id = latest_build_status.build_id INNER JOIN guix_revisions -- cgit v1.2.3