Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds RPM/SRPM extraction support to the download utility. The compression extension collection is converted from a set to a dict, a new helper function handles RPM payload extraction with multiple fallback methods, and the main extraction flow is extended to recognize and process RPM files. ChangesRPM/SRPM Extraction Support
🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/fosslight_util/download.py (1)
1008-1015: 💤 Low valueCollapse the two RPM branches into a single
endswithtuple.Both branches have identical bodies and only differ by the extension being matched. Consider merging them for readability.
♻️ Proposed refactor
- elif fname.lower().endswith(".src.rpm"): - if not extract_rpm_payload(fname, extract_path): - success = False - is_compressed_file = False - elif fname.lower().endswith(".rpm"): + elif fname.lower().endswith((".src.rpm", ".rpm")): if not extract_rpm_payload(fname, extract_path): success = False is_compressed_file = False🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/fosslight_util/download.py` around lines 1008 - 1015, Both RPM branches duplicate logic; replace the two separate elifs with a single conditional that checks fname.lower().endswith((".src.rpm", ".rpm")) and keep the existing body that calls extract_rpm_payload(fname, extract_path) and updates success and is_compressed_file; ensure you reference the same variables (fname, extract_path, success, is_compressed_file, extract_rpm_payload) so behavior remains identical while removing the duplicated block.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/fosslight_util/download.py`:
- Around line 907-942: The rpm2cpio child process (p1) can be leaked if
subprocess.run for cpio raises; wrap the subprocess.run([cpio, ...],
stdin=p1.stdout, ...) call in a try/except so that any exception (including
TimeoutExpired/OSError) will close p1.stdout (if present), kill p1 and call
p1.wait() to reap it, then log and return False; also in the existing
p1.communicate TimeoutExpired handler, after p1.kill() call p1.wait() before
returning, and ensure any code paths that inspect p1.returncode do so after
p1.wait() so the process has been reaped (references: p1, rpm2cpio,
subprocess.run call, p1.communicate, extract_compressed_file).
---
Nitpick comments:
In `@src/fosslight_util/download.py`:
- Around line 1008-1015: Both RPM branches duplicate logic; replace the two
separate elifs with a single conditional that checks
fname.lower().endswith((".src.rpm", ".rpm")) and keep the existing body that
calls extract_rpm_payload(fname, extract_path) and updates success and
is_compressed_file; ensure you reference the same variables (fname,
extract_path, success, is_compressed_file, extract_rpm_payload) so behavior
remains identical while removing the duplicated block.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 4991ae1d-7468-4ac1-b4ab-22bd8b9307b3
📒 Files selected for processing (1)
src/fosslight_util/download.py
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Description
Support HTTP(S) .src.rpm and .rpm extract after wget.
ex. https://mirror.de.leaseweb.net/fedora/updates/testing/44/Everything/source/tree/Packages/r/rust-gst-plugin-gif-0.15.0-1.fc44.src.rpm
Summary by CodeRabbit