@@ -103,11 +103,11 @@ func testAllDepGraphs(
103
103
return allLegacyFindings , allOutputData , nil
104
104
}
105
105
106
+ // createTestSubject creates a test subject from a depGraph and display target file.
106
107
func createTestSubject (
107
108
depGraph * testapi.IoSnykApiV1testdepgraphRequestDepGraph ,
108
109
displayTargetFile string ,
109
110
) (testapi.TestSubjectCreate , error ) {
110
- // Create depgraph subject
111
111
depGraphSubject := testapi.DepGraphSubjectCreate {
112
112
Type : testapi .DepGraphSubjectCreateTypeDepGraph ,
113
113
DepGraph : * depGraph ,
@@ -117,7 +117,6 @@ func createTestSubject(
117
117
},
118
118
}
119
119
120
- // Create test subject with depgraph
121
120
var subject testapi.TestSubjectCreate
122
121
err := subject .FromDepGraphSubjectCreate (depGraphSubject )
123
122
if err != nil {
@@ -140,6 +139,10 @@ func getProjectName(
140
139
return projectName
141
140
}
142
141
142
+ // handleOutput processes both legacy JSON and human-readable findings into their respective outputs.
143
+ // Human-readable output is processed by the local template renderer.
144
+ // JSON file output is written to file here, while JSON stdout is added to the output workflow.
145
+ // Summary data is added to the output workflow for exit code calculation.
143
146
func handleOutput (
144
147
ictx workflow.InvocationContext ,
145
148
allLegacyFindings []definitions.LegacyVulnerabilityResponse ,
@@ -198,6 +201,7 @@ func handleOutput(
198
201
return finalOutput , nil
199
202
}
200
203
204
+ // prepareJSONOutput prepares legacy JSON output from findings.
201
205
func prepareJSONOutput (
202
206
allLegacyFindings []definitions.LegacyVulnerabilityResponse ,
203
207
errFactory * errors.ErrorFactory ,
0 commit comments