Skip to content

Conversation

@eyalk007
Copy link
Collaborator

@eyalk007 eyalk007 commented Jan 13, 2026

  • All tests passed. If this feature is not already covered by the tests, I added new tests.
  • This pull request is on the dev branch.
  • I used gofmt for formatting the code before submitting the pull request.
  • Update documentation about new features / new supported technologies

- Run SCA and JAS scans in parallel for better performance
- Use LogCollector for isolated log capture per scan
- Logs dumped sequentially after scans complete (no interleaving)
- Add SetLogCollector to ScanDetails for passing collector to CLI
- Export FrogbotUploadRtRepoPath for result upload
@eyalk007 eyalk007 added the new feature Automatically generated release notes label Jan 13, 2026
@eyalk007 eyalk007 self-assigned this Jan 13, 2026
- Add JF_PARALLEL_PR_SCAN env var (default: true, set to 'false' for sequential mode)
- Remove verbose/redundant comments
- Remove gradle cache files from tracking
- scanPullRequestBranches: scanning + partial results filtering
- auditPullRequestAndReport: output flags + issue conversion
@eyalk007
Copy link
Collaborator Author

frogbot-pr-info.txt - regular log mode

frogbot-pr-debug.txt - debug mode

diffResults := results.UnifyScaAndJasResults(scaResult.source, jasDiff)

log.Info("Uploading results to platform...")
if _, err := output.UploadCommandResults(scanDetails.ServerDetails, utils.FrogbotUploadRtRepoPath, diffResults); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this operation exist in frogbot before ? (uploading the results to RT) or was it cli responsibility before?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cli
it uploaded after the second scan finished, and it knew it was in a diff context

now scans in parallel and it doesnt know its in diff really (other than sca)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so if i understand - it means that for scan-pr -> frogbot uploads results, but for scan-repo - cli uploads the results

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

targetLogCollector := audit.NewLogCollector(log.GetLogger().GetLogLevel())
targetScanDetails.SetLogCollector(targetLogCollector)

targetResults = targetScanDetails.Audit(targetDir)
Copy link
Contributor

@orto17 orto17 Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are the Audit commands in runScaScans are not running in parallel but in run JasScans they are executed as a go routine?

Copy link
Collaborator Author

@eyalk007 eyalk007 Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because in sca , for diff:
We calculate the target sca sbom
delta it with source, during source scan
and then what is left we do sca scan and contextual when we scan the source

running the sca on target takes milliseconds becasue sbom calculation is almost immediate with the new engine

if e != nil {
err = errors.Join(err, fmt.Errorf("failed to get issues for pull request. Error: %s", e.Error()))
log.Debug("Scanning source branch code...")
scanDetails.SetUploadCdxResults(true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you explain to me what is the purpose of this line scanDetails.SetUploadCdxResults(true) ? and in general why did you add SetUploadCdxResults(upload bool) ?

Copy link
Collaborator Author

@eyalk007 eyalk007 Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/jfrog/frogbot/pull/1028/changes#r2693788773

evolved from the issue in this thread

in the past we sent results in scan repo always

and in sca pr only on the second scan, and we knew if we were the second scan because of value of DiffScan and , resultsToComapre see this:
SetUploadCdxResults(!sc.diffScan || sc.ResultsToCompare != nil)

now because scanning logic changed for scan pr,it became a lot more trivial to just send true or false to whether we need to upload results, than to let the function figure it out on its own

scaResult := <-scaChan
jasResult := <-jasChan

if scaResult.target != nil && scaResult.target.GetStatusCodes().ScaScanStatusCode != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no possible scenario where for example scaResult.target==nil and also err==nil ? because in this case there is no log at all

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only case is maybe if sca is turned off , which is basically what im checking here
will validate

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i updated the condition for this and sca considering all the edge cases (turned off by config, entitlements make jas not run)

dependencySubmissionFrogbotDetector = "JFrog Frogbot"
frogbotUrl = "https://github.com/jfrog/frogbot"
frogbotUploadRtRepoPath = "frogbot"
FrogbotUploadRtRepoPath = "frogbot"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will move it up

}
}

// CloneForBranchScan creates a clone configured for branch scanning with isolated logging.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ill proably remove comment say if its clear

- Use log.BufferedLogger directly instead of audit.LogCollector wrapper
- Replace HasLogs() with Len() > 0
- Remove duplicate diff log (already in cli-security)
- Reorder log statement for parallel scan start
Update jfrog-cli-security to bccd932 which fixes the issue where scan status codes
were not preserved during SCA/JAS result merging, causing 'Not Scanned' to appear
for JAS scans that actually ran but produced 0 new findings after diff.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new feature Automatically generated release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants