Skip to content

Conversation

@mscasso-scanoss
Copy link
Contributor

@mscasso-scanoss mscasso-scanoss commented Dec 23, 2025

Summary by CodeRabbit

  • New Features

    • Header-based scan settings (base64 JSON) and SBOM-aware, config-driven scanning flow
    • New server tuning options for ranking, snippet thresholds and file-extension handling with sensible defaults
  • Tests

    • Added unit tests for scanning configuration and E2E tests for scan-settings header and related scenarios
  • Chores

    • Updated changelog with new scanning config support and server-side options (unreleased)

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 23, 2025

📝 Walkthrough

Walkthrough

Adds new server-side scanning settings (ranking/snippet controls), introduces a ScanningServiceConfig type with defaulting and update-from-request logic (including base64 JSON header), and refactors scanning call sites to accept and propagate the new config and SBOM parameters.

Changes

Cohort / File(s) Summary
Configuration schema
pkg/config/server_config.go
Added ServerConfig.Scanning fields: RankingAllowed, RankingEnabled, RankingThreshold, MinSnippetHits, MinSnippetLines, HonourFileExts with env tags and defaults in setServerConfigDefaults.
Config type & utilities
pkg/service/scanning_service_config.go, pkg/service/scanning_service_config_test.go
New ScanningServiceConfig type, DefaultScanningServiceConfig(*cfg.ServerConfig) factory, and UpdateScanningServiceConfigDTO(...) which applies base64/JSON settings and legacy params. Unit tests added covering defaults, JSON updates, ranking-allowed enforcement, legacy params, invalid input, and combined updates.
Scanning service refactor
pkg/service/scanning_service.go
Replaced per-request flags/strings with ScanningServiceConfig; added getConfigFromRequest() decoding scanoss-settings header (base64 JSON); introduced SBOM constants; updated signatures for singleScan, scanThreaded, workerScan, scanWfp; removed getFlags(); engine command construction now uses config fields (flags, dbName, SBOM, ranking/snippet options).
KB details usage
pkg/service/kb_details.go
loadKBDetails now passes a default ScanningServiceConfig to s.scanWfp instead of an empty string.
End-to-end tests
tests/scanning_test.go
Added TestScanSettingsHeader() exercising scan settings header (valid/invalid base64 JSON and legacy flags); adjusted expectations for invalid KB name (now expecting 200) and updated two asset cases to use JSON PURLs.
Changelog
CHANGELOG.md
Added [1.6.0] Unreleased entry noting scanoss.json scanning config support and new server-side scanning parameters.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant HTTP as "HTTP Server"
  participant Service as "ScanningService"
  participant Engine as "Scan Engine"
  participant Storage as "SBOM / File Storage"

  rect rgb(235,247,255)
    Client->>HTTP: POST /scan/direct (body + optional header scanoss-settings)
    HTTP->>Service: request + headers
    note right of Service: getConfigFromRequest decodes\nbase64 JSON -> ScanningServiceConfig
  end

  rect rgb(245,255,235)
    Service->>Service: DefaultScanningServiceConfig(server defaults)
    Service->>Service: UpdateScanningServiceConfigDTO(JSON, legacy params)
    alt SBOM provided
      Service->>Storage: validate/create SBOM (config.sbomFile)
      Storage-->>Service: sbomFile path
    end
  end

  rect rgb(255,250,235)
    Service->>Engine: start scan(s) with ScanningServiceConfig + sbomFile
    Engine->>Engine: workerScan threads use config (flags, ranking, thresholds)
    Engine-->>Service: scan results
  end

  Service->>HTTP: respond with results/status
  HTTP->>Client: HTTP response
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

"A small rabbit hops in code tonight,
nibbling headers and turning them bright.
Base64 crumbs and configs aligned,
threads hum softly, results refined.
🐇✨"

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 77.78% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: adding support for new scanning parameters in the Go API, which is reflected throughout the codebase modifications.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch mscasso/feat/SP-3838-Update-go.api-to-support-the-new-scanning-parameters

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (4)
tests/scanning_test.go (1)

136-222: Good test coverage for the new scan settings header feature.

The test covers key scenarios: valid base64-encoded settings, invalid base64 handling, and integration with legacy flags. Consider adding a test case for malformed JSON (valid base64 but invalid JSON content) to verify that the server handles this gracefully and uses defaults.

🔎 Optional: Additional test case for malformed JSON
{
    name:            "Test Invalid ScanSettings - Malformed JSON",
    filename:        "../pkg/service/tests/fingers.wfp",
    shortName:       "fingers.wfp",
    // Base64 of "{invalid json}"
    scanSettingsB64: "e2ludmFsaWQganNvbn0=",
    extraFields:     map[string]string{},
    want:            http.StatusOK,
    description:     "Should handle malformed JSON gracefully and continue with defaults",
},
pkg/service/scanning_service_config.go (2)

