chore(): update failing lychee and coderabbit#7629
chore(): update failing lychee and coderabbit#7629aidankmcalister wants to merge 1 commit intomainfrom
Conversation
WalkthroughTwo files were updated. The Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/lychee.yml:
- Around line 162-171: The python -c block fails due to YAML indentation being
included in the inline Python string; replace the inline "python -c" invocation
with a here-document (heredoc) so the Python source (starting with "from pathlib
import Path") is passed verbatim; keep the same logic using
Path('lychee/formatted.md'), p.read_text, p.write_text, max_chars and note, and
ensure the heredoc delimiter is quoted to prevent shell interpolation so the
truncation logic runs without IndentationError.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: c2825c40-8f19-47dd-8e73-8563660d95e1
📒 Files selected for processing (2)
.coderabbit.yaml.github/workflows/lychee.yml
| python -c " | ||
| from pathlib import Path | ||
| p = Path("lychee/formatted.md") | ||
| p = Path('lychee/formatted.md') | ||
| if p.exists(): | ||
| max_chars = 60000 | ||
| text = p.read_text(encoding="utf-8") | ||
| text = p.read_text(encoding='utf-8') | ||
| if len(text) > max_chars: | ||
| note = "\n\n_Comment truncated to avoid GitHub body limit. Download the artifact for full details._\n" | ||
| p.write_text(text[: max_chars - len(note)] + note, encoding="utf-8") | ||
| PY | ||
| note = '\n\n_Comment truncated to avoid GitHub body limit. Download the artifact for full details._\n' | ||
| p.write_text(text[:max_chars - len(note)] + note, encoding='utf-8') | ||
| " |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set +e
python3 -c "
from pathlib import Path
p = Path('lychee/formatted.md')
if p.exists():
max_chars = 60000
text = p.read_text(encoding='utf-8')
if len(text) > max_chars:
note = '\n\n_Comment truncated to avoid GitHub body limit. Download the artifact for full details._\n'
p.write_text(text[:max_chars - len(note)] + note, encoding='utf-8')
"
status=$?
printf 'python3 exit code: %s\n' "$status"Repository: prisma/web
Length of output: 182
🏁 Script executed:
# Check the actual file content at the specified lines
head -n 171 .github/workflows/lychee.yml | tail -n 15Repository: prisma/web
Length of output: 761
🏁 Script executed:
# Test the proposed heredoc fix to ensure it works correctly
python3 - <<'PY'
from pathlib import Path
p = Path('lychee/formatted.md')
if p.exists():
max_chars = 60000
text = p.read_text(encoding='utf-8')
if len(text) > max_chars:
note = '\n\n_Comment truncated to avoid GitHub body limit. Download the artifact for full details._\n'
p.write_text(text[:max_chars - len(note)] + note, encoding='utf-8')
PY
echo "Exit code: $?"Repository: prisma/web
Length of output: 66
Fix the Python indentation error that breaks the comment truncation step.
The python -c script at lines 162–171 has leading whitespace from YAML indentation that becomes part of the Python source code. When Python executes it, the first statement (from pathlib import Path) raises IndentationError: unexpected indent, causing the cleanup step to fail and preventing the automatic truncation safeguard from running.
Switch to a here-document to avoid this issue:
Fix
- python -c "
- from pathlib import Path
- p = Path('lychee/formatted.md')
- if p.exists():
- max_chars = 60000
- text = p.read_text(encoding='utf-8')
- if len(text) > max_chars:
- note = '\n\n_Comment truncated to avoid GitHub body limit. Download the artifact for full details._\n'
- p.write_text(text[:max_chars - len(note)] + note, encoding='utf-8')
- "
+ python - <<'PY'
+from pathlib import Path
+
+p = Path('lychee/formatted.md')
+if p.exists():
+ max_chars = 60000
+ text = p.read_text(encoding='utf-8')
+ if len(text) > max_chars:
+ note = '\n\n_Comment truncated to avoid GitHub body limit. Download the artifact for full details._\n'
+ p.write_text(text[:max_chars - len(note)] + note, encoding='utf-8')
+PY📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| python -c " | |
| from pathlib import Path | |
| p = Path("lychee/formatted.md") | |
| p = Path('lychee/formatted.md') | |
| if p.exists(): | |
| max_chars = 60000 | |
| text = p.read_text(encoding="utf-8") | |
| text = p.read_text(encoding='utf-8') | |
| if len(text) > max_chars: | |
| note = "\n\n_Comment truncated to avoid GitHub body limit. Download the artifact for full details._\n" | |
| p.write_text(text[: max_chars - len(note)] + note, encoding="utf-8") | |
| PY | |
| note = '\n\n_Comment truncated to avoid GitHub body limit. Download the artifact for full details._\n' | |
| p.write_text(text[:max_chars - len(note)] + note, encoding='utf-8') | |
| " | |
| python - <<'PY' | |
| from pathlib import Path | |
| p = Path('lychee/formatted.md') | |
| if p.exists(): | |
| max_chars = 60000 | |
| text = p.read_text(encoding='utf-8') | |
| if len(text) > max_chars: | |
| note = '\n\n_Comment truncated to avoid GitHub body limit. Download the artifact for full details._\n' | |
| p.write_text(text[:max_chars - len(note)] + note, encoding='utf-8') | |
| PY |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/workflows/lychee.yml around lines 162 - 171, The python -c block
fails due to YAML indentation being included in the inline Python string;
replace the inline "python -c" invocation with a here-document (heredoc) so the
Python source (starting with "from pathlib import Path") is passed verbatim;
keep the same logic using Path('lychee/formatted.md'), p.read_text,
p.write_text, max_chars and note, and ensure the heredoc delimiter is quoted to
prevent shell interpolation so the truncation logic runs without
IndentationError.
Summary by CodeRabbit