Support and log timeout for SCANOSS#297
Conversation
Pass the timeout (-t) parameter to the SCANOSS Scanner constructor, enabling/disabling the SCANOSS API request timeout. Also update the help message to indicate the timeout option applies to both ScanCode and SCANOSS. Signed-off-by: Park Wonjae <wonjae.park@lge.com>
|
Warning Review limit reached
Next review available in: 58 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe SCANOSS scanner now receives the configured timeout and marks scans skipped for API-limit or request-timeout output. Skip state flows through ChangesSCANOSS timeout and skip reporting
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant run_scanners
participant run_scanoss_py
participant Scanner
participant create_report_file
run_scanners->>run_scanoss_py: pass configured timeout
run_scanoss_py->>Scanner: start SCANOSS scan with timeout
Scanner-->>run_scanoss_py: return captured output
run_scanoss_py-->>run_scanners: return result and skip state
run_scanners->>create_report_file: pass scanoss_skipped
create_report_file-->>run_scanners: set report cover comment
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
f98857b to
25196e1
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/fosslight_source/run_scanoss.py (2)
52-52: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueCatch a more specific exception for missing dependencies.
Catching
Exceptionhere is overly broad and might mask unexpected issues. Since the goal is to check whether thescanosspackage is installed, it is safer to catchimportlib_metadata.PackageNotFoundError.♻️ Proposed refactor
- except Exception as error: + except importlib_metadata.PackageNotFoundError as error:🤖 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_source/run_scanoss.py` at line 52, Update the dependency-check import handling around the `scanoss` package lookup to catch only `importlib_metadata.PackageNotFoundError` instead of the broad `Exception`, while preserving the existing missing-package behavior and allowing unexpected errors to propagate.Source: Linters/SAST tools
62-101: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueDifferentiate between scanning and parsing errors.
The
tryblock spanning lines 62-98 covers both the scan execution and the result parsing. However, theexceptblock on line 99 logs the error asSCANOSS Parsing, which can be misleading if the failure actually occurred during the scan execution phase.Consider splitting the
try...exceptblocks or updating the error message to accurately reflect the failure context.🤖 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_source/run_scanoss.py` around lines 62 - 101, Differentiate failures in the SCANOSS execution from failures in result parsing within the surrounding scan flow. Update the exception handling around Scanner initialization and scan_folder_with_options to log a scanning-specific error, while the JSON loading and parsing path should log a parsing-specific error; preserve the existing skip detection and result-processing behavior.
🤖 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_source/run_scanoss.py`:
- Line 52: Update the dependency-check import handling around the `scanoss`
package lookup to catch only `importlib_metadata.PackageNotFoundError` instead
of the broad `Exception`, while preserving the existing missing-package behavior
and allowing unexpected errors to propagate.
- Around line 62-101: Differentiate failures in the SCANOSS execution from
failures in result parsing within the surrounding scan flow. Update the
exception handling around Scanner initialization and scan_folder_with_options to
log a scanning-specific error, while the JSON loading and parsing path should
log a parsing-specific error; preserve the existing skip detection and
result-processing behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 98fbdb05-6b09-4b3a-884f-acbda33ee618
📒 Files selected for processing (3)
src/fosslight_source/_help.pysrc/fosslight_source/cli.pysrc/fosslight_source/run_scanoss.py
fa0d7dc to
25196e1
Compare
Pass the timeout (-t) parameter to the SCANOSS Scanner constructor, check for timeout in the output buffer, log a warning, and set the cover sheet skip status accordingly. Signed-off-by: Park Wonjae <wonjae.park@lge.com>
25196e1 to
43ec79a
Compare
Description
This PR supports passing the timeout (
-t,--timeout) parameter to the SCANOSS scanner and improves error logging and reporting when a timeout occurs.Changes
-tvalue to the SCANOSSScannerconstructor (defaults to 120s, aligning with ScanCode).SCANOSS skipped (Timeout)) and write detailed error info to the debug log.SCANOSS replaced with KBif KB succeeded, otherwiseSCANOSS skipped).-toption description to show that it applies to both ScanCode and SCANOSS.