[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.
This commit is contained in:
Xavier Morel 2020-02-11 09:49:39 +01:00
parent b96bc9a58c
commit 3b417b16a1

View File

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