PR Scan - Option to scan only changed files in SAST#1284
Merged
PR Scan - Option to scan only changed files in SAST#1284
Conversation
Co-authored-by: Copilot <[email protected]>
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

feat(sast): add changed-files-only mode for PR SAST scansDepends on:
Description
This PR adds support for scanning only changed files in SAST mode for pull requests.
Reduces scan scope to modified files, improving performance and shortening Frogbot PR scan times, especially in large repositories.
It threads a new
sastChangedFilesOnlyconfiguration flag from schema or env (JF_SAST_CHANGED_FILES_MODE=true) parsing into scan execution and enriches PR Git context with modified-file data so the scanner can scope analysis to the PR diff.Changes
sastChangedFilesOnlyto schema and scan params parsing (schema/frogbot-schema.json,utils/params.go).JF_SAST_CHANGED_FILES_MODEand corresponding constant (utils/consts.go,utils/params.go).scanpullrequest/scanpullrequest.go,utils/scandetails.go).SetSastChangedFilesOnlytoScanDetailsand wired audit params withSetSastChangedFilesMode(...).GetModifiedFiles) intoChangedFiles, while tolerating provider errors (utils/scandetails.go).utils/params_test.go,utils/scandetails_test.go,scanpullrequest/scanallpullrequests_test.go).go.mod/go.sum(includingjfrog-client-gobump andjfrog-cli-securityreplace to forked revision).Testing
sastChangedFilesOnlyenv/default precedence.GetModifiedFilesfails.