Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds an end-to-end Restore action (UI, keyboard shortcut, confirmation), backend RemoveBomEntry flow, exposes Changes
Sequence Diagram(s)sequenceDiagram
participant UI as Frontend (FilterComponentActions)
participant Service as Backend (ComponentService)
participant Repo as Backend (ScanossSettingsRepository)
participant Store as In-Memory BOM Lists
UI->>Service: ApplyFilters(filter, Action=Restore)
Service->>Repo: RemoveBomEntry(filter)
Repo->>Store: Remove matching entries from Include/Remove/Replace lists
Repo-->>Service: nil / error
Service-->>UI: return result / error
sequenceDiagram
participant Mapper as ResultMapper
participant Component as ComponentDetailTooltip
participant Display as Rendered UI
Mapper->>Mapper: MapToResultDTO(result)
Mapper->>Mapper: Detect scanner pre-applied replacement
Mapper-->>Component: ResultDTO (includes detected_name, detected_purl_url, concluded_purl)
Component->>Component: compute isPreAppliedReplacement
alt Pre-applied replacement
Component->>Display: displayName = detected_name, displayUrl = detected_purl_url (hide VERSION/LICENSE)
else No replacement
Component->>Display: displayName = original name, displayUrl = original URL (show VERSION/LICENSE)
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
SCANOSS SCAN Completed 🚀
View more details on SCANOSS Action Summary |
SCANOSS SCAN Completed 🚀
View more details on SCANOSS Action Summary |
SCANOSS SCAN Completed 🚀
View more details on SCANOSS Action Summary |
SCANOSS SCAN Completed 🚀
View more details on SCANOSS Action Summary |
SCANOSS SCAN Completed 🚀
View more details on SCANOSS Action Summary |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@frontend/src/modules/results/stores/useResultsStore.ts`:
- Around line 104-113: The sync code for selectedResults can leave stale
selections when updatedSelected is empty; change the logic in the block that
computes updatedSelected (using pendingResults and completedResults) to always
call set({ selectedResults: updatedSelected }) even when updatedSelected.length
=== 0 so the store is cleared, and then re-read the current selectedResults via
get() before executing the subsequent fallback selection logic so the fallback
uses the freshly-synced value; update references to selectedResults,
pendingResults, completedResults, updatedSelected, set(), and get() accordingly.
🧹 Nitpick comments (1)
frontend/src/components/FilterComponentActions.tsx (1)
354-367: Restore button uses a plain<button>outside the Menubar pattern.All other actions use
MenubarMenu/MenubarTriggerfor consistent styling and accessibility (keyboard navigation, ARIA roles). The restore button is a raw<button>, which won't participate in the menubar's roving tabindex or receive the same ARIA attributes. Consider wrapping it in aMenubarMenu/MenubarTriggerfor consistency, even though it has no dropdown.
SCANOSS SCAN Completed 🚀
View more details on SCANOSS Action Summary |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
scanoss.json (1)
94-97:⚠️ Potential issue | 🟡 MinorRemove duplicate replace entry.
This entry for
pkg:github/genesysgo/shadow-nft-standardis a duplicate of the one at lines 78-81. The duplicate should be removed to avoid confusion.🧹 Proposed fix to remove duplicate
{ - "purl": "pkg:github/genesysgo/shadow-nft-standard", - "replace_with": "pkg:github/shadcn-ui/ui" - }, - { "purl": "pkg:github/yournextstore/yournextstore", "replace_with": "pkg:github/shadcn-ui/ui" },🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@scanoss.json` around lines 94 - 97, Remove the duplicate replacement entry for the purl "pkg:github/genesysgo/shadow-nft-standard" by deleting the second object that contains "purl": "pkg:github/genesysgo/shadow-nft-standard" and "replace_with": "pkg:github/shadcn-ui/ui" (the duplicate shown in the diff); keep the original entry already present earlier so there is only one replacement mapping for that purl.
🧹 Nitpick comments (2)
Makefile (1)
9-9: Consider removing quotes from the variable value.The quotes around the URL become part of the Makefile variable value and are passed to ldflags. While this works, it's more conventional to define the value without quotes:
♻️ Suggested simplification
-DEFAULT_API_URL = "https://api.osskb.org" +DEFAULT_API_URL = https://api.osskb.orgWithout special characters or spaces in the URL, quotes aren't necessary. This makes it slightly easier to reason about shell expansion and avoids potential edge cases if the value is used in other contexts.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Makefile` at line 9, The DEFAULT_API_URL Makefile variable currently includes surrounding quotes which become part of its value and get propagated into ldflags; remove the surrounding quotes from the DEFAULT_API_URL assignment so the value is defined as https://api.osskb.org (update any uses that expect the quoted form if necessary) to avoid embedding literal quotes in build flags and to follow Makefile conventions.backend/entities/scanoss_settings.go (1)
74-82: Consider using pointer types for boolean fields if explicitfalseneeds to be serialized.Boolean fields with
omitemptywill be omitted from JSON output whenfalse. This means callers cannot distinguish between "not explicitly configured" and "explicitly disabled".If the server/consumer needs to differentiate between these states (e.g., a feature enabled by default that users can explicitly disable), consider using
*boolpointers like you did forRankingThreshold.If
falseis the intended default and omitting it is acceptable, this is fine as-is.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@backend/entities/scanoss_settings.go` around lines 74 - 82, The boolean fields on FileSnippetSettings (RankingEnabled, HonourFileExts, SkipHeaders) use plain bool with `omitempty`, so explicit false can’t be distinguished from unset; change those fields to pointer types (*bool) so nil == unset and &false == explicitly disabled (keep `omitempty` so nil is omitted); update any code that constructs or reads FileSnippetSettings (creators, unmarshallers, defaults) to allocate bool pointers or check for nil accordingly and preserve behavior for RankingThreshold which is already a pointer.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@scanoss.json`:
- Around line 94-97: Remove the duplicate replacement entry for the purl
"pkg:github/genesysgo/shadow-nft-standard" by deleting the second object that
contains "purl": "pkg:github/genesysgo/shadow-nft-standard" and "replace_with":
"pkg:github/shadcn-ui/ui" (the duplicate shown in the diff); keep the original
entry already present earlier so there is only one replacement mapping for that
purl.
---
Nitpick comments:
In `@backend/entities/scanoss_settings.go`:
- Around line 74-82: The boolean fields on FileSnippetSettings (RankingEnabled,
HonourFileExts, SkipHeaders) use plain bool with `omitempty`, so explicit false
can’t be distinguished from unset; change those fields to pointer types (*bool)
so nil == unset and &false == explicitly disabled (keep `omitempty` so nil is
omitted); update any code that constructs or reads FileSnippetSettings
(creators, unmarshallers, defaults) to allocate bool pointers or check for nil
accordingly and preserve behavior for RankingThreshold which is already a
pointer.
In `@Makefile`:
- Line 9: The DEFAULT_API_URL Makefile variable currently includes surrounding
quotes which become part of its value and get propagated into ldflags; remove
the surrounding quotes from the DEFAULT_API_URL assignment so the value is
defined as https://api.osskb.org (update any uses that expect the quoted form if
necessary) to avoid embedding literal quotes in build flags and to follow
Makefile conventions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9f1c6d36-abba-416a-a47b-27f13e792129
📒 Files selected for processing (7)
CHANGELOG.mdMakefilebackend/entities/scanoss_settings.gobackend/entities/version.gocmd/root.gointernal/config/config.goscanoss.json
🚧 Files skipped from review as they are similar to previous changes (1)
- CHANGELOG.md
SCANOSS SCAN Completed 🚀
View more details on SCANOSS Action Summary |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
scanoss.json (1)
3-7: Remove unusedfile_snippetsettings or wire them through to the scanner.The
file_snippetfields (ranking_enabled,skip_headers,skip_headers_limit) are deserialized from the JSON configuration into theFileSnippetSettingsstruct (backend/entities/scanoss_settings.go:74-82), but they are never accessed or used anywhere in the codebase. Adding configuration that has no effect provides no functional benefit and adds maintenance burden.Either remove these fields from the configuration file, or implement the logic to actually use them in the scanning process.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@scanoss.json` around lines 3 - 7, The FileSnippetSettings fields are unused; either remove them from the JSON and code or wire them into the scanner: Option A — delete the file_snippet keys from scanoss.json and remove the FileSnippetSettings struct and its deserialization in backend/entities/scanoss_settings.go (and any references) so config matches behavior; Option B — propagate FileSnippetSettings from ScanOSSSettings into the scanning pipeline (e.g., pass it into NewScanOSSScanner / ScanRepository / ScanFile implementation) and apply ranking_enabled, skip_headers and skip_headers_limit inside the snippet extraction routine (e.g., ExtractFileSnippets or equivalent) to control snippet ranking and header skipping. Ensure the chosen approach updates config parsing and tests accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@scanoss.json`:
- Line 133: Add a trailing newline to scanoss.json so the file ends with a POSIX
newline; this aligns with the JSONSerialize behavior in
internal/utils/file_utils_default_impl.go (JSONSerialize appends a newline) and
avoids inconsistencies between manually-maintained and generated files—open
scanoss.json, ensure the final character is a newline, save the file.
---
Nitpick comments:
In `@scanoss.json`:
- Around line 3-7: The FileSnippetSettings fields are unused; either remove them
from the JSON and code or wire them into the scanner: Option A — delete the
file_snippet keys from scanoss.json and remove the FileSnippetSettings struct
and its deserialization in backend/entities/scanoss_settings.go (and any
references) so config matches behavior; Option B — propagate FileSnippetSettings
from ScanOSSSettings into the scanning pipeline (e.g., pass it into
NewScanOSSScanner / ScanRepository / ScanFile implementation) and apply
ranking_enabled, skip_headers and skip_headers_limit inside the snippet
extraction routine (e.g., ExtractFileSnippets or equivalent) to control snippet
ranking and header skipping. Ensure the chosen approach updates config parsing
and tests accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 57e13e0f-3151-4f9e-8c0b-a57a30cc09f3
📒 Files selected for processing (2)
CHANGELOG.mdscanoss.json
🚧 Files skipped from review as they are similar to previous changes (1)
- CHANGELOG.md
SCANOSS SCAN Completed 🚀
View more details on SCANOSS Action Summary |
SCANOSS SCAN Completed 🚀
View more details on SCANOSS Action Summary |
Summary by CodeRabbit
New Features
Bug Fixes / Improvements