Skip to content

Unify running time formatting in reports and logs#286

Open
bjk7119 wants to merge 1 commit into
mainfrom
running
Open

Unify running time formatting in reports and logs#286
bjk7119 wants to merge 1 commit into
mainfrom
running

Conversation

@bjk7119

@bjk7119 bjk7119 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes
    • Improved scan/report logging so results are recorded in a more reliable structured format.
    • Added more accurate timing information for scans and reports, including displayed running time when available.
    • Standardized timestamp formatting to make generated times more precise and consistent.

@bjk7119 bjk7119 self-assigned this Jul 3, 2026
@bjk7119 bjk7119 added the chore [PR/Issue] Refactoring, maintenance the code label Jul 3, 2026
@coderabbitai

coderabbitai Bot commented Jul 3, 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: 7 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: 6dfdea9c-0208-45d9-ba12-4ec4d0e6a3a9

📥 Commits

Reviewing files that changed from the base of the PR and between edd1164 and 3acb214.

📒 Files selected for processing (2)
  • src/fosslight_source/cli.py
  • src/fosslight_source/run_scancode.py
📝 Walkthrough

Walkthrough

The CLI and run_scancode modules replace YAML-based result log serialization with dump_result_log, remove direct yaml imports, update start/finish timestamp formats to include seconds, and compute a "Running time" field via format_running_time before logging.

Changes

Structured Result Logging

Layer / File(s) Summary
Timestamp format and import updates
src/fosslight_source/cli.py
Imports dump_result_log and format_running_time, removes yaml import; start/finish timestamps changed to '%Y%m%d_%H%M%S' format in create_report_file and run_scanners.
CLI result log emission
src/fosslight_source/cli.py
main() and run_scanners() now log results via dump_result_log instead of yaml.safe_dump; run_scanners computes finish_time, sets Running time via format_running_time, and wraps logging in try/except with a warning on failure.
Scancode timing and log emission
src/fosslight_source/run_scancode.py
Imports dump_result_log/format_running_time, removes yaml; _start_time format updated to include seconds; end-of-scan logging computes _finish_time, sets Running time, and logs via dump_result_log.

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

Sequence Diagram(s)

sequenceDiagram
  participant run_scanners
  participant format_running_time
  participant dump_result_log
  participant logger

  run_scanners->>run_scanners: compute finish_time
  run_scanners->>format_running_time: compute Running time
  format_running_time-->>run_scanners: return duration string
  run_scanners->>dump_result_log: dump_result_log(result_log)
  dump_result_log-->>run_scanners: return formatted log
  run_scanners->>logger: logger.info(formatted log) or warn on failure
Loading
🚥 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 accurately summarizes the main change: aligning running time formatting across reports and logs.
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.

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