fix(sbom): add recursiveByDefault so --filter works in workspaces#12187
fix(sbom): add recursiveByDefault so --filter works in workspaces#12187Saturate wants to merge 1 commit into
Conversation
The sbom command was missing the recursiveByDefault export that other workspace-aware commands (like audit) have. Without it, the --filter flag was accepted but silently ignored: the recursive code path that populates selectedProjectsGraph from filter expressions never ran. The result was that pnpm sbom --filter always used the workspace root manifest for the SBOM root component and walked all importers instead of only the filtered ones.
Review Summary by QodoFix sbom --filter being silently ignored in workspaces
WalkthroughsDescription• Add recursiveByDefault export to sbom command • Enables --filter flag to work correctly in workspaces • Fixes sbom always using workspace root metadata • Ensures filtered packages generate correct SBOM output Diagramflowchart LR
A["sbom command"] -->|missing recursiveByDefault| B["--filter ignored"]
B -->|root metadata used| C["incorrect SBOM output"]
A -->|add recursiveByDefault| D["--filter works"]
D -->|filtered package metadata| E["correct SBOM output"]
File Changes1. deps/compliance/commands/src/sbom/sbom.ts
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🧰 Additional context used📓 Path-based instructions (1)**/*.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (13)📓 Common learnings📚 Learning: 2026-05-25T12:36:42.202ZApplied to files:
📚 Learning: 2026-05-25T12:36:42.202ZApplied to files:
📚 Learning: 2026-05-20T01:52:55.764ZApplied to files:
📚 Learning: 2026-05-07T20:38:01.796ZApplied to files:
📚 Learning: 2026-05-24T21:11:04.272ZApplied to files:
📚 Learning: 2026-05-25T12:36:42.202ZApplied to files:
📚 Learning: 2026-05-21T00:33:05.035ZApplied to files:
📚 Learning: 2026-05-24T21:11:04.272ZApplied to files:
📚 Learning: 2026-05-24T16:07:54.784ZApplied to files:
📚 Learning: 2026-05-29T18:03:15.372ZApplied to files:
📚 Learning: 2026-05-26T21:01:06.666ZApplied to files:
📚 Learning: 2026-05-14T09:04:00.133ZApplied to files:
🔇 Additional comments (2)
📝 WalkthroughWalkthroughThis PR fixes workspace filtering for the ChangesSBOM Filter Workspace Fix
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. 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 |
|
Change landed on main via #12443. |
Summary
pnpm sbom --filter <pkg>was silently ignored in workspaces. The sbom command was missing therecursiveByDefaultexport that other workspace-aware commands (likeaudit) have.Without it, the
--filterflag was accepted but the recursive code path that populatesselectedProjectsGraphnever ran. The SBOM always used the workspace root's name/version for the root component and walked all importers.Reproduction: run
pnpm sbom --sbom-format cyclonedx --filter <workspace-pkg>in any workspace. The root component in the output is the workspace root, not the filtered package. Component count drops (some filtering happens at the lockfile walker level), but root component metadata is wrong.Fix: one-line addition of
export const recursiveByDefault = trueto the sbom command module, matchingaudit.Written by an agent (Claude Code, claude-opus-4-6).
Summary by CodeRabbit
pnpm sbom --filtercommand in workspaces—the filter flag is now properly applied instead of being ignored.