From b09a4af17116044ee58b8d5341f3d2f33de9c1de Mon Sep 17 00:00:00 2001 From: Eyal Kapon Date: Sun, 29 Dec 2024 13:40:44 +0200 Subject: [PATCH 1/2] possible solution to test fail --- scanpullrequest/scanallpullrequests_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scanpullrequest/scanallpullrequests_test.go b/scanpullrequest/scanallpullrequests_test.go index 625d251ed..a15fc476d 100644 --- a/scanpullrequest/scanallpullrequests_test.go +++ b/scanpullrequest/scanallpullrequests_test.go @@ -128,8 +128,9 @@ func TestScanAllPullRequestsMultiRepo(t *testing.T) { Git: gitParams.Git, JFrogPlatform: utils.JFrogPlatform{XrayVersion: xrayVersion, XscVersion: xscVersion}, Scan: utils.Scan{ - FailOnSecurityIssues: &failOnSecurityIssues, - Projects: []utils.Project{{WorkingDirs: []string{utils.RootDir}, UseWrapper: &utils.TrueVal}}}, + AddPrCommentOnSuccess: true, + FailOnSecurityIssues: &failOnSecurityIssues, + Projects: []utils.Project{{WorkingDirs: []string{utils.RootDir}, UseWrapper: &utils.TrueVal}}}, } configAggregator := utils.RepoAggregator{ From 20eeb63ed31a379f682e495e2bd345d5f7e15677 Mon Sep 17 00:00:00 2001 From: Assaf Attias <49212512+attiasas@users.noreply.github.com> Date: Sun, 29 Dec 2024 14:01:04 +0200 Subject: [PATCH 2/2] Add option to control the Pnpm dependencies tree depth (#807) --- utils/consts.go | 1 + utils/params.go | 5 +++++ utils/scandetails.go | 1 + 3 files changed, 7 insertions(+) diff --git a/utils/consts.go b/utils/consts.go index ce7eb6d0a..171bbd8c6 100644 --- a/utils/consts.go +++ b/utils/consts.go @@ -53,6 +53,7 @@ const ( // Repository environment variables - Ignored if the frogbot-config.yml file is used InstallCommandEnv = "JF_INSTALL_DEPS_CMD" + MaxPnpmTreeDepthEnv = "JF_PNPM_MAX_TREE_DEPTH" RequirementsFileEnv = "JF_REQUIREMENTS_FILE" WorkingDirectoryEnv = "JF_WORKING_DIR" PathExclusionsEnv = "JF_PATH_EXCLUSIONS" diff --git a/utils/params.go b/utils/params.go index cd37388db..8a009b02e 100644 --- a/utils/params.go +++ b/utils/params.go @@ -89,6 +89,7 @@ type Project struct { WorkingDirs []string `yaml:"workingDirs,omitempty"` PathExclusions []string `yaml:"pathExclusions,omitempty"` UseWrapper *bool `yaml:"useWrapper,omitempty"` + MaxPnpmTreeDepth string `yaml:"maxPnpmTreeDepth,omitempty"` DepsRepo string `yaml:"repository,omitempty"` InstallCommandName string InstallCommandArgs []string @@ -131,6 +132,10 @@ func (p *Project) setDefaultsIfNeeded() error { if p.DepsRepo == "" { p.DepsRepo = getTrimmedEnv(DepsRepoEnv) } + if p.MaxPnpmTreeDepth == "" { + p.MaxPnpmTreeDepth = getTrimmedEnv(MaxPnpmTreeDepthEnv) + } + return nil } diff --git a/utils/scandetails.go b/utils/scandetails.go index c71570fae..1de80e0ba 100644 --- a/utils/scandetails.go +++ b/utils/scandetails.go @@ -180,6 +180,7 @@ func (sc *ScanDetails) RunInstallAndAudit(workDirs ...string) (auditResults *res SetXscVersion(sc.XscVersion). SetPipRequirementsFile(sc.PipRequirementsFile). SetUseWrapper(*sc.UseWrapper). + SetMaxTreeDepth(sc.MaxPnpmTreeDepth). SetDepsRepo(sc.DepsRepo). SetIgnoreConfigFile(true). SetServerDetails(sc.ServerDetails).