Skip to content

Report a failed download in run_main's return value - #194

Open
bjk7119 wants to merge 1 commit into
mainfrom
run-main-return
Open

Report a failed download in run_main's return value#194
bjk7119 wants to merge 1 commit into
mainfrom
run-main-return

Conversation

@bjk7119

@bjk7119 bjk7119 commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes
    • Analysis now accurately reports failure when downloading the source is unsuccessful.
    • Added clearer error logging for source download failures.

@bjk7119 bjk7119 self-assigned this Aug 8, 2026
@bjk7119 bjk7119 added the bug fix [PR] Fix the bug label Aug 8, 2026
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

run_main now tracks source download success, logs an error when downloading fails, and returns the resulting analysis status.

Changes

Analysis status handling

Layer / File(s) Summary
Track and return download status
src/fosslight_scanner/fosslight_scanner.py
run_main initializes analysis_success, updates it from source downloading, logs download failures, and returns the status.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: dd-jy, justinwonjaepark, soimkim

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: returning a failed download status from run_main.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch run-main-return

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/fosslight_scanner/fosslight_scanner.py (1)

530-533: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add regression coverage for failed downloads.

When download_source returns False, assert that run_main returns False and does not call run_scanner. This protects the new return-value contract.

🤖 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_scanner/fosslight_scanner.py` around lines 530 - 533, Add
regression coverage for the failed-download branch in run_main: mock
download_source to return False, assert run_main returns False, and verify
run_scanner is not called. Use the existing test fixtures and mocking
conventions without changing the production flow.
🤖 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.

Nitpick comments:
In `@src/fosslight_scanner/fosslight_scanner.py`:
- Around line 530-533: Add regression coverage for the failed-download branch in
run_main: mock download_source to return False, assert run_main returns False,
and verify run_scanner is not called. Use the existing test fixtures and mocking
conventions without changing the production flow.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8685eeb7-622c-481b-befb-4cc45f426483

📥 Commits

Reviewing files that changed from the base of the PR and between 3bc404a and 6475993.

📒 Files selected for processing (1)
  • src/fosslight_scanner/fosslight_scanner.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug fix [PR] Fix the bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant