fcli icon indicating copy to clipboard operation
fcli copied to clipboard

`fcli fod *-scan setup`: Add `--skip-if-exists` option

Open rsenden opened this issue 1 year ago • 1 comments

Enhancement Request

For pipeline integrations, you usually want to make sure that a scan has been set up properly to avoid scan requests from failing. However, if a scan setup already exists, we (usually) wouldn't want to override any existing setup. So, the *-scan setup commands should have a --skip-if-exists option (similar to app create and release create commands) that checks whether a scan setup already exists, and if so, skip the scan setup operation.

rsenden avatar Sep 13 '24 15:09 rsenden

Implemented for fcli fod sast-scan setup in 855d4f3ecb3ccfc6b59cb7b9b90172c4b00ad3f3, still needs to be implemented for other scan types. Ideally, this should be generic functionality (in a new AbstractFoDScanSetupCommand class, also see comments about the current AbstractFoDScanSetupCommand class in #598) to have a consistent implementation across scan types.

Note that for mobile, we can't check whether there's an existing scan setup (as FoD doesn't provide proper GET endpoint). If we do add a --skip-if-exists option (for example defined in a common superclass), help output should mention that this isn't available yet for mobile scans.

rsenden avatar Sep 16 '24 09:09 rsenden

Mobile scan setup api exists now so we can fully implement this.

kadraman avatar Aug 27 '25 15:08 kadraman