74-74: Address the TODO or create an issue to track it.

The TODO indicates a warning should be added when ranking settings are rejected due to RankingAllowed being false. This would improve observability for API consumers.

Would you like me to open an issue to track adding a warning log when ranking settings are rejected?


100-123: Simplify redundant empty string checks.

The conditions len(x) > 0 && x != "" are redundant since an empty string always has length 0. Either check is sufficient.

🔎 Proposed fix
-	if len(dbName) > 0 && dbName != "" {
+	if dbName != "" {
 		currentConfig.dbName = dbName
 		s.Debugf("Updated DbName to %s", currentConfig.dbName)
 	}

-	if len(flags) > 0 && flags != "" {
+	if flags != "" {
 		flagsInt, err := strconv.Atoi(flags)
 		if err != nil {
 			s.Errorf("Error converting flags to integer: %v", err)
 		} else {
 			currentConfig.flags = flagsInt
 			s.Debugf("Updated Flags to %d", currentConfig.flags)
 		}
 	}

-	if len(scanType) > 0 && scanType != "" {
+	if scanType != "" {
 		currentConfig.sbomType = scanType
 		s.Debugf("Updated SbomType to %s", currentConfig.sbomType)
 	}

-	if len(sbom) > 0 && sbom != "" {
+	if sbom != "" {
 		currentConfig.sbomFile = sbom
 		s.Debugf("Updated SbomFile to %s", currentConfig.sbomFile)
 	}
pkg/service/scanning_service.go (1)

93-95: Extract "identify" and "blacklist" as constants.

Static analysis flagged that the string "identify" appears 3 times. Extract these SBOM type strings as constants for maintainability.

🔎 Proposed fix - Add constants at package level
+const (
+	sbomTypeIdentify  = "identify"
+	sbomTypeBlacklist = "blacklist"
+)
+
 // scanDirect handles WFP scanning requests from a client.

Then update usages:

-		if scanConfig.sbomType != "identify" && scanConfig.sbomType != "blacklist" {
+		if scanConfig.sbomType != sbomTypeIdentify && scanConfig.sbomType != sbomTypeBlacklist {

...

-		case "identify":
+		case sbomTypeIdentify:
 			args = append(args, "-s")
-		case "blacklist":
+		case sbomTypeBlacklist:
 			args = append(args, "-b")
 		default:
 			args = append(args, "-s") // Default to identify

Also applies to: 414-421

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0dcc097 and 83ce843.

📒 Files selected for processing (6)
  • pkg/config/server_config.go
  • pkg/service/kb_details.go
  • pkg/service/scanning_service.go
  • pkg/service/scanning_service_config.go
  • pkg/service/scanning_service_config_test.go
  • tests/scanning_test.go
🧰 Additional context used
🧬 Code graph analysis (3)
pkg/service/kb_details.go (1)
pkg/service/scanning_service_config.go (1)
  • DefaultScanningServiceConfig (39-52)
pkg/service/scanning_service_config_test.go (2)
pkg/config/server_config.go (1)
  • ServerConfig (37-93)
pkg/service/scanning_service_config.go (3)
  • DefaultScanningServiceConfig (39-52)
  • ScanningServiceConfig (26-37)
  • UpdateScanningServiceConfigDTO (54-126)
pkg/service/scanning_service.go (2)
pkg/service/utils_service.go (1)
  • APIService (71-73)
pkg/service/scanning_service_config.go (3)
  • ScanningServiceConfig (26-37)
  • DefaultScanningServiceConfig (39-52)
  • UpdateScanningServiceConfigDTO (54-126)
🪛 GitHub Check: build
pkg/config/server_config.go

[warning] 77-77:
comment-spacings: no space between comment delimiter and comment text (revive)


[warning] 73-73:
comment-spacings: no space between comment delimiter and comment text (revive)


[warning] 131-131:
comment-spacings: no space between comment delimiter and comment text (revive)

pkg/service/scanning_service.go

[failure] 94-94:
string identify has 3 occurrences, make it a constant (goconst)


[failure] 197-197:
elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)

🔇 Additional comments (13)
pkg/service/kb_details.go (1)

88-89: LGTM!

The refactor correctly uses DefaultScanningServiceConfig to create a configuration object from server defaults before passing it to scanWfp. This aligns with the new unified configuration flow introduced across the scanning service.

tests/scanning_test.go (2)

51-51: LGTM - Expected behavior change documented.

The change from http.StatusInternalServerError to http.StatusOK reflects that the engine now handles invalid KB names gracefully with a fallback, as noted in the comment.


93-101: LGTM - Assets format updated to proper JSON structure.

The assets field now uses proper JSON format with components array containing PURLs, which aligns with the expected SBOM structure.

pkg/service/scanning_service_config_test.go (5)

27-64: LGTM - Comprehensive test for default config creation.

The test properly validates that all fields from ServerConfig.Scanning are correctly mapped to ScanningServiceConfig.


66-123: LGTM - Good coverage for JSON-based settings updates.

The test validates that all JSON settings fields are correctly parsed and applied when rankingAllowed is true.


125-162: LGTM - Important test for the RankingAllowed guard.

This test verifies the critical security/business logic that ranking settings are ignored when RankingAllowed is false at the server level.


164-222: LGTM - Good coverage for legacy parameters and invalid input handling.

Tests properly validate backward compatibility with legacy string parameters and graceful error handling for invalid inputs.


224-286: LGTM - Combined update test validates precedence.

Good test ensuring both JSON settings and legacy parameters can be applied together in a single update.

pkg/service/scanning_service_config.go (2)

26-37: LGTM - Well-structured configuration type.

The ScanningServiceConfig struct cleanly encapsulates all scanning parameters with appropriate types. Using unexported fields enforces controlled access through the provided functions.


39-52: LGTM - Clean mapping from server config to service config.

DefaultScanningServiceConfig correctly initializes all fields from the server configuration, providing sensible empty defaults for sbomType and sbomFile.

pkg/service/scanning_service.go (3)

90-109: LGTM - Clean integration with new config flow.

The scan direct handler now correctly uses getConfigFromRequest to obtain configuration and accesses SBOM settings through the config object.


224-226: LGTM - Updated method signatures.

The singleScan method correctly accepts the new ScanningServiceConfig parameter and passes it through to scanWfp.


425-443: LGTM - New scan arguments are properly conditionally added.

The new ranking and snippet parameters are correctly added to the command arguments when their conditions are met. Good to log that honourFileExts is not yet implemented in the engine.

Comment on lines +407 to 410
// Scanning flags
if config.flags > 0 {
args = append(args, fmt.Sprintf("-F %v", config.flags))
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check how other flags are formatted with args
echo "=== Searching for flag patterns with %v ==="
rg -n '\-[a-zA-Z].*%' --type=go pkg/service/

echo ""
echo "=== Searching for append with args and flags ==="
rg -n 'append.*args.*"-' --type=go pkg/service/ -A 1 -B 1

echo ""
echo "=== Show the specific lines in question ==="
sed -n '400,415p' pkg/service/scanning_service.go

Repository: scanoss/api.go

Length of output: 5068


Change flag formatting from -F %v to -F%v for consistency.

The flag uses fmt.Sprintf("-F %v", config.flags) with a space, but similar single-character flags in the codebase consistently use no space: -n%s (line 404) and -r%d (line 427). This creates an inconsistent argument format. Change to -F%v to match the established pattern.

🤖 Prompt for AI Agents
In pkg/service/scanning_service.go around lines 407 to 410, the flag is
formatted with a space as fmt.Sprintf("-F %v", config.flags) which is
inconsistent with other single-character flags; change the format string to
"-F%v" so the argument is built without the space, keeping the same fmt.Sprintf
call and ensuring the resulting args append matches the established pattern.

if err != nil {
zs.Errorf("Error decoding scan settings from base64: %v", err)
decoded = nil
} else {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use 'else if' instead the current else block?

@@ -0,0 +1,126 @@
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright (C) 2018-2023 SCANOSS.COM

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we change the date to 2025?

@@ -0,0 +1,286 @@
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright (C) 2018-2023 SCANOSS.COM

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we update the date to 2025?

Copy link

@agustingroh agustingroh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, add changes to CHANGELOG.md file

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (2)
pkg/config/server_config.go (1)

131-138: Typo in comment on line 137.

The comment for MinSnippetLines says "minimum snippet hits" but should say "minimum snippet lines".

🔎 Proposed fix
-	cfg.Scanning.MinSnippetLines = 0 // Lets the engine decide on minimum snippet hits on the file total lines
+	cfg.Scanning.MinSnippetLines = 0 // Lets the engine decide on minimum snippet lines based on the file total lines
pkg/service/scanning_service.go (1)

411-414: Flag format inconsistency.

This was flagged in a previous review: the flag uses "-F %v" with a space, but other single-character flags in this file use no space (e.g., "-n%s" on line 408, "-r%d" on line 431).

🔎 Proposed fix
-		args = append(args, fmt.Sprintf("-F %v", config.flags))
+		args = append(args, fmt.Sprintf("-F%v", config.flags))
🧹 Nitpick comments (1)
pkg/service/scanning_service_config.go (1)

108-131: Simplify redundant empty string checks.

The checks len(x) > 0 && x != "" are redundant since a non-empty string always has length > 0.

🔎 Proposed fix
-	if len(dbName) > 0 && dbName != "" {
+	if dbName != "" {
 		currentConfig.dbName = dbName
 		s.Debugf("Updated DbName to %s", currentConfig.dbName)
 	}

-	if len(flags) > 0 && flags != "" {
+	if flags != "" {
 		flagsInt, err := strconv.Atoi(flags)
 		if err != nil {
 			s.Errorf("Error converting flags to integer: %v", err)
 		} else {
 			currentConfig.flags = flagsInt
 			s.Debugf("Updated Flags to %d", currentConfig.flags)
 		}
 	}

-	if len(scanType) > 0 && scanType != "" {
+	if scanType != "" {
 		currentConfig.sbomType = scanType
 		s.Debugf("Updated SbomType to %s", currentConfig.sbomType)
 	}

-	if len(sbom) > 0 && sbom != "" {
+	if sbom != "" {
 		currentConfig.sbomFile = sbom
 		s.Debugf("Updated SbomFile to %s", currentConfig.sbomFile)
 	}
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 83ce843 and b789b60.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • pkg/config/server_config.go
  • pkg/service/scanning_service.go
  • pkg/service/scanning_service_config.go
  • pkg/service/scanning_service_config_test.go
🧰 Additional context used
🧬 Code graph analysis (2)
pkg/service/scanning_service_config.go (1)
pkg/config/server_config.go (1)
  • ServerConfig (37-93)
pkg/service/scanning_service_config_test.go (2)
pkg/config/server_config.go (1)
  • ServerConfig (37-93)
pkg/service/scanning_service_config.go (3)
  • DefaultScanningServiceConfig (39-52)
  • ScanningServiceConfig (26-37)
  • UpdateScanningServiceConfigDTO (54-134)
🔇 Additional comments (11)
pkg/config/server_config.go (1)

73-80: LGTM!

The new scanning configuration fields are well-structured with appropriate environment variable tags and clear inline documentation.

pkg/service/scanning_service_config.go (3)

26-37: LGTM!

The struct encapsulates all scanning configuration fields appropriately. Using unexported fields enforces controlled access through the provided functions.


39-52: LGTM!

The default config factory correctly maps all server configuration fields to the service config.


54-73: Consider whether early return on JSON error is the desired behavior.

When JSON unmarshalling fails, the function logs an error and returns the original config unchanged. This silently ignores potentially malformed input. Consider whether returning an error or setting a flag to indicate partial configuration would be more appropriate for debugging/observability.

pkg/service/scanning_service_config_test.go (3)

27-64: LGTM!

Comprehensive test for default config creation, validating all fields are correctly mapped from server config.


125-162: LGTM!

Good test ensuring the RankingAllowed guard prevents ranking settings from being modified when not allowed.


197-222: LGTM!

Important error handling tests that verify the config remains unchanged when given invalid input.

pkg/service/scanning_service.go (4)

40-43: LGTM!

Good practice defining constants for SBOM types to avoid magic strings.


95-114: LGTM!

Clean integration of the new config-based approach for SBOM validation and file handling.


164-209: LGTM!

Well-structured function that consolidates config extraction from form values, headers, and base64-encoded settings. The else-if style issue from previous review has been addressed.


429-447: LGTM!

Good handling of the new scanning parameters. The honourFileExts logging with a note about engine support is a pragmatic approach for future-proofing.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
pkg/service/scanning_service.go (1)

411-414: Fix flag formatting inconsistency.

The flag formatting uses fmt.Sprintf("-F %v", config.flags) with a space, but other single-character flags in the same function consistently use no space: -n%s (line 408) and -r%d (line 431). Change to -F%v to maintain consistency.

🔎 Proposed fix
 	// Scanning flags
 	if config.flags > 0 {
-		args = append(args, fmt.Sprintf("-F %v", config.flags))
+		args = append(args, fmt.Sprintf("-F%v", config.flags))
 	}
🧹 Nitpick comments (1)
pkg/service/scanning_service_config.go (1)

54-134: Consider simplifying the parameter/return pattern.

The function takes a pointer parameter, modifies it in-place, and then returns the dereferenced value. Since callers use the return value (line 208 in scanning_service.go), the pointer modification is redundant. Consider either:

  • Taking the config by value and returning the modified value (no pointer needed), OR
  • Modifying the pointer and returning nothing (void)

The current pattern works but may confuse future maintainers about whether to use the modified pointer or the returned value.

🔎 Proposed refactor (pass by value)
-func UpdateScanningServiceConfigDTO(s *zap.SugaredLogger, currentConfig *ScanningServiceConfig,
+func UpdateScanningServiceConfigDTO(s *zap.SugaredLogger, currentConfig ScanningServiceConfig,
 	flags, scanType, sbom, dbName string, inputSettings []byte) ScanningServiceConfig {
 	// ScanSettings represents the scanning parameters that can be configured
 	type scanSettings struct {
 		RankingEnabled   *bool `json:"ranking_enabled,omitempty"`
 		RankingThreshold *int  `json:"ranking_threshold,omitempty"`
 		MinSnippetHits   *int  `json:"min_snippet_hits,omitempty"`
 		MinSnippetLines  *int  `json:"min_snippet_lines,omitempty"`
 		HonourFileExts   *bool `json:"honour_file_exts,omitempty"`
 	}
 
 	// Parse scan settings from JSON if provided
 	var newSettings scanSettings
 	if len(inputSettings) > 0 {
 		err := json.Unmarshal(inputSettings, &newSettings)
 		if err != nil {
 			s.Errorf("Error unmarshalling scanning service config input: %v", err)
-			return *currentConfig
+			return currentConfig
 		}
 	}
 
 	if newSettings.RankingEnabled != nil {
 		if currentConfig.rankingAllowed {
 			currentConfig.rankingEnabled = *newSettings.RankingEnabled
 			s.Debugf("Updated RankingEnabled to %v", currentConfig.rankingEnabled)
 		} else {
 			s.Warnf("RankingEnabled setting ignored as RankingAllowed is false")
 		}
 	}
 
 	// ... rest of the function remains the same ...
 
-	return *currentConfig
+	return currentConfig
 }

And update the caller at line 208 in scanning_service.go:

-	return UpdateScanningServiceConfigDTO(zs, &scanConfig, flags, scanType, sbom, dbName, decoded)
+	return UpdateScanningServiceConfigDTO(zs, scanConfig, flags, scanType, sbom, dbName, decoded)
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b789b60 and 272af55.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • pkg/service/scanning_service.go
  • pkg/service/scanning_service_config.go
🧰 Additional context used
🧬 Code graph analysis (2)
pkg/service/scanning_service.go (2)
pkg/service/utils_service.go (1)
  • APIService (71-73)
pkg/service/scanning_service_config.go (3)
  • ScanningServiceConfig (26-37)
  • DefaultScanningServiceConfig (39-52)
  • UpdateScanningServiceConfigDTO (54-134)
pkg/service/scanning_service_config.go (1)
pkg/config/server_config.go (1)
  • ServerConfig (37-93)
🔇 Additional comments (8)
CHANGELOG.md (1)

11-15: LGTM!

The version entry is properly formatted with a recent release date and clear descriptions of the new scanning configuration features. The comparison link that was previously missing has been added at line 169.

pkg/service/scanning_service_config.go (1)

39-52: LGTM!

The function correctly initializes default scanning configuration from server-wide settings, with appropriate defaults for SBOM fields.

pkg/service/scanning_service.go (6)

40-43: LGTM!

The SBOM type constants are well-defined and improve maintainability by centralizing these string literals.


164-209: LGTM!

The function cleanly extracts configuration from both form values and headers, with proper base64 decoding of the scan settings header. The fallback logic ensures flexibility in how clients can provide parameters.


95-115: LGTM!

The config-driven approach is well-integrated here, with proper validation of SBOM types using the defined constants. The configuration flows correctly to the scanning functions.


228-228: LGTM!

The function signatures have been consistently updated to accept the scanning configuration. Passing the config by value is appropriate since these functions only read from it.

Also applies to: 248-248, 340-340, 379-379


416-427: LGTM!

The SBOM configuration logic correctly maps the SBOM type to the appropriate command-line flags using the defined constants, with a sensible default fallback.


444-447: Update the stale comment or remove the unsupported flag.

The --ignore-file-ext flag is added to scan arguments when honourFileExts is false (lines 445-446), but the comment states it's "not yet implemented in scanoss engine." The mock test engine does not recognize this flag, and no engine documentation confirms support. Either:

  1. Update the comment to reflect current engine support if now implemented, or
  2. Remove or gate this flag behind a feature flag until engine support is confirmed

Running scans with an unrecognized flag risks failures depending on the engine version in use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants