Skip to content

fod sast-scan start: add --in-progress-action and --entitlement-preference options, fix NPE#1032

Closed
Copilot wants to merge 3 commits into
dev/v3.xfrom
copilot/fix-nullpointerexception-and-add-ftest
Closed

fod sast-scan start: add --in-progress-action and --entitlement-preference options, fix NPE#1032
Copilot wants to merge 3 commits into
dev/v3.xfrom
copilot/fix-nullpointerexception-and-add-ftest

Conversation

Copilot AI commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Addresses two review comments on PR #1015: a potential NullPointerException on the remediationScanType mixin field, and missing functional test coverage for the new advanced-scan code paths.

Changes

FoDSastScanStartCommand

  • Added --in-progress-action (InProgressScanActionType) and --entitlement-preference (EntitlementPreferenceType) options
  • Routes to startScanAdvanced when either new option is supplied; falls back to startScanWithDefaults otherwise (backward-compatible)
  • Guards remediationScanType against null before dereferencing — @Mixin fields are not guaranteed to be injected:
    // Before (NPE risk)
    FoDEnums.RemediationScanPreferenceType remediationPref = remediationScanType.getRemediationScanPreferenceType();
    
    // After
    FoDEnums.RemediationScanPreferenceType remediationPref = remediationScanType != null
            ? remediationScanType.getRemediationScanPreferenceType() : null;
  • Translates CancelScanInProgress"CancelInProgressScan" at the SAST command boundary (FoD's start-scan-advanced rejects the enum name); Queue is the default when the advanced path is taken without an explicit --in-progress-action

FoDScanSastHelper.startScanAdvanced

  • Passes inProgressScanActionType as a raw string rather than through valueOf(), since the translated wire value CancelInProgressScan is not a valid enum name; added a comment explaining the intentional asymmetry with the other parameters

FoDMessages.properties

  • Added fcli.fod.sast-scan.start.in-progress-action description with completion candidates

FoDScanSpec (ftest)

  • Added start.sast-scan-advanced-queue: exercises the advanced endpoint with --in-progress-action=Queue
  • Added start.sast-scan-advanced-entitlement-preference: exercises the advanced endpoint with --entitlement-preference=SubscriptionOnly (implicitly defaults --in-progress-action to Queue)

Copilot AI changed the title [WIP] Fix code for all comments in review thread fod sast-scan start: add --in-progress-action and --entitlement-preference options, fix NPE Jun 9, 2026
Copilot AI requested a review from kadraman June 9, 2026 14:51
@kadraman kadraman closed this Jun 10, 2026
@kadraman kadraman deleted the copilot/fix-nullpointerexception-and-add-ftest branch June 10, 2026 13:00
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.

2 participants