Skip to content

Commit

Permalink
Truncate initial bug description if it is too long. Fixes #374
Browse files Browse the repository at this point in the history
  • Loading branch information
tomrittervg committed Sep 10, 2024
1 parent 6fb0299 commit 4ba472d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions components/bugzilla.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ def __init__(self, config):

@logEntryExit
def file_bug(self, library, summary, description, cc_list, needinfo=None, see_also=None, depends_on=None, blocks=None, moco_confidential=False):
if len(description) > 65535:
self.logger.log("New bug description is too long: %s characters; truncating." % (len(description)), level=LogLevel.Warning)
suffix = "\n\nOops - the above comment was too long. I was unable to shrink it nicely, so I had to truncate it to fit Bugzilla's limits."
description = description[0:65533 - len(suffix)] + suffix

try:
bugID = fileBug(self.config['url'], self.config['apikey'], self.config['General']['ff-version'],
library.bugzilla_product, library.bugzilla_component,
Expand Down

0 comments on commit 4ba472d

Please sign in to comment.