aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service/jobs
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2024-03-07 09:44:47 +0000
committerChristopher Baines <mail@cbaines.net>2024-03-07 10:02:18 +0000
commit5f80856ad1587aea38ee4e7b54db558cdb43f6b7 (patch)
tree78a84d1551299861259f4b93991283bdd0da00f2 /guix-data-service/jobs
parent184d3416717971cdf0c8b84709a7180efd5127b9 (diff)
downloaddata-service-5f80856ad1587aea38ee4e7b54db558cdb43f6b7.tar
data-service-5f80856ad1587aea38ee4e7b54db558cdb43f6b7.tar.gz
Allow prioritising jobs from specific repositories
To help the QA data service prioritise branches over patches.
Diffstat (limited to 'guix-data-service/jobs')
-rw-r--r--guix-data-service/jobs/load-new-guix-revision.scm16
1 files changed, 13 insertions, 3 deletions
diff --git a/guix-data-service/jobs/load-new-guix-revision.scm b/guix-data-service/jobs/load-new-guix-revision.scm
index 8531edf..b0493ca 100644
--- a/guix-data-service/jobs/load-new-guix-revision.scm
+++ b/guix-data-service/jobs/load-new-guix-revision.scm
@@ -1898,6 +1898,9 @@ SELECT
) branches_and_latest_commits
) AS latest_branch_commit
FROM load_new_guix_revision_jobs
+INNER JOIN git_repositories
+ ON load_new_guix_revision_jobs.git_repository_id =
+ git_repositories.id
WHERE
succeeded_at IS NULL AND
(
@@ -1909,7 +1912,9 @@ WHERE
FROM load_new_guix_revision_job_events
WHERE job_id = load_new_guix_revision_jobs.id AND event = 'failure'
)
-ORDER BY latest_branch_commit DESC, id DESC")
+ORDER BY latest_branch_commit DESC,
+ git_repositories.job_priority DESC,
+ id DESC")
(map
(match-lambda
@@ -2021,7 +2026,7 @@ WHERE id = $1 ")
(define (fetch-unlocked-jobs conn)
(define query "
SELECT
- id,
+ load_new_guix_revision_jobs.id,
commit IN (
SELECT commit FROM (
SELECT DISTINCT ON (name)
@@ -2035,6 +2040,9 @@ SELECT
) branches_and_latest_commits
) AS latest_branch_commit
FROM load_new_guix_revision_jobs
+INNER JOIN git_repositories
+ ON load_new_guix_revision_jobs.git_repository_id =
+ git_repositories.id
WHERE
succeeded_at IS NULL AND
(
@@ -2046,7 +2054,9 @@ WHERE
FROM load_new_guix_revision_job_events
WHERE job_id = load_new_guix_revision_jobs.id AND event = 'failure'
)
-ORDER BY latest_branch_commit DESC, id DESC
+ORDER BY latest_branch_commit DESC,
+ git_repositories.job_priority DESC,
+ load_new_guix_revision_jobs.id DESC
FOR NO KEY UPDATE OF load_new_guix_revision_jobs
SKIP LOCKED")