[ANE-2724] Pass --debug to Ficus when CLI is in debug mode#1706
[ANE-2724] Pass --debug to Ficus when CLI is in debug mode#1706
Conversation
04fd545 to
186e51a
Compare
WalkthroughThis pull request updates the FOSSA CLI changelog to document release 3.17.5 and modifies the Ficus analysis module to conditionally enable debug mode. The changelog addition notes that debug bundles now include per-file component match data from Vendetta scans. In 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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.
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/App/Fossa/Ficus/Analyze.hs`:
- Around line 257-265: The logged Ficus command omits debugArgs (the "--debug"
added when maybeDebugDir is Just _) because the log is built from cmdArgs alone;
update ficusCommand to compute the final argument list (combine debugArgs with
map toString (cmdArgs cmd)) after processConfig is assembled and log that final
effective args (use the same combined list used in processConfig) so the debug
log reflects the exact OS invocation; reference debugArgs, maybeDebugDir,
processConfig and the function that builds the command (ficusCommand/where
block) to locate and adjust the logging.
🪄 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: Repository YAML (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: e490cd8d-55a3-4952-a375-b6ecaf9fcd4d
📒 Files selected for processing (2)
Changelog.mdsrc/App/Fossa/Ficus/Analyze.hs
So the logged "Ficus command:" line reflects the actual OS-level invocation when CLI is in debug mode.
Overview
Important
This PR depends on fossas/ficus#170 being released first. Current Ficus will reject the
--debugflag, so this must not be merged until a Ficus release containing that change is vendored in.When the CLI runs with
--debug, Ficus was still running at its defaultinfolog level. This meant debug-level observations (like per-file Vendetta match data from fossas/ficus#170) were filtered out and never made it into the debug bundle.This passes
--debugto Ficus when the CLI is in debug mode, so that Ficus's debug observations show up infossa.ficus-stdout.log.We use a CLI flag rather than setting
FICUS_LOG=debugvia the process environment because it's simpler (no need to inherit and merge the parent environment) and it keeps Ficus's debug mode explicitly visible in the command invocation.Acceptance criteria
--debug, Ficus receives--debugand emits debug-level observations--debug, Ficus behavior is unchangedTesting plan
Requires fossas/ficus#170 to be released and vendored first.
--debug:fossa.ficus-stdout.login the debug bundle:You should see structured file match observations like:
{"file":"vendor/sqlite/sqlite3.c","component":"sqlite","purl":"pkg:github/nicowilliams/[email protected]","corrected":false,"single_file_lib":false}--debugand confirmfossa.ficus-stdout.logdoes NOT contain debug observations (onlyfindinganderrorlevel).Debug bundle size impact
Tested on the fossa-cli repo itself (~22k files walked by Vendetta):
--debugto Ficus--debugto FicusThe zip grows by ~140 KB (16%) thanks to ~95% compression on the repetitive debug output.
Risks
This PR must be released after fossas/ficus#170. Current Ficus rejects unknown flags, so merging this before the Ficus update would break Ficus invocation when
--debugis used.References
--debugflag)Checklist
docs/.docs/README.msand gave consideration to how discoverable or not my documentation is.Changelog.md. If this PR did not mark a release, I added my changes into an## Unreleasedsection at the top..fossa.ymlorfossa-deps.{json.yml}, I updateddocs/references/files/*.schema.jsonAND I have updated example files used byfossa initcommand. You may also need to update these if you have added/removed new dependency type (e.g.pip) or analysis target type (e.g.poetry).docs/references/subcommands/<subcommand>.mdNo tests needed for this change. It's passing a flag through to a subprocess.