@@ -316,6 +316,11 @@ def generate_report(self, sketches_reports):
316
316
Keyword arguments:
317
317
sketches_reports -- list of sketches_reports containing the data to generate the deltas report from
318
318
"""
319
+ # From https://github.community/t/maximum-length-for-the-comment-body-in-issues-and-pr/148867/2
320
+ # > PR body/Issue comments are still stored in MySQL as a mediumblob with a maximum value length of 262,144.
321
+ # > This equals a limit of 65,536 4-byte unicode characters.
322
+ maximum_report_length = 262144
323
+
319
324
fqbn_column_heading = "Board"
320
325
321
326
# Generate summary report data
@@ -395,21 +400,27 @@ def generate_report(self, sketches_reports):
395
400
report_markdown = report_markdown + generate_markdown_table (row_list = summary_report_data ) + "\n "
396
401
397
402
# Add full table
398
- report_markdown = (report_markdown
399
- + "<details>\n "
400
- "<summary>Click for full report table</summary>\n \n " )
401
- report_markdown = (report_markdown
402
- + generate_markdown_table (row_list = full_report_data )
403
- + "\n </details>\n \n " )
404
-
405
- # Add full CSV
406
- report_markdown = (report_markdown
407
- + "<details>\n "
408
- "<summary>Click for full report CSV</summary>\n \n "
409
- "```\n " )
410
- report_markdown = (report_markdown
411
- + generate_csv_table (row_list = full_report_data )
412
- + "```\n </details>" )
403
+ report_markdown_with_table = (report_markdown
404
+ + "<details>\n "
405
+ "<summary>Click for full report table</summary>\n \n " )
406
+ report_markdown_with_table = (report_markdown_with_table
407
+ + generate_markdown_table (row_list = full_report_data )
408
+ + "\n </details>\n \n " )
409
+
410
+ if len (report_markdown_with_table ) < maximum_report_length :
411
+ report_markdown = report_markdown_with_table
412
+
413
+ # Add full CSV
414
+ report_markdown_with_csv = (report_markdown
415
+ + "<details>\n "
416
+ "<summary>Click for full report CSV</summary>\n \n "
417
+ "```\n " )
418
+ report_markdown_with_csv = (report_markdown_with_csv
419
+ + generate_csv_table (row_list = full_report_data )
420
+ + "```\n </details>" )
421
+
422
+ if len (report_markdown_with_csv ) < maximum_report_length :
423
+ report_markdown = report_markdown_with_csv
413
424
414
425
logger .debug ("Report:\n " + report_markdown )
415
426
return report_markdown
0 commit comments