From 3b417b16a1f3af7f705cc66e602432a1f7bb2e68 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 11 Feb 2020 09:49:39 +0100 Subject: [PATCH] [FIX] runbot_merge: when looking for stageable PRs group by target This is more of a sanity check as it normally should not be a factor: labels generally contain the target name, and staging checks are performed per-target so we're not mixing multiple targets anyway. But let's say a third-party creates a fix-foo branch for A and a fix-foo branch for B, we want to ensure they're not considered batched together. --- runbot_merge/models/pull_requests.py | 1 + 1 file changed, 1 insertion(+) diff --git a/runbot_merge/models/pull_requests.py b/runbot_merge/models/pull_requests.py index 2f00484c..267c1de2 100644 --- a/runbot_merge/models/pull_requests.py +++ b/runbot_merge/models/pull_requests.py @@ -337,6 +337,7 @@ class Branch(models.Model): AND pr.state != 'merged' AND pr.state != 'closed' GROUP BY + pr.target, CASE WHEN pr.label SIMILAR TO '%%:patch-[[:digit:]]+' THEN pr.id::text