Skip to content

Commit 77a146d

Browse files
authored
[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 * Inline allArgs binding * Add changelog entry for Vendetta debug output * Use release version for changelog entry * Fix changelog * Move --debug injection into ficusCommand So the logged "Ficus command:" line reflects the actual OS-level invocation when CLI is in debug mode.
1 parent fe49217 commit 77a146d

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

Changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# FOSSA CLI Changelog
2+
3+
## 3.17.5
4+
5+
- Vendetta: Debug bundles now include per-file component match data from Vendetta scans, making it easier to diagnose why a vendored dependency was or wasn't detected. ([#1706](https://github.com/fossas/fossa-cli/pull/1706))
6+
27
## 3.17.4
38
- Conan: Update the conan script (docs/walkthroughs/make_fossa_deps_conan.py) to work with modern conan versions ([#1629](https://github.com/fossas/fossa-cli/pull/1629) and [#1698](https://github.com/fossas/fossa-cli/pull/1698))
49

src/App/Fossa/Ficus/Analyze.hs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ runFicus maybeDebugDir ficusConfig = do
249249
logDebugWithTime "About to extract Ficus binary..."
250250
withFicusBinary $ \bin -> do
251251
logDebugWithTime "Ficus binary extracted, building command..."
252-
cmd <- ficusCommand ficusConfig bin
252+
cmd <- ficusCommand ficusConfig bin (isJust maybeDebugDir)
253253
logDebugWithTime "Executing ficus (streaming)"
254254
logDebug $ "Working directory: " <> pretty (toFilePath $ ficusConfigRootDir ficusConfig)
255255

@@ -393,8 +393,8 @@ runFicus maybeDebugDir ficusConfig = do
393393

394394
-- Run Ficus, passing config-based args as configuration.
395395
-- Caveat! This hard-codes some flags currently which may later need to be set on a strategy-by-strategy basis.
396-
ficusCommand :: (Has Diagnostics sig m, Has Logger sig m) => FicusConfig -> BinaryPaths -> m Command
397-
ficusCommand ficusConfig bin = do
396+
ficusCommand :: (Has Diagnostics sig m, Has Logger sig m) => FicusConfig -> BinaryPaths -> Bool -> m Command
397+
ficusCommand ficusConfig bin debugMode = do
398398
endpoint <- case ficusConfigEndpoint ficusConfig of
399399
Just baseUri -> do
400400
proxyUri <- setPath [PathComponent "api", PathComponent "proxy", PathComponent "analysis"] (TrailingSlash False) baseUri
@@ -411,7 +411,8 @@ ficusCommand ficusConfig bin = do
411411
pure cmd
412412
where
413413
snippetScanRetentionDays = ficusConfigSnippetScanRetentionDays ficusConfig
414-
configArgs endpoint = ["analyze", "--secret", secret, "--endpoint", endpoint, "--locator", locator, "--set", "all:skip-hidden-files", "--set", "all:gitignore", "--exclude", ".git", "--exclude", ".git/**"] ++ configExcludes ++ configStrategies ++ maybe [] (\days -> ["--snippet-scan-retention-days", toText days]) snippetScanRetentionDays ++ [targetDir]
414+
debugArgs = ["--debug" | debugMode]
415+
configArgs endpoint = debugArgs ++ ["analyze", "--secret", secret, "--endpoint", endpoint, "--locator", locator, "--set", "all:skip-hidden-files", "--set", "all:gitignore", "--exclude", ".git", "--exclude", ".git/**"] ++ configExcludes ++ configStrategies ++ maybe [] (\days -> ["--snippet-scan-retention-days", toText days]) snippetScanRetentionDays ++ [targetDir]
415416
targetDir = toText $ toFilePath $ ficusConfigRootDir ficusConfig
416417
secret = maybe "" (toText . unApiKey) $ ficusConfigSecret ficusConfig
417418
locator = renderLocator $ Locator "custom" (projectName $ ficusConfigRevision ficusConfig) (Just $ projectRevision $ ficusConfigRevision ficusConfig)

0 commit comments

Comments
 (0)