You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AST-120196-Enable/disable commit history scanning (#1357)
* feat: Add git-commit-history flag for Secret Detection scans
* test: add UTs for flag validation and enabling logic
* refactor: update git-commit-history flag description for clarity
* refactor: reduce cyclomatic complexity
* refactor: enhance functionality with feature flag integration for commit history
* test: add and update UTs considering commit history FF
* test: add clearFlags() calls for consistency
* test: add wrappers.ClearCache() calls to clear cache
* test: ensure that flags are cleared after use
* refactor: set git commit history to false if configured correctly to allow overrides
* test: remove redundant case insensitive TRUE/FALSE tests for flag values
* refactor: improve use of warning messages and remove default value
* refactor: update warning messages for git commit history flag usage
---------
Co-authored-by: Margarita Levit <[email protected]>
Co-authored-by: Anurag Dalke <[email protected]>
ScsScorecardUnsupportedHostWarningMsg="SCS scan warning: Unable to run Scorecard scanner due to unsupported repo host. Currently, Scorecard can only run on GitHub Cloud repos."
126
126
127
+
gitCommitHistoryInvalidValueErrorMsg="Invalid value for --git-commit-history. Valid values are: 'true' or 'false'"
128
+
gitCommitHistoryNotAvailableWarningMsg="Secret Detection scan warning: --git-commit-history flag ignored because git commit history scanning is not available."
129
+
gitCommitHistoryNotSelectedWarningMsg="Secret Detection scan warning: --git-commit-history flag ignored because scs was not specified in scan types."
130
+
gitCommitHistoryNotApplicableWarningMsg="Secret Detection scan warning: --git-commit-history flag ignored because secret detection wasn't run on this scan."
131
+
gitCommitHistoryNoGitRepositoryWarningMsg="Secret Detection scan warning: No Git history found. Secret Detection will scan the working tree only."
132
+
127
133
jsonExt=".json"
128
134
xmlExt=".xml"
129
135
sbomScanTypeErrMsg="The --sbom-only flag can only be used when the scan type is sca"
@@ -884,6 +890,7 @@ func scanCreateSubCommand(
884
890
createScanCmd.PersistentFlags().String(commonParams.SCSRepoTokenFlag, "", "Provide a token with read permission for the repo that you are scanning (for scorecard scans)")
885
891
createScanCmd.PersistentFlags().String(commonParams.SCSRepoURLFlag, "", "The URL of the repo that you are scanning with scs (for scorecard scans)")
886
892
createScanCmd.PersistentFlags().String(commonParams.SCSEnginesFlag, "", "Specify which scs engines will run (default: all licensed engines)")
0 commit comments