They have to fit otherwise Failure::Validate() will prevent saving to
the database.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
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 7c89b7b99b..f324cca280 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
{
--
2.30.2