Skip to content

Commit ea0de44

Browse files
committed
URI debugging
1 parent 48d85f7 commit ea0de44

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

benchmarks/lowq2_reconstruction/PRfunctions.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,13 +228,15 @@ def create_pr_suggestion(repo_owner, repo_name, pr_number, calibration_file, xml
228228
for img_path in before_images:
229229
data_uri = create_data_uri_from_file(img_path)
230230
if data_uri:
231+
print(f" Embedding data URI (first 100 chars): {data_uri[:100]}...")
231232
comment_body += f'<img src="{data_uri}" alt="Before Image" width="800" />\n\n'
232233

233234
if after_images:
234235
comment_body += "\n\n---\n\n### ✨ After Calibration Update\n\n"
235236
for img_path in after_images:
236237
data_uri = create_data_uri_from_file(img_path)
237238
if data_uri:
239+
print(f" Embedding data URI (first 100 chars): {data_uri[:100]}...")
238240
comment_body += f'<img src="{data_uri}" alt="After Image" width="800" />\n\n'
239241

240242
# Add artifacts URL link if provided
@@ -248,6 +250,14 @@ def create_pr_suggestion(repo_owner, repo_name, pr_number, calibration_file, xml
248250
print(f"⚠️ WARNING: Comment exceeds GitHub's 65KB limit by {comment_size - 65536} characters!")
249251
print(" Consider further compressing images or reducing resolution.")
250252

253+
# Debug: Print a snippet of the comment around the image tags
254+
img_tag_pos = comment_body.find('<img src="')
255+
if img_tag_pos > 0:
256+
snippet_start = max(0, img_tag_pos - 50)
257+
snippet_end = min(len(comment_body), img_tag_pos + 200)
258+
print(f"\n📋 Comment snippet around first image tag:")
259+
print(f"{comment_body[snippet_start:snippet_end]}...")
260+
251261
# Create or update comment via GitHub REST API (no gh CLI)
252262
if existing_comment_id:
253263
print(f"Updating existing comment {existing_comment_id}...")

0 commit comments

Comments
 (0)