Trim message posted to rietveld to 10000.

Rietveld doesn't post the message when it is too large.

R=petermayo@chromium.org
BUG=
TEST=Now the CQ should stop having weird case where it doesn't post a message on
CQ failure. It was because the message was simply too long!


Review URL: http://codereview.chromium.org/10383004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@135326 0039d316-1c4b-4281-b951-d872f2087c98
experimental/szager/collated-output
maruel@chromium.org 13 years ago
parent 306080c46d
commit 2c96af7d78

@ -1,3 +1,4 @@
# coding: utf-8
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@ -217,6 +218,10 @@ class Rietveld(object):
('xsrf_token', self.xsrf_token())])
def add_comment(self, issue, message):
max_message = 10000
tail = '\n(message too large)'
if len(message) > max_message:
message = message[:max_message-len(tail)] + tail
logging.info('issue %s; comment: %s' % (issue, message))
return self.post('/%s/publish' % issue, [
('xsrf_token', self.xsrf_token()),

Loading…
Cancel
Save