Skip to content

Add running time output to cover sheet and result log#186

Merged
bjk7119 merged 3 commits into
mainfrom
running
Jul 9, 2026
Merged

Add running time output to cover sheet and result log#186
bjk7119 merged 3 commits into
mainfrom
running

Conversation

@bjk7119

@bjk7119 bjk7119 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes
    • Standardized output, temporary folder, and log filenames using shared timestamp utilities for consistent naming.
    • Improved comparison and run summary filename/log generation, including clearer “Running time” reporting.
    • Fixed analysis API result normalization so falsy values aren’t incorrectly replaced with an empty list.
  • Dependencies
    • Updated the fosslight_util dependency version constraint to a newer range.

@bjk7119
bjk7119 requested a review from dd-jy July 2, 2026 08:29
@bjk7119 bjk7119 self-assigned this Jul 2, 2026
@bjk7119 bjk7119 added the chore [PR/Issue] Refactoring, maintenance the code label Jul 2, 2026
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@bjk7119, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 45 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6873e8a5-fc5b-426f-9324-6f6c72ab9539

📥 Commits

Reviewing files that changed from the base of the PR and between c0857ab and bfe6f13.

📒 Files selected for processing (2)
  • src/fosslight_scanner/_run_compare.py
  • src/fosslight_scanner/common.py
📝 Walkthrough

Walkthrough

Timestamp-based naming is standardized across scanner outputs, temporary paths, logs, and comparison files. Final result logging switches to structured dumping with running-time formatting, and call_analysis_api now preserves falsy non-None results.

Changes

Timestamp helper adoption

Layer / File(s) Summary
Imports and helper wiring
src/fosslight_scanner/fosslight_scanner.py, src/fosslight_scanner/_run_compare.py
Imports are updated to use shared timestamp and result-log helpers across the scanner and compare modules.
Scan start time and report filenames
src/fosslight_scanner/fosslight_scanner.py
run_scanner initializes _start_time and _file_time earlier, and report filenames and per-mode outputs use _file_time for spdx, cyclonedx, json, Excel, and UI paths.
Temp paths and log filenames
src/fosslight_scanner/fosslight_scanner.py
download_source, init, and run_main use timestamp helpers for temporary directories, compare-mode output names, and final log file names.
Compare filename prefix
src/fosslight_scanner/_run_compare.py
get_comparison_result_filename builds the compare prefix with timestamp_for_filename(_start_time) and falls back to the raw value on ValueError.
Shared return normalization and dependency floor
src/fosslight_scanner/common.py, pyproject.toml
call_analysis_api now preserves falsy non-None results, and fosslight_util is bumped to a newer minimum version.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • fosslight/fosslight_scanner#167: Both PRs modify src/fosslight_scanner/fosslight_scanner.py to change how timestamps are derived and embedded into per-mode Excel report filenames.

Suggested reviewers: dd-jy

🚥 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 matches the main change: adding running time output to the cover sheet and result log.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch running

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)

361-369: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Unused unpacked variables final_excel_dir and result_log.

Static analysis flags these as unpacked-but-unused. Prefix with underscore to signal intent, since download_source only needs the temp directory path.

♻️ Proposed fix
-        success, final_excel_dir, result_log = init(out_dir)
+        success, _final_excel_dir, _result_log = init(out_dir)
🤖 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 361 - 369, The
unpacked values from init(out_dir) in download_source are not used, so rename
final_excel_dir and result_log to underscore-prefixed variables to make the
intent explicit and satisfy static analysis. Keep the current control flow and
only retain the values actually needed by download_source, using the existing
init and download_source symbols to locate the unpacking site.

Source: Linters/SAST tools

🤖 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 361-369: The unpacked values from init(out_dir) in download_source
are not used, so rename final_excel_dir and result_log to underscore-prefixed
variables to make the intent explicit and satisfy static analysis. Keep the
current control flow and only retain the values actually needed by
download_source, using the existing init and download_source symbols to locate
the unpacking site.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: df82a23f-bdb7-46cf-983e-ecef0ef1daec

📥 Commits

Reviewing files that changed from the base of the PR and between b7c561d and be80771.

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

@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.

Actionable comments posted: 1

🤖 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_scanner/fosslight_scanner.py`:
- Around line 168-171: `run_main()` is dropping the `result_log` returned by
`init()`, so URL scans never carry the `Tool Info` metadata into
`run_scanner()`. Update the URL-scan flow in `fosslight_scanner.py` so
`download_source()` and the `run_main()` branch both preserve and pass through
`result_log` instead of replacing it with an empty dict. Also adjust any
callers/tests that assume the old return shape, using the `init()`,
`download_source()`, and `run_scanner()` symbols to locate the affected paths.
🪄 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: 6d888ded-8cd4-4de8-95f7-902686480793

📥 Commits

Reviewing files that changed from the base of the PR and between be80771 and c0857ab.

📒 Files selected for processing (4)
  • pyproject.toml
  • src/fosslight_scanner/_run_compare.py
  • src/fosslight_scanner/common.py
  • src/fosslight_scanner/fosslight_scanner.py
✅ Files skipped from review due to trivial changes (1)
  • pyproject.toml
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/fosslight_scanner/_run_compare.py

Comment thread src/fosslight_scanner/fosslight_scanner.py
@bjk7119
bjk7119 merged commit c6aae41 into main Jul 9, 2026
7 checks passed
@dd-jy
dd-jy deleted the running branch July 14, 2026 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore [PR/Issue] Refactoring, maintenance the code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant