Merge ~logan/ubuntu-dev-tools:lp-1193941 into ubuntu-dev-tools:master

Proposed by Logan Rosen
Status: Merged
Merged at revision: c5b5d554bc6185b2bb9fb3459ecf9806989b9e0d
Proposed branch: ~logan/ubuntu-dev-tools:lp-1193941
Merge into: ubuntu-dev-tools:master
Diff against target: 13 lines (+2/-0)
1 file modified
import-bug-from-debian (+2/-0)
Reviewer Review Type Date Requested Status
Mattia Rizzolo Approve
Review via email: mp+395616@code.launchpad.net

Description of the change

LP's API limits descriptions to 50K chars, but import-bug-from-debian tries to create an LP bug with whatever description was in Debian's BTS, regardless of length, leading to a 400 error if it's greater than 50K chars. This commit truncates the description in the script accordingly.

To post a comment you must log in.
Revision history for this message
Mattia Rizzolo (mapreri) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/import-bug-from-debian b/import-bug-from-debian
2index 079ce3c..ee7ef5c 100755
3--- a/import-bug-from-debian
4+++ b/import-bug-from-debian
5@@ -117,6 +117,8 @@ def main():
6
7 description = ('Imported from Debian bug http://bugs.debian.org/%d:\n\n%s' %
8 (bug_num, summary))
9+ # LP limits descriptions to 50K chars
10+ description = (description[:49994] + ' [...]') if len(description) > 50000 else description
11
12 Logger.debug('Target: %s' % target)
13 Logger.debug('Subject: %s' % subject)

Subscribers

People subscribed via source and target branches