Except for part 1, replies to patch series cannot be tested even if they contain a patch: - They must not take the place of the original patch series part. - They are likely to arrive long after the patch series has been completed, by which time the TestBot no longer has access to the patch series parts. - They must not cause the TestBot to open a new patch series waiting for the other parts. So ignore replies to patch series, except for replies to part 1 which are treated as regular patches. With this patch, when a collision happens, we know it's not because of a reply so adjust the corresponding patch disposition.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48353 Signed-off-by: Francois Gouget fgouget@codeweavers.com --- testbot/lib/WineTestBot/Patches.pm | 35 ++++++++++++++------- testbot/lib/WineTestBot/PendingPatchSets.pm | 2 +- 2 files changed, 25 insertions(+), 12 deletions(-)
diff --git a/testbot/lib/WineTestBot/Patches.pm b/testbot/lib/WineTestBot/Patches.pm index a76c35fd48..7cd780e5e0 100644 --- a/testbot/lib/WineTestBot/Patches.pm +++ b/testbot/lib/WineTestBot/Patches.pm @@ -542,10 +542,31 @@ sub NewPatch($$$) }
my $ErrMessage; - if (scalar(@PatchBodies) == 1) + my $SubjectInfo = $Patch->ParseSubject(); + if (@PatchBodies == 0) { - my $SubjectInfo = $Patch->ParseSubject(); - $Patch->Disposition($SubjectInfo->{PartNo} ? "Checking series" : "Checking patch"); + $Patch->Disposition("No patch found"); + } + elsif (@PatchBodies > 1) + { + $Patch->Disposition("Message contains multiple patches"); + } + elsif ($SubjectInfo->{Re} and ($SubjectInfo->{PartNo} || 0) > 1) + { + # Except for part 1, replies to patch series cannot be tested even if + # they contain a patch: + # - They must not take the place of the original patch series part. + # - They are likely to arrive long after the patch series has been + # completed, by which time the TestBot no longer has access to the + # patch series parts. + # - They must not trigger the creation of a new PendingPatchSet object. + $Patch->Disposition("Reply to a patch series"); + } + else + { + # Treat replies to patch series part 1 as regular patches + $SubjectInfo->{PartNo} = undef if ($SubjectInfo->{Re}); + $Patch->Disposition("Checking ". ($SubjectInfo->{PartNo} ? "series" : "patch")); (my $_ErrKey, my $_ErrProperty, $ErrMessage) = $self->Save(); link($PatchBodies[0]->path, "$DataDir/patches/" . $Patch->Id); if (!defined $ErrMessage) @@ -555,14 +576,6 @@ sub NewPatch($$$) $Patch->Submit($PatchBodies[0]->path, $SubjectInfo); } } - elsif (scalar(@PatchBodies) == 0) - { - $Patch->Disposition("No patch found"); - } - else - { - $Patch->Disposition("Message contains multiple patches"); - }
foreach my $PatchBody (@PatchBodies) { diff --git a/testbot/lib/WineTestBot/PendingPatchSets.pm b/testbot/lib/WineTestBot/PendingPatchSets.pm index 8f5b470542..9e386af588 100644 --- a/testbot/lib/WineTestBot/PendingPatchSets.pm +++ b/testbot/lib/WineTestBot/PendingPatchSets.pm @@ -245,7 +245,7 @@ sub NewSubmission($$$) my $Part = $Parts->GetItem($SubjectInfo->{PartNo}); if ($Part) { - $Patch->Disposition("Existing part reply / collision"); + $Patch->Disposition("Patch series collision"); return undef; }