From: Nathan Cutler Date: Tue, 30 Apr 2019 11:38:33 +0000 (+0200) Subject: script/backport-create-issue: handle long Redmine issue names X-Git-Tag: v15.1.0~2766^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F27887%2Fhead;p=ceph.git script/backport-create-issue: handle long Redmine issue names Redmine issue names have a maximum length of 255 characters. When we prepend, e.g., "nautilus: " to a very long issue name, we can end up with a string that is over 255 characters long. Such a string will be refused by Redmine: ValidationError: Subject is too long (maximum is 255 characters) This patch avoids such an eventuality by truncating the post-prepend string to 255 characters. Signed-off-by: Nathan Cutler --- diff --git a/src/script/backport-create-issue b/src/script/backport-create-issue index b77c7cfaaf26..01587ceea3ae 100755 --- a/src/script/backport-create-issue +++ b/src/script/backport-create-issue @@ -189,7 +189,7 @@ def update_relations(r, issue, dry_run): logging.error(url(issue) + " requires backport to " + "unknown release " + release) break - subject = release + ": " + issue['subject'] + subject = (release + ": " + issue['subject'])[:255] if dry_run: logging.info(url(issue) + " add backport to " + release) continue