Conversation
Treat composer.json as a manifest file and load its license field (string or string array, including SPDX expressions).
📝 WalkthroughWalkthroughComposer manifests are now recognized, parsed for license declarations, routed through manifest extraction, and covered by tests for strings, arrays, SPDX expressions, dispatching, case variations, and missing fields. ChangesComposer manifest support
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ManifestDispatcher
participant ComposerExtractor
participant ComposerJson
ManifestDispatcher->>ComposerExtractor: Dispatch composer.json
ComposerExtractor->>ComposerJson: Parse license field
ComposerJson-->>ComposerExtractor: License values
ComposerExtractor-->>ManifestDispatcher: Return deduplicated licenses
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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.
🧹 Nitpick comments (1)
src/fosslight_source/run_manifest_extractor.py (1)
83-88: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winNarrow the new exception boundaries.
Catching
Exceptionconverts unexpected programming errors into[], while the dispatcher adds another broad fallback. Catch only expected file/JSON failures at the appropriate boundary, or let unexpected errors remain visible for diagnosis.Also applies to: 363-368
🤖 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_manifest_extractor.py` around lines 83 - 88, In the manifest-reading flow around the composer.json loader, replace the broad Exception handler with catches limited to expected file access and JSON parsing errors, preserving the existing log-and-empty-list behavior for those failures. Do not suppress unexpected programming errors; apply the same narrowed exception boundary to the corresponding handler noted in the comment.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_source/run_manifest_extractor.py`:
- Around line 83-88: In the manifest-reading flow around the composer.json
loader, replace the broad Exception handler with catches limited to expected
file access and JSON parsing errors, preserving the existing log-and-empty-list
behavior for those failures. Do not suppress unexpected programming errors;
apply the same narrowed exception boundary to the corresponding handler noted in
the comment.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 29e82bde-c8ba-4cfc-a24a-47d353f76648
📒 Files selected for processing (3)
src/fosslight_source/_scan_item.pysrc/fosslight_source/run_manifest_extractor.pytests/test_manifest_composer.py
composer.jsonas a manifest file.composer.json, including string, array, and SPDX expression formats.