Skip to content

Commit a1b8d5f

Browse files
Support SCS Secret Detection results for Jetbrains agent in JSON report(AST-110764) (#1297)
* Support SCS Secret Detection results for Jetbrains agent in JSON report * Resolved SCS resubmission issue and updated JetBrains test case name for clarity
1 parent 56b78d8 commit a1b8d5f

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

internal/commands/result.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1158,7 +1158,7 @@ func filterResultsByType(results *wrappers.ScanResultsCollection, excludedTypes
11581158
func filterScsResultsByAgent(results *wrappers.ScanResultsCollection, agent string) *wrappers.ScanResultsCollection {
11591159
unsupportedTypesByAgent := map[string][]string{
11601160
commonParams.VSCodeAgent: {commonParams.SCSScorecardType},
1161-
commonParams.JetbrainsAgent: {commonParams.SCSScorecardType, commonParams.SCSSecretDetectionType},
1161+
commonParams.JetbrainsAgent: {commonParams.SCSScorecardType},
11621162
commonParams.EclipseAgent: {commonParams.SCSScorecardType, commonParams.SCSSecretDetectionType},
11631163
commonParams.VisualStudioAgent: {commonParams.SCSScorecardType, commonParams.SCSSecretDetectionType},
11641164
}

internal/commands/result_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ func TestRunScsResultsShow_VSCode_AgentShouldNotShowScorecardResults(t *testing.
197197
mock.SetScsMockVarsToDefault()
198198
}
199199

200-
func TestRunScsResultsShow_Other_AgentsShouldNotShowScsResults(t *testing.T) {
200+
func TestRunScsResultsShow_Jetbrains_AgentShouldShowScsResults(t *testing.T) {
201201
clearFlags()
202202
mock.HasScs = true
203203
mock.ScsScanPartial = false
@@ -206,8 +206,8 @@ func TestRunScsResultsShow_Other_AgentsShouldNotShowScsResults(t *testing.T) {
206206

207207
execCmdNilAssertion(t, "results", "show", "--scan-id", "SCS_ONLY", "--report-format", "json", "--agent", params.JetbrainsAgent)
208208
assertTypePresentJSON(t, params.SCSScorecardType, 0)
209-
assertTypePresentJSON(t, params.SCSSecretDetectionType, 0)
210-
assertTotalCountJSON(t, 0)
209+
assertTypePresentJSON(t, params.SCSSecretDetectionType, 2)
210+
assertTotalCountJSON(t, 2)
211211

212212
removeFileBySuffix(t, printer.FormatJSON)
213213
mock.SetScsMockVarsToDefault()

internal/commands/scan.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,6 +1030,7 @@ func getResubmitConfiguration(scansWrapper wrappers.ScansWrapper, projectID, use
10301030

10311031
if len(allScansModel.Scans) > 0 {
10321032
scanModelResponse := allScansModel.Scans[0]
1033+
scanModelResponse.ReplaceMicroEnginesWithSCS()
10331034
config = scanModelResponse.Metadata.Configs
10341035
engines := scanModelResponse.Engines
10351036
// Check if there are no scan types sent using the flags, and use the latest scan engine types

0 commit comments

Comments
 (0)