Francois Gouget : testbot/UpdateFailures: Truncate the bug status and description if needed.
Alexandre Julliard
julliard at winehq.org
Fri Jun 24 15:15:42 CDT 2022
Module: tools
Branch: master
Commit: 3a830b95d95eba94a286c77bb186b3ce25ef2380
URL: https://source.winehq.org/git/tools.git/?a=commit;h=3a830b95d95eba94a286c77bb186b3ce25ef2380
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Fri Jun 24 16:26:21 2022 +0200
testbot/UpdateFailures: Truncate the bug status and description if needed.
They have to fit otherwise Failure::Validate() will prevent saving to
the database.
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
testbot/bin/UpdateFailures.pl | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/testbot/bin/UpdateFailures.pl b/testbot/bin/UpdateFailures.pl
index 7c89b7b9..f324cca2 100755
--- a/testbot/bin/UpdateFailures.pl
+++ b/testbot/bin/UpdateFailures.pl
@@ -157,6 +157,7 @@ foreach my $FailureId (@FailureIds)
# Update the failures bug information
my $Bugs = CollectBugInfo([keys %$BugIds]);
+my ($MaxStatusLen, $MaxDescriptionLen);
foreach my $FailureId (@FailureIds)
{
my $Failure = $Failures->GetItem($FailureId);
@@ -167,9 +168,19 @@ foreach my $FailureId (@FailureIds)
{
my $Resolution = $Bug->{Resolution} || " ---";
$Resolution = $Resolution eq " ---" ? "" : " $Resolution";
- $Failure->BugStatus("$Bug->{Status}$Resolution");
+ if (!defined $MaxStatusLen)
+ {
+ my $PropertyDescriptor = $Failure->GetPropertyDescriptorByName("BugStatus");
+ $MaxStatusLen = $PropertyDescriptor->GetMaxLength();
+ }
+ $Failure->BugStatus(substr("$Bug->{Status}$Resolution", 0, $MaxStatusLen));
+ }
+ if (!defined $MaxDescriptionLen)
+ {
+ my $PropertyDescriptor = $Failure->GetPropertyDescriptorByName("BugDescription");
+ $MaxDescriptionLen = $PropertyDescriptor->GetMaxLength();
}
- $Failure->BugDescription($Bug->{Description});
+ $Failure->BugDescription(substr($Bug->{Description}, 0, $MaxDescriptionLen));
}
else
{
More information about the wine-cvs
mailing list