8000 MNT fix body too long in update_tracking_issue.py (#23615) · scikit-learn/scikit-learn@8ec1ea3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8ec1ea3

Browse files
lesteveglemaitre
authored andcommitted
MNT fix body too long in update_tracking_issue.py (#23615)
1 parent c767699 commit 8ec1ea3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

maint_tools/update_tracking_issue.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@ def create_or_update_issue(body=""):
7474
link = f"[{args.ci_name}]({args.link_to_ci_run})"
7575
issue = get_issue()
7676

77+
max_body_length = 60_000
78+
original_body_length = len(body)
79+
# Avoid "body is too long (maximum is 65536 characters)" error from github REST API
80+
if original_body_length > max_body_length:
81+
body = (
82+
f"{body[:max_body_length]}\n...\n"
83+
f"Body was too long ({original_body_length} characters) and was shortened"
84+
)
85+
7786
if issue is None:
7887
# Create new issue
7988
header = f"**CI failed on {link}**"

0 commit comments

Comments
 (0)
